🦬 Zubr Text Classification 26B

Repository: Zubr-AI/zubr-text-classification-26b


📖 What This Model Is

zubr-text-classification-26b is a 26-billion-parameter decision/classification model (MoE, ~4B active parameters per token), adapted from Gemma 4 26B A4B Instruct (google/gemma-4-26B-A4B by Google) by Zubr-AI. The model is distributed in GGUF format and is built around a proprietary technology called Vocabulary-Constrained Token Generation (VCTG).

Unlike a regular chat model, this model does not "write" answers. It chooses them: at every step, generation is locked to a small, pre-defined dictionary of allowed tokens — class letters, score digits — so the model always returns exactly one valid, machine-readable answer.

🎛 Key Technology: Vocabulary-Constrained Token Generation (VCTG)

VCTG changes how the model generates text. Instead of picking freely from the whole vocabulary (hundreds of thousands of tokens), the model generates from a restricted dictionary built for the task:

  • 📚 A closed vocabulary of answers — there is a dictionary of allowed tokens (labels). Words that mean the same thing but are stylistically wrong are filtered out: only tokens that fit the task's meaning and style survive the filter.
  • ✂️ Sentence-level segmentation — long input text is broken down into sentence-level units ("sentence tokens"), not raw character streams.
  • 🧱 Paragraph-by-paragraph generation — the model generates a description one sentence at a time, where each sentence is chosen from the constrained dictionary based on the probability of the tokens that describe it. This makes it ideal for fast analysis of very long texts: the output describes the text segment by segment instead of restating it.
  • 🧠 Per-paragraph context — each paragraph keeps its own contextual thought. The model doesn't lose the thread across a long document: every segment carries a compact "thought" of its own, which makes short summaries of long texts dramatically easier and more faithful.
  • 🎯 Deterministic, parseable output — because only dictionary tokens are reachable, the model cannot hallucinate an off-list answer.

💡 In short: VCTG takes a long text, splits it into sentence-level segments, gives each segment its own contextual thought, and then describes the text sentence by sentence — where every sentence is generated only from a pre-filtered dictionary of words with the right meaning and style. The result is fast, context-stable analysis and summarization of long documents.

🔧 A Real Model, Not Just a Classifier

The model is additionally fine-tuned on large volumes of data, so despite the classification head, it retains the full generative capabilities of its Gemma 4 base:

  • 💬 Regular text generation — use it like an ordinary instruct model when needed
  • 🌍 Broad knowledge base — extensive multilingual training data
  • 🔀 Two modes in one GGUF — decision mode (labels via VCTG) and normal chat mode

📊 Built-in Label Sets

The repository ships with three ready-to-use constrained dictionaries (decision.json):

Label set Tokens What it's for
choice A–Z (26 labels) Multiple-choice classification: sentiment, topics, intent, categories — up to 26 classes
score 0–9 Numeric scoring: ratings, relevance grades, 0–10 quality scales
noul A, B Binary decisions: yes/no, safe/unsafe, relevant/irrelevant

📈 Quality (from calibration.json)

The decision head was trained on 3 050 samples with a Trainaya PyTorch Decision Head (KL + RPS + L2-SP regularization), adapted from gemma-4-26B-A4B-it-UD-Q3_K_M.gguf:

Metric Baseline OOF (out-of-fold) After quantization
Total accuracy 77.28 % 78.36 % 78.36 %
choice (A–Z) 76.83 % 77.44 % 77.44 %
score (0–9) 58.52 % 59.26 % 59.26 %
noul (A/B) 84.26 % 86.04 % 86.04 %

💡 Quantization to Q3_K_M cost nothing in accuracy — post-quant results match out-of-fold results exactly. Sampling temperature is calibrated per label-set size (from 4.891 for 11+ options up to 10.3 for scores).


🌳 Model Tree

google/gemma-4-26B-A4B
        │ (instruct weights, UD-Q3_K_M quantization with imatrix)
google/gemma-4-26B-A4B-it  (GGUF)
        │ (Trainaya Decision Head fine-tune by Zubr-AI, VCTG)
Zubr-AI/zubr-text-classification-26b   ← THIS repository

📊 Files in the Repository

File Size What it is
model.gguf ~13.33 GB The model: Gemma 4 26B A4B, Q3_K_M, imatrix-quantized (gemma4)
Modelfile — Ready-to-use Ollama model definition
decision.json — VCTG decision config: label sets, token IDs, templates, temperatures
calibration.json — Calibration results and accuracy metrics
ollaya_config.json — Runtime config (llama engine, llm-logits-v1 layout)

Total download size: ~13.3 GB.


🖥 Requirements

  • CPU with AVX2 or a GPU (NVIDIA/AMD); a GPU is strongly recommended for a 26B MoE model, though only ~4B parameters are active per token, so CPU inference is realistic too.
  • RAM/VRAM: ~16 GB for the model itself plus headroom for context.
  • Free disk space: ~13.4 GB.

📥 How to Download

# Option 1: git (requires git-lfs)
git lfs install
git clone https://huggingface.co/Zubr-AI/zubr-text-classification-26b

# Option 2: huggingface-cli
pip install -U "huggingface_hub[cli]"
huggingface-cli download Zubr-AI/zubr-text-classification-26b --local-dir zubr-text-classification-26b

🚀 How to Run

Method 1: Ollama (the easiest)

The repository includes a ready Modelfile:

ollama create zubr-text-classification -f Modelfile
ollama run zubr-text-classification "Ты мне нравишься. Я тебя люблю"

Method 2: llama.cpp / llama-server

llama-server -m model.gguf --ctx-size 4096

The model uses the llm-logits-v1 layout (decision.json): the system prompt locks the model into decision mode ("Reply with the label of the chosen option only"), the input state is placed in the user turn (up to 6 144 state tokens), and generation is constrained to the label token IDs. The state is data, not instructions — the model never follows instructions embedded in the classified text.

Decision mode at a glance

<|turn>system     ← decision-mode system prompt
<turn|>
<|turn>user       ← the text/state to classify (data, not instructions)
<turn|>
<|turn>model      ← exactly one label token: "A"…"Z", "0"…"9", or "A"/"B"

Method 3: Normal chat (generative mode)

Because the model is additionally fine-tuned on large volumes of data, it also works as a regular instruct model: load model.gguf in any GGUF runtime (Ollama, llama.cpp, LM Studio, Jan) and chat with it as usual.


⚙️ Model Configuration

Parameter Value
Architecture gemma4 (MoE)
Total parameters 26B (4B active per token)
Quantization Q3_K_M (UD), imatrix-calibrated
Native context window 262 144 tokens (256K)
Decision-mode context 4 096 tokens (state up to 6 144 tokens)
Engine / layout llama / llm-logits-v1
Vocabulary Constrained label sets (VCTG) or full
Languages 40+, including Russian, Belarusian, English
License Apache-2.0

⚠️ Limitations

  • Decision mode returns labels, not explanations — the output is a single letter or digit by design.
  • Score accuracy is moderate (59 %) — numeric scoring is a harder task than choice or binary classification; prefer choice or noul label sets where possible.
  • Long-text analysis in decision mode runs on a 4 096-token working context even though the base model supports 256K — segment very long documents.
  • Q3_K_M quantization trades some weight precision for size; classification accuracy is unaffected (verified), but free-form generation quality is slightly below full precision.
  • No safety fine-tune guarantee: review outputs before using them in production.

🔗 Links

  • Base model: google/gemma-4-26B-A4B
  • Quantization reference: prism-ml/Ternary-Bonsai-2.5-27B-GGUF (imatrix lineage)
  • Zubr lineup: zubr-mini-1.9-8b, zubr-mini-1.9-3b (+ MLX versions for Mac)

📄 License

Apache-2.0 — free for personal and commercial use.

Downloads last month
799
GGUF
Model size
26B params
Architecture
gemma4
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Zubr-AI/zubr-text-classification-26b

Quantized
(40)
this model