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.
from gliclass import GLiClassModel, ZeroShotClassificationPipeline
from transformers import AutoTokenizer
model = GLiClassModel.from_pretrained("knowledgator/gliclass-multilang-edge")
tokenizer = AutoTokenizer.from_pretrained("knowledgator/gliclass-multilang-edge")
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-edge")
tokenizer = AutoTokenizer.from_pretrained("knowledgator/gliclass-multilang-edge")
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.
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):
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},
}
Runs of knowledgator gliclass-multilang-edge on huggingface.co
641
Total runs
0
24-hour runs
-17
3-day runs
-55
7-day runs
178
30-day runs
More Information About gliclass-multilang-edge huggingface.co Model
gliclass-multilang-edge huggingface.co is an AI model on huggingface.co that provides gliclass-multilang-edge's model effect (), which can be used instantly with this knowledgator gliclass-multilang-edge model. huggingface.co supports a free trial of the gliclass-multilang-edge model, and also provides paid use of the gliclass-multilang-edge. Support call gliclass-multilang-edge model through api, including Node.js, Python, http.
gliclass-multilang-edge huggingface.co is an online trial and call api platform, which integrates gliclass-multilang-edge's modeling effects, including api services, and provides a free online trial of gliclass-multilang-edge, you can try gliclass-multilang-edge online for free by clicking the link below.
knowledgator gliclass-multilang-edge online free url in huggingface.co:
gliclass-multilang-edge is an open source model from GitHub that offers a free installation service, and any user can find gliclass-multilang-edge on GitHub to install. At the same time, huggingface.co provides the effect of gliclass-multilang-edge install, users can directly use gliclass-multilang-edge installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
gliclass-multilang-edge install url in huggingface.co: