A trainable decision head on a frozen Gemma 4: zero-label classification with a label-efficient upgrade path
We study a classifier that answers multiple-choice, graded-score and yes/no decision questions by reading the final hidden state of a frozen, 4-bit Gemma 4 E4B. With no labels, the head is exactly the model's own next-token preference among single-token answer handles, corrected by content-free calibration and order averaging. With labels, the same head is upgraded in place by a ladder of increasingly expressive corrections: a per-option bias and temperature (rung 1), then a per-option linear correction on the unit-length hidden state (rung 2), chosen per question type and checked against a held-out fifth of the labels. On eight suites drawn from CLINC150, Banking77 and SST-5, 20 labels per option raise accuracy by 2.5 to 15.7 points over the zero-label head and reduce expected calibration error 1.5 to 7×. Rung 2 helps on every intent suite from 5 labels per option but hurts on 5-level sentiment, which motivates a per-type default. We trace a training instability to the scale of Gemma's hidden states and fix it by normalisation. Re-tested with frozen settings on seven CLINC150 domains not used during development, the procedure gained 4.3 to 18.9 points at 20 labels per option.
1Introduction
Agent systems make many small routing and triage decisions: which team owns a request, how frustrated a customer is, whether something is urgent. A generative LLM can make these decisions, but generation is slow, its confidence is hard to read, and it cannot be improved from a handful of labelled examples without fine-tuning. We want a decision component that (i) works on day one with no labels, (ii) returns a calibrated probability for every option, (iii) runs locally on a small model, and (iv) gets measurably better as labels accumulate, without retraining or changing the model.
Our approach is a linear head on the final hidden state of a frozen Gemma 4 E4B. Its zero-label weights are Gemma's own output embeddings for the answer tokens, so with no data it reproduces the model's answer exactly; labels then train small corrections on top. This note contributes:
- a zero-label decision head with label-free corrections and a tokenisation fix for numeric answers (§3);
- a three-rung upgrade path with a guarded, calibrated training procedure (§3.4–3.5);
- learning curves from 0 to 100 labels per option on eight public suites, with a held-out re-test of the frozen settings (§5);
- ablations of the training procedure, including the cause of and fix for an instability in rung 2 (§6).
2Related work
Reading class probabilities from label tokens. Mapping each class to a single token and reading the model's next-token distribution over that closed set is now a common way to use an LLM as a classifier, typically followed by a separate calibration step before thresholds are trusted [15, 16]. Restricting and renormalising over label tokens can itself cause overconfidence [13], which our handle-mass diagnostic (§3.1) is designed to surface. Small (1–12B) models also hold on to the prior meaning of label words even against contrary demonstrations [14], which suggests option wording, not in-context examples, is the cheap lever for zero-label accuracy.
Calibration. Temperature scaling [1] and its per-class extensions such as vector and Platt scaling [3] fix the confidence of an otherwise fixed classifier; our rung 1 is this family. Contextual calibration [2] estimates a model's bias from a content-free input ("N/A") and divides it out without labels; our zero-label head uses it.
Probes on frozen representations. Training a linear classifier on a frozen network's activations [4] is a standard way to adapt a model cheaply, and recent work reports that probes on frozen LLM hidden states outperform zero- and few-shot prompting of the same model on classification while leaving the deployed model untouched [10, 11, 12]. Our rung 2 is such a probe, with one difference: it starts from the model's own answer rather than from random weights.
Residual corrections to a zero-shot classifier. In vision-language models, CLIP-Adapter [5] and Tip-Adapter [6] learn a correction added to CLIP's zero-shot classifier, and LP-FT [7] argues that starting from a good head distorts pretrained features less. Rung 2 applies the same idea to a decoder LLM's unembedding.
Alternatives. Parameter-efficient fine-tuning such as LoRA [8] usually wins once thousands of labels exist but changes the model and needs a training pipeline. Sentence-embedding classifiers such as SetFit [9] are cheap and strong but start from zero, with no label-free answer. We compare against neither here (§8).
3Method
3.1 Prompt and answer handles
A question is rendered as a task line, the options under single-token handles (letters A–Z without I for choice, digits for score, Yes/No for noul; about 34 options at most), the case text, and an Answer: line. Letters that occur as standalone tokens inside the question are skipped as handles. Gemma tokenises " 1" as a space followed by a digit, so score prompts end with Answer: including the trailing space; without it, the digit handles held 0.3% of the next-token probability. We report handle mass, the share of next-token probability on valid handles, as a diagnostic: the head only compares handles, so it can look confident when the model wants to say something else [13].
3.2 Zero-label head
Let \(h\) be the final-layer hidden state at the last position after the final norm, and \(U\) Gemma's output embedding. A handle may span several vocabulary rows (e.g. "A" and " A"), which are pooled by log-sum-exp after Gemma's logit soft-cap of 30:
\(\operatorname{softcap}(x) = 30\tanh(x/30)\); \(\operatorname{LSE}\) is log-sum-exp; option probabilities are \(\operatorname{softmax}_k(\ell_k)\).
With no labels this equals Gemma's next-token logit for each handle, restricted to the valid answers (a unit test checks the equality).
3.3 Label-free corrections
Each question is also scored on a blank case ("N/A") and \(\alpha = 0.7\) of that log-prior is subtracted, following contextual calibration [2] (1.0 over-corrected in earlier work). choice questions are scored in listed and reversed option order and the per-option log-probabilities averaged, to cancel position bias. The answer abstains when the top two probabilities are within 0.10.
3.4 Upgrade rungs
Rung 1 trains \(b\) and \(\log T\). Rung 2 additionally trains \(\delta \in \mathbb{R}^{K \times 2560}\) (one row per option), initialised at zero so training starts from the zero-label answer, in the spirit of residual adapters [5, 6, 7]. The correction reads the unit-length hidden state \(h/\lVert h\rVert\) rather than \(h\): Gemma 4's final hidden states have \(\lVert h\rVert_1 \approx 5{,}000\), so on raw \(h\) a single Adam step moved a logit by about 25 and training oscillated (§6.1). On \(h/\lVert h\rVert\) one step moves a logit by at most \(\eta\sqrt{D}\), where \(\eta\) is the step size and \(D = 2560\). All rungs train by full-batch Adam on cross-entropy for a fixed 400 steps.
3.5 Training procedure
train(), the procedure a user calls, takes the labelled cases for one question and:
- picks the requested rung by question type: rung 2 for
choice, rung 1 forscoreandnoul(from §5); - holds out a stratified fifth of each option's labels as a quiz; with under two labels per option on average it returns the zero-label head;
- fits every rung up to the requested one on the remaining labels and, for each, fits a temperature on the quiz by grid search (0.22× to 12×), recording the calibrated quiz loss;
- applies a guard: if the requested rung's quiz loss trails the best simpler rung by more than 0.05 nats, the next rung down is tried. The guard acts only when every option has at least two quiz labels (about 10 labels per option); below that the requested rung is kept;
- refits the chosen rung on all labels and applies the temperature correction found on the quiz.
The quiz is drawn only from the user's labelled cases; nothing in this procedure sees evaluation data.
3.6 Prefix caching
The prompt is split at the case text. The question prefix is identical across cases, so its KV cache is computed once and deep-copied per call (LRU of 64 prefixes). This gives the same predictions as full passes (probabilities within 0.01 on average, consistent with 4-bit numerical drift) and cut a 66-case routing suite from 520 to 187 ms per case on an Apple-silicon laptop.
4Experimental setup
4.1 Backbone
mlx-community/gemma-4-e4b-it-4bit (Gemma 4 E4B, instruction-tuned, 4-bit), frozen, run with MLX on one Apple-silicon machine. Hidden size 2,560.
4.2 Datasets
We have no large labelled set of our own decisions (two hand-written suites of 12 and 66 cases), so public datasets with separate train and test splits stand in. Options are described only by their intent names in words ("bill due"), so zero-label numbers are a floor.
| Suite | Dataset | Type | Options | Train pool | Test |
|---|
Table 1. Development suites. CLINC150 [17]: one domain of 15 intents plus an out_of_scope option trained on 100 and tested on 150 of CLINC's labelled out-of-scope queries. Banking77 [18]: 77 intents exceed the handle limit, so they are split into four fixed groups of 19–20 by a seeded shuffle. SST-5 [19]: 5-level movie-review sentiment, a score question; the test set is a seeded sample of 500 of 2,210 reviews. The held-out evaluation (§5.3) uses the other seven CLINC150 domains, built the same way.
4.3 What goes into training
- Training cases come only from each dataset's train split. The pool is capped at 100 per option (seeded); for a size n and draw s, n cases per option are sampled without replacement with seed s. Sizes: 5, 10, 20, 50, 100 labels per option; five draws each. At 100 every draw uses the whole pool.
- Test cases come only from the test split and are the same for every size, draw and head. No test case is used for training, the quiz, temperature fitting or the guard.
- The quiz in
train()is a stratified fifth of each draw's training sample. - Features. Hidden states for every case and view are computed once and cached, so all heads see identical inputs (18,118 development cases in 50 minutes).
4.4 Heads compared
Zero-label (rung 0); rung 1 alone; rung 2 alone; and train(), the shipped procedure. Rungs 1 and 2 alone are trained on the full sample with no quiz, guard or calibration.
4.5 Hyperparameters
| Setting | Value | How chosen |
|---|---|---|
| Content-free prior weight \(\alpha\) | 0.7 | Prior work on the same task family |
| Steps, optimiser | 400, Adam | Development suites |
| Learning rate (rung 1 / rung 2) | 0.05 / 0.02 | Development suites |
| Weight decay on \(b\) / \(\delta\) | 1e-3 / 0 | Development suites (§6.2) |
| Quiz fraction | 0.2 | Fixed a priori |
| Guard margin | 0.05 nats | Development suites |
| Guard minimum quiz labels per option | 2 | Development suites (§6.2) |
| Temperature grid | 81 points, 0.22×–12× | Fixed a priori |
| Abstain margin | 0.10 | Fixed a priori, not tuned |
| Rung by type (choice / score / noul) | 2 / 1 / 1 | Development suites; noul untested |
Table 2. Every setting marked "development suites" was chosen while looking at test-split results of the eight suites in Table 1; §5.3 re-tests them on data not used for any choice.
4.6 Metrics
Accuracy; expected calibration error (ECE, 10 equal-width bins on top-1 confidence); abstain rate; for CLINC, out-of-scope recall and precision. We report the mean and standard deviation over the five draws.
5Results
5.1 Learning curves
Figure 1 and Table 3 show test accuracy against labels per option. On all seven intent suites rung 2 leads from 5 labels per option, and most of the gain arrives by 20. On SST-5, rung 2 falls below the zero-label line while rung 1 gains 5 points, so train() uses rung 1 for score questions; the per-type default was chosen from these curves.
train() keeps rung 2, its line covers rung 2's. Hover a point for its numbers.Table 3. Accuracy by head and labels per option
Mean ± standard deviation over five draws, in percent. Bold is the best in each group. At 100 labels every draw uses the whole pool, so there is no spread.
5.2 Accuracy and calibration at 20 labels per option
At 20 labels per option, train() adds 2.5 to 15.7 points over the zero-label head (median 6.7; Figure 2). The largest gains are on Banking77 groups 1 and 3, where intent names alone are most ambiguous. Rung 2 alone is overconfident; fitting the temperature on the quiz brings train() below both the zero-label head and uncalibrated rung 2 in ECE on every suite (Figure 3). On CLINC travel, out-of-scope recall rises from 75% to 91%. Across all sizes, no train() mean falls below its zero-label head.
5.3 Held-out re-test of the frozen settings
6Analysis and ablations
6.1 Training stability of rung 2
An earlier version added the correction to the answer embedding, \((U + \delta)\cdot h\). In 7 of 32 size-by-suite settings one draw fell far below the others. Tracing a collapsed run step by step (Figure 5) showed oscillation from the first step rather than gradual overfitting: with \(\lVert h\rVert_1 \approx 5{,}000\), one Adam step of 0.005 per weight could move a logit by about 25. The unstable runs had ended mid-swing. Reading \(h/\lVert h\rVert\) removes this; the draws in previously unstable settings now sit within about two points (Figure 6).
6.2 Design choices tested and rejected
| Variant | Result | Decision |
|---|---|---|
| Early stopping on quiz loss | Quiz loss turns up after 10–40 steps while accuracy keeps rising to ~400; 92.3% vs 94.2% (Banking77 g1, 20/option) | Fixed 400 steps |
| Rung chosen by quiz loss alone | Too noisy with small quizzes: picked no training in 4 of 5 draws on CLINC banking at 5/option | Default by type, guard as a check |
| Guard with one quiz label per option | Wrong fallbacks cost 1–2 points at 5/option | Guard needs 2 per option |
| Weight decay on \(\delta\) (normalised \(h\)) | 83% vs 94% (Banking77 g1, 20/option) | Off |
| Case text before the question (state-first), for cross-question caching | 2–2.7× faster per case on long texts; urgency 83% vs 92%; blank-input prior over-corrects | Opt-in only, without the prior |
Score prompt ending Answer: (no space) | Handle mass 0.003; frustration accuracy 67% vs 75% | Trailing space |
Table 5. The first four rows were measured on development-suite test splits; the last two on the hand-written support suite (12 cases), so their accuracy differences are a few cases each.
7Error analysis
We compare the zero-label head with train() at 20 labels per option on the same test queries. Most fixes teach a dataset's labelling conventions, which intent names do not convey: Banking77 files "how do I check my new card's PIN" under get_physical_card, and that one convention accounts for 36 of 130 fixes in group 1. Regressions cluster on pairs that annotators could reasonably dispute.
| Suite | Fixed | Broken | Most common fix (was → now) |
|---|
Table 6. Test queries the zero-label head got wrong and train() got right (fixed), and the reverse (broken), for one draw at 20 labels per option.
Fixed by training
Broken by training
8Limitations: what is missing
- No in-distribution data. Every number is on public benchmarks. We have 78 hand-written cases of our own, too few to train and measure. How the head does on real decision traffic is unknown.
- No external baselines. We did not compare against few-shot prompting, a larger generative model, LoRA fine-tuning [8], or an embedding classifier such as SetFit [9]. The results show the head improves on itself, not that it beats these alternatives.
- One backbone, one precision. Only Gemma 4 E4B at 4 bits. Other sizes, families and full-precision weights are untested, and the hidden-state scale that motivated normalisation may differ.
- Settings tuned on test splits. The hyperparameters in Table 2 were chosen while viewing development test results. The held-out re-test (§5.3) found gains as large or larger with the settings frozen, but its domains come from the same dataset, and share its annotation style, with three development suites.
- Yes/no questions are unmeasured. The
nouldefault of rung 1 is inferred, not tested. - Benchmark artefacts. Public intent sets are cleaner and more repetitive than real traffic, and near-duplicate phrasings across splits flatter trained numbers. Banking77 is split into groups of about 20, so results are not comparable to published 77-way numbers.
- Statistics. Five draws per setting; we report standard deviations but no significance tests or confidence intervals on differences.
- Guard misfires at 10 labels per option, occasionally dropping rung 2 when it was better (up to 1.4 points on Banking77).
- Not measured: handle mass on the public suites (only on the hand-written ones), the abstain threshold's trade-off, latency on long cases beyond the sample suites, and label noise in the benchmarks.
9Future work
- Label about 20 of our own cases per option.Most of the gain on every intent suite arrived by 20 per option. For the treasury router that is about 120 labelled requests, and it is the only way to measure real traffic.
- Add external baselines.Few-shot prompting of the same model, SetFit [9] and a small LoRA [8] on the same draws would place the head among the alternatives teams actually use.
- Write one-line option descriptions.Many fixes were naming conventions, and small models anchor strongly on label wording [14]. Better descriptions should raise the zero-label floor.
- Measure yes/no questions and handle mass on public suites.Confirms the
nouldefault and quantifies the renormalisation overconfidence described in [13]. - Tune the guard at 10 labels per option.Raise its quiz minimum, or keep rung 2 unconditionally for choice questions now that it is stable.
References
- C. Guo, G. Pleiss, Y. Sun, K. Q. Weinberger. On Calibration of Modern Neural Networks. ICML 2017. arXiv:1706.04599
- Z. Zhao, E. Wallace, S. Feng, D. Klein, S. Singh. Calibrate Before Use: Improving Few-Shot Performance of Language Models. ICML 2021. arXiv:2102.09690
- J. Platt. Probabilistic Outputs for Support Vector Machines and Comparisons to Regularized Likelihood Methods. Advances in Large Margin Classifiers, 1999.
- G. Alain, Y. Bengio. Understanding Intermediate Layers Using Linear Classifier Probes. 2016. arXiv:1610.01644
- P. Gao et al. CLIP-Adapter: Better Vision-Language Models with Feature Adapters. 2021. arXiv:2110.04544
- R. Zhang et al. Tip-Adapter: Training-free CLIP-Adapter for Better Vision-Language Modeling. ECCV 2022. arXiv:2111.03930
- A. Kumar, A. Raghunathan, R. Jones, T. Ma, P. Liang. Fine-Tuning can Distort Pretrained Features and Underperform Out-of-Distribution. ICLR 2022. arXiv:2202.10054
- E. J. Hu et al. LoRA: Low-Rank Adaptation of Large Language Models. ICLR 2022. arXiv:2106.09685
- L. Tunstall et al. Efficient Few-Shot Learning Without Prompts (SetFit). 2022. arXiv:2209.11055
- A BERTology View of LLM Orchestrations: Token- and Layer-Selective Probes for Efficient Single-Pass Classification. ACL 2026. arXiv:2601.13288 *
- Structured but Silent: Probing Capability Requirements in LLM Hidden States. 2026. arXiv:2610.08018 *
- Probing Hidden States for Calibrated, Alignment-Resistant Predictions in LLMs. medRxiv 2025. 10.1101/2025.09.17.25336018 *
- The Silent Vote: Improving Zero-Shot LLM Reliability by Aggregating Semantic Neighborhoods. 2026. arXiv:2605.09739 *
- Semantic Anchors in In-Context Learning: Why Small LLMs Cannot Flip Their Labels. 2025. arXiv:2511.21038 *
- Fireworks AI. Fine-Tune an LLM Classifier with Calibrated Probabilities. Blog, December 2025. fireworks.ai
- ClassifyLM: LLM-Based Classification (overview including SALSA). emergentmind.com *
- S. Larson et al. An Evaluation Dataset for Intent Classification and Out-of-Scope Prediction (CLINC150). EMNLP 2019. D19-1131
- I. Casanueva et al. Efficient Intent Detection with Dual Sentence Encoders (Banking77). NLP4ConvAI 2020. arXiv:2003.04807
- R. Socher et al. Recursive Deep Models for Semantic Compositionality Over a Sentiment Treebank (SST). EMNLP 2013. D13-1170
* Recent work located by search and cited from its abstract and summary; we have not read these in full or independently verified their claims.