Back to Models
KN

knowledgator/gliclass-multilang-mini

knowledgatorgeneral

image/png

Multilingual Quality vs Throughput

GLiClass Multilang: Efficient multilingual zero-shot and few-shot multi-task model via sequence classification

GLiClass is an efficient zero-shot sequence classification model designed to achieve SoTA performance while being much faster than cross-encoders and LLMs, while preserving strong generalization capabilities.

The model supports text classification with any labels and can be used for the following tasks:

  • Topic Classification
  • Sentiment Analysis
  • Intent Classification
  • Reranking
  • Hallucination Detection
  • Rule-following Verification
  • LLM-safety Classification
  • Natural Language Inference

✨ What's New in GLiClass Multilang

  • Multilingual Training — Natively trained on 20 languages: Swedish, Norwegian, Czech, Polish, Lithuanian, Estonian, Latvian, Spanish, Finnish, German, French, Romanian, Italian, Portuguese, Dutch, Ukrainian, Hindi, Chinese, Arabic, and Hebrew.
  • Cross-lingual Classification — Labels and input texts can be in different languages; classify a German document with English labels, or mix languages freely across inputs and labels.
  • CrossAttn Scorer — A new cross-attention scorer enables more efficient pooling independently for each label with unpadding and flash-attn.
  • Hierarchical Labels — Organize labels into groups using dot notation or dictionaries (e.g., sentiment.positive, topic.product).
  • Few-Shot Examples — Provide in-context examples to boost accuracy on your specific task.
  • Label Descriptions — Add natural-language descriptions to labels for more precise classification.
  • Task Prompts — Prepend a custom prompt to guide the model's classification behavior.

See the GLiClass library README for full details on these features.

Installation

pip install gliclass

Quick Start

from gliclass import GLiClassModel, ZeroShotClassificationPipeline
from transformers import AutoTokenizer

model = GLiClassModel.from_pretrained("knowledgator/gliclass-multilang-mini")
tokenizer = AutoTokenizer.from_pretrained("knowledgator/gliclass-multilang-mini")
pipeline = ZeroShotClassificationPipeline(model, tokenizer, classification_type='multi-label', device='cuda:0')

text = "NASA launched a new Mars rover to search for signs of ancient life."
labels = ["space", "politics", "sports", "technology", "health"]

results = pipeline(text, labels, threshold=0.5)[0]
for r in results:
    print(r["label"], "=>", r["score"])

Multilingual & Cross-lingual Capabilities

Natively trained on 20 languages. Labels and texts can be in different languages.

Same language (German):

from gliclass import GLiClassModel, ZeroShotClassificationPipeline
from transformers import AutoTokenizer

model = GLiClassModel.from_pretrained("knowledgator/gliclass-multilang-mini")
tokenizer = AutoTokenizer.from_pretrained("knowledgator/gliclass-multilang-mini")
pipeline = ZeroShotClassificationPipeline(model, tokenizer, classification_type='multi-label', device='cuda:0')

text = "Die NASA hat einen neuen Mars-Rover gestartet, um nach Spuren alten Lebens zu suchen."
labels = ["Weltraum", "Politik", "Sport", "Technologie", "Gesundheit"]
results = pipeline(text, labels, threshold=0.5)[0]
for r in results:
    print(r["label"], "=>", r["score"])

Cross-lingual (French text, English labels):

text = "Le gouvernement français a annoncé de nouvelles mesures économiques."
labels = ["economy", "politics", "sports", "technology"]
results = pipeline(text, labels, threshold=0.5)[0]
for r in results:
    print(r["label"], "=>", r["score"])

Cross-lingual (Arabic text, English labels):

text = "أطلقت ناسا مركبة جديدة للمريخ للبحث عن آثار الحياة القديمة."
labels = ["space", "politics", "sports", "technology"]
results = pipeline(text, labels, threshold=0.5)[0]
for r in results:
    print(r["label"], "=>", r["score"])

Cross-lingual (English text, Spanish labels):

text = "NASA launched a new Mars rover to search for signs of ancient life."
labels = ["espacio", "política", "deportes", "tecnología", "salud"]
results = pipeline(text, labels, threshold=0.5)[0]
for r in results:
    print(r["label"], "=>", r["score"])
General Examples

1. Topic Classification

text = "NASA launched a new Mars rover to search for signs of ancient life."
labels = ["space", "politics", "sports", "technology", "health"]

results = pipeline(text, labels, threshold=0.5)[0]
for r in results:
    print(r["label"], "=>", r["score"])

With hierarchical labels

hierarchical_labels = {
    "science": ["space", "biology", "physics"],
    "society": ["politics", "economics", "culture"]
}

results = pipeline(text, hierarchical_labels, threshold=0.5)[0]
for r in results:
    print(r["label"], "=>", r["score"])
# e.g. science.space => 0.95

2. Sentiment Analysis

text = "The food was excellent but the service was painfully slow."
labels = ["positive", "negative", "neutral"]

results = pipeline(text, labels, threshold=0.5)[0]
for r in results:
    print(r["label"], "=>", r["score"])

With a task prompt

results = pipeline(
    text, labels,
    prompt="Classify the sentiment of this restaurant review:",
    threshold=0.5
)[0]

3. Intent Classification

text = "Can you set an alarm for 7am tomorrow?"
labels = ["set_alarm", "play_music", "get_weather", "send_message", "set_reminder"]

results = pipeline(text, labels, threshold=0.5)[0]
for r in results:
    print(r["label"], "=>", r["score"])

4. Natural Language Inference

Represent your premise as the text and the hypothesis as a label. The model works best with a single hypothesis at a time.

text = "The cat slept on the windowsill all afternoon."
labels = ["The cat was awake and playing outside."]

results = pipeline(text, labels, threshold=0.0)[0]
print(results)
# Low score → contradiction

5. Reranking

Score query–passage relevance by treating passages as texts and the query as the label:

query = "How to train a neural network?"
passages = [
    "Backpropagation is the key algorithm for training deep neural networks.",
    "The stock market rallied on strong earnings reports.",
    "Gradient descent optimizes model weights during training.",
]

for passage in passages:
    score = pipeline(passage, [query], threshold=0.0)[0][0]["score"]
    print(f"{score:.3f}  {passage[:60]}")

6. Rule-following Verification

Include the domain and rules as part of the text:

text = (
    "Domain: e-commerce product reviews\n"
    "Rule: No promotion of illegal activity.\n"
    "Text: The software is okay, but search for 'productname_patch_v2.zip' "
    "to unlock all features for free."
)
labels = ["follows_guidelines", "violates_guidelines"]

results = pipeline(text, labels, threshold=0.0)[0]
for r in results:
    print(r["label"], "=>", r["score"])

Benchmarks

Model Overview

Summary across all evaluated multilingual-capable models (zero-shot, no fine-tuning). Speed averaged over all label counts and text lengths at batch_size=8 on NVIDIA RTX PRO 6000 Blackwell.

ModelParamsEnglish avg F1Multilingual avg F1Throughput (samp/s, bs=8)
multilang‑ultra~1 720M0.72120.5599200.7
multilang‑mini~288M0.68270.5378513.4
multilang‑edge~140M0.61960.3959553.6
instruct‑large~435M0.7199293.9
instruct‑base~184M0.6525521.9
gliner2‑large‑v1340M0.6774122.5
gliner2‑multi‑v1~278M0.63870.4659200.2
gliner2‑base‑v1~184M0.6336224.0
bge‑m3‑zeroshot‑v2.0568M0.59270.5225208.7
mDeBERTa‑mnli300M0.53400.3926160.6

Multilingual avg F1 is the mean of 6 dataset-level scores (GermEval2017, MASSIVE, PolygloToxicityPrompts, SIB-200, TextDetox, TweetSentiment). Models without multilingual results (—) were only evaluated on English datasets.


F1 scores on zero-shot text classification (no fine-tuning on these datasets):

Table A: GLiClass Multilang (macro F1)

Datasetmultilang‑ultramultilang‑minimultilang‑edge
CR0.92260.90420.8852
sst20.90650.88100.8276
sst50.30490.28060.3047
20_newsgroups0.52380.42420.3522
spam0.96250.93850.6787
financial_phrasebank0.87240.71560.7446
imdb0.93300.90110.8730
ag_news0.74540.75450.7338
emotion0.48250.46550.4267
cap_sotu0.43850.40870.3516
rotten_tomatoes0.84130.82360.7044
massive0.64830.58530.5649
banking0.64920.58530.5788
snips0.86530.89000.6487
AVERAGE0.72120.68270.6196

Table B: Baselines (macro F1)

Datasetgliner2‑large‑v1gliner2‑multi‑v1gliner2‑base‑v1bge‑m3‑zeroshot‑v2.0mDeBERTa‑mnli
CR0.91170.87850.87830.90410.8956
sst20.89110.85680.87370.92570.8516
sst50.44620.37840.41000.29310.3023
20_newsgroups0.51630.36680.46080.41610.2080
spam0.35580.59860.38430.44100.4980
financial_phrasebank0.83300.73720.72250.50400.4444
imdb0.91700.89340.89820.87300.8264
ag_news0.70290.74030.71930.68700.6547
emotion0.52330.46660.45770.45300.4055
cap_sotu0.43870.39720.38310.47200.3390
rotten_tomatoes0.79090.72100.69790.81300.6931
massive0.58970.47210.54030.41400.2527
banking0.68850.63900.67090.38700.3796
snips0.87880.79540.77310.71490.7245
AVERAGE0.67740.63870.63360.59270.5340

Table C: GLiClass-V1 Multitask (macro F1)

Datasetinstruct‑large‑v1.0instruct‑base‑v1.0edge‑v1.0
CR0.90660.89220.7933
sst20.91540.91980.7577
sst50.33870.22660.2163
20_newsgroups0.55770.51890.2555
spam0.97900.93800.7609
financial_phrasebank0.82890.52170.3905
imdb0.93970.93640.8159
ag_news0.75210.69780.6043
emotion0.44730.44540.2941
cap_sotu0.43270.45790.2380
rotten_tomatoes0.84910.84580.5455
massive0.58240.47570.2090
banking0.69870.60720.4635
snips0.85090.65150.5461
AVERAGE0.71990.65250.4922

Multilingual Benchmarks

Macro F1 averaged per dataset across all evaluated languages:

Datasetmultilang‑ultramultilang‑minimultilang‑edgegliner2‑multi‑v1bge‑m3‑zeroshot‑v2.0mDeBERTa‑mnli
germeval20170.46470.48260.40940.42230.45030.2849
massive0.56350.49250.28530.36250.46460.2427
polyglot_toxicity0.73670.71100.44740.66300.68090.5698
sib2000.19350.19210.14920.17500.18910.1476
textdetox0.74280.73130.58110.59120.75100.6490
tweet_sentiment0.65790.61710.50300.58140.59910.4615
AVERAGE0.55990.53780.39590.46590.52250.3926

Per-language macro F1 (16-language fair comparison on massive + sib200):

Languagemultilang‑ultramultilang‑minimultilang‑edgegliner2‑multi‑v1bge‑m3‑zeroshot‑v2.0mDeBERTa‑mnli
arabic0.32100.30430.18430.23940.28620.1567
chinese0.38880.36360.27240.29470.34590.2356
dutch0.39490.35870.26600.28280.32840.2146
finnish0.36320.31740.11720.27040.33570.1884
french0.39650.36790.29630.29460.33960.1978
german0.36540.34570.25320.27670.31640.1966
hebrew0.35210.32060.12710.26410.32870.1796
hindi0.39340.35290.18770.08170.32400.1986
italian0.39190.34740.26040.28910.31460.1976
latvian0.36430.31650.12050.27410.31630.1774
norwegian0.37700.34890.20430.28030.33820.1965
polish0.39610.35770.21120.28140.32250.1981
portuguese0.40080.34820.27980.30570.33460.1936
romanian0.37400.32040.22100.28310.32910.1944
spanish0.39210.35350.29050.29240.33710.1918
swedish0.38630.35470.21210.27990.33170.2019
AVERAGE0.37860.34240.21900.26810.32680.1950

Throughput

English Quality vs Throughput

Throughput (samples/sec), batch_size=8, GPU: NVIDIA RTX PRO 6000 Blackwell. Averaged over text lengths (64 / 256 / 512 tokens).

Model1 label248163264128256avg
multilang‑ultra308.2302.5281.8266.3235.9190.5125.264.731.5200.7
multilang‑mini708.4703.9692.5664.2618.1518.1396.1221.298.2513.4
multilang‑edge697.0699.7689.5671.0637.7553.3469.8345.2219.2553.6
instruct‑large397.2393.1386.6374.2351.1313.3223.8142.263.2293.9
instruct‑base708.0707.5693.5666.4616.7526.5405.5248.1124.9521.9
gliner2‑large‑v1165.6165.2157.1155.6142.1122.198.665.631.0122.5
gliner2‑multi‑v1270.4267.9264.6257.3237.2200.0159.296.848.4200.2
gliner2‑base‑v1296.8293.2287.8278.9262.0229.4180.1121.366.2224.0
bge‑m3‑zeroshot‑v2.0940.0474.7238.4112.958.328.914.47.23.7208.7
mDeBERTa‑mnli717.5364.5183.191.845.722.811.45.73.0160.6

NLI models (bge-m3, mDeBERTa) run one forward pass per label — throughput drops linearly with label count. GLiClass and GLiNER2 encode all labels in a single pass, so throughput stays nearly flat.

Citation

@misc{stepanov2025gliclassgeneralistlightweightmodel,
      title={GLiClass: Generalist Lightweight Model for Sequence Classification Tasks}, 
      author={Ihor Stepanov and Mykhailo Shtopko and Dmytro Vodianytskyi and Oleksandr Lukashov and Alexander Yavorskyi and Mykyta Yaroshenko},
      year={2025},
      eprint={2508.07662},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2508.07662}, 
}
Visit Website

0 reviews

5
0
4
0
3
0
2
0
1
0
Likes5
Downloads
📝

No reviews yet

Be the first to review knowledgator/gliclass-multilang-mini!

Model Info

Providerknowledgator
Categorygeneral
Reviews0
Avg. Rating / 5.0

Community

Likes5
Downloads

Rating Guidelines

★★★★★Exceptional
★★★★Great
★★★Good
★★Fair
Poor