EmbeddingGemma-2 zero-shot classifier
fast text and intent classifier
2 min readupdated
The model handles zero-shot classification (determining a text category without prior training on it) and decision-making tasks. It takes text (a message, ticket, or query) along with response options as input, and returns the probabilities for each option in a single pass. Based on google/embeddinggemma-2, the project contains around 270 million parameters and supports multiple languages. Thanks to its lightweight architecture, the new release operates roughly 15 times faster than similar solutions and proves useful for support automation, request routing, and sentiment analysis.
Key features
- High speed: processes a request in milliseconds (around 8.7 ms on a T4 GPU).
- Multilingualism: handles classification well across different languages, including intent datasets.
- Format flexibility: supports metric selection, multi-label classification, and categorical questions.
- Fine-tuning: trained using knowledge distillation and InfoNCE losses on 58 thousand examples.
What you can do
- Ticket classification: automatically distributes incoming tech support requests into categories.
- Sentiment analysis: detects emotions and intents in user messages and tweets.
- Model routing: determines suitable subtasks for complex AI pipelines.
- Multilingual search: filters or categorizes multilingual content on the fly.
Example
The repository does not include a ready-to-use inference script, but it uses text embeddings with mean pooling and specialized classification heads (log_scale, gate, and noul_head) on top of the model.safetensors weights.
Read more
Details• Benchmarks: average accuracy reaches 0.628 on Laya tests and 0.609 on xbench.
• Limitations: struggles with yes/no questions (for instance, spam detection stays at a random guess level of 0.50).
• Training: 2 epochs on 58k questions with distillation from the jaredpalmer/kev-4b teacher.
• License: distributed under the terms of Google Gemma use.










Comments