Fine-Tuning an NLI Encoder as a 90-Row Classifier: 40/41, and Why I Didn't Trust It
Two small classifiers, one lesson: the number you get on your own sealed eval is a statement about your eval as much as your model.
| # | Model | Train rows | Sealed eval | What happened |
|---|---|---|---|---|
| 1 | RoBERTa-large-MNLI, zero-shot | 0 | 34.1% (14/41) | Says everything is a task |
| 2 | Qwen3-Embedding-0.6B + logistic probe | 90 | 87.8% (36/41) | Below the bar |
| 3 | DistilBERT, fine-tuned | 90 | 90.2% (37/41) | Below the bar |
| 4 | LLM baseline: a small LLM call | -- | 95.1% (39/41), recall 12/14 | Misses real tasks |
| 5 | RoBERTa-large-MNLI, EFL fine-tune | 90 | 97.6% (40/41), recall 14/14 | Cleared all three pre-set bars |
| 6 | Same, after a blind relabel of the gold | -- | ~76–80% (derived) | 9 of 41 labels overturned |
| 7 | Suggestion gate: 4,100-param probe on embeddings | 106 | F1 0.947 | Then padding broke it: 93% of positives suppressed |
In three lines: reusing an NLI model's entailment head as the classifier turned 90 labelled threads into a 40/41 model in 77 seconds on a laptop. The gap to the LLM baseline wasn't significant (McNemar p = 1.0), and a blind relabel overturned 9 of the 41 gold labels. And a padding experiment showed an embedding-probe classifier was reading the length and topic of its input, not the cue it was trained for.
The Two Jobs
Both classifiers are gates in front of an LLM call that runs on high-volume, always-on traffic, where the cost per message should be close to zero:
- Is-task: does this message thread contain a real, delegable piece of work? Binary.
- Suggestion gate: after an assistant turn, should the assistant suggest a next step, or stay quiet? Four classes.
The baseline for both was a small LLM call. The plan was to distill that judgment into an encoder, estimated at about 100× cheaper per call, then prove it on real traffic before letting it decide anything.
The EFL Trick: Don't Initialise a New Head
With only 90 labelled training threads, the worst thing you can do is bolt a randomly initialised classification head onto an encoder and hope 90 examples teach it. So I didn't add a head at all.
RoBERTa-large-MNLI already has a 3-way classifier: contradiction, neutral, entailment. Entailment as Few-shot Learner (EFL) reframes the task as an entailment question. The thread is the premise, and the hypothesis is fixed:
Someone is asking for or committing to work that still needs to be done.
Training labels map onto the existing classes: a task becomes entailment, a non-task becomes contradiction. Neutral is never used. The head keeps everything it learned from MNLI, and fine-tuning only has to move its notion of "entails" toward this one hypothesis. At inference:
p_task = P(entail) / (P(entail) + P(contradiction))
task iff p_task > 0.5
Without fine-tuning, the same hypothesis gets 14/41: stock MNLI thinks every thread entails "someone is asking for work". That's a useful baseline. It shows the prior is there, and it's miscalibrated for this boundary.
Recipe: full fine-tune of all 355M parameters, AdamW at LR 1e-5, weight decay 0.01, batch 4, up to 10 epochs with early stopping on dev macro-F1 (patience 3, best checkpoint restored), max length 256, seed 3. Apple-silicon GPU on a laptop: 77 seconds including model load.
The serialisation matters more than it looks. Threads are fed as author: text | author: text, byte-identical in training and serving. A bare sentence without that frame is out of distribution and scores near zero.
Data: 90 Rows, Sealed Evals, Eight Gates
All data is synthetic, generated per cell: a label crossed with a scenario family (a research request, a self-commitment, an automated notification, a celebration message, and so on), including hard negatives designed to look like tasks but not be one.
| Split | Rows | Labels |
|---|---|---|
| Train | 90 (73 base + 17 augmented variants for thin cells) | 28 task / 62 not |
| Dev | 17 | 7 / 10 |
| Sealed eval | 41 (35 families, 12 hard-negative families) | 14 / 27 |
The eval was sealed by hash before training, and a dataset verifier ran eight checks on every file: schema, internal dedup (exact and Jaccard ≥ 0.85), contamination against the sealed set (hard fail at Jaccard ≥ 0.6; the closest training row is 0.538), class and cell balance, length distribution, a leakage probe that flags tokens appearing ≥ 6 times and ≥ 95% in one class as possible synthetic tells, a label-hidden review sample, and a provenance hash.
The bars were written into the training script before the frozen shot: accuracy ≥ 0.927, task precision ≥ 0.92, task recall ≥ 0.786. One frozen shot, no reruns against the sealed set.
The Model Ladder


The EFL fine-tune: 40/41. Precision 0.933, recall 1.000 (14/14 real tasks), F1 0.966. Its single error is a one-message hard negative it called a task with p = 0.875. The LLM baseline got 39/41, with perfect precision but two missed tasks (recall 0.857). The dev curve saturated at epoch 2 (F1 0.833 → 1.000) and early stopping kept that checkpoint.
I re-ran the whole thing months later from the committed kit: same seed, same data, same 40/41, same single miss.
Then I Checked the Ruler
40/41 vs 39/41 is the kind of result that gets a model switched on. Before that, two things.
The statistics. On the same 41 items, the two systems disagree on exactly 3: the baseline misses 2 tasks the model gets, and the model misses 1 the baseline gets. Exact McNemar p = 1.0. The 95% Wilson interval for the model's accuracy is [0.874, 0.996]; for the baseline, [0.839, 0.987]. On 41 items, this is not a difference.
The labels. A blind second-pass judge relabelled the 41 sealed items without seeing the originals. It overturned 9 of them, all in the same direction: toward "task". My gold had a narrower definition of "task" than "anything someone must act on". Training data and eval came from the same generator, so they shared that narrow boundary. The model scored 40/41 partly by agreeing with my own definition.
Working through the confusion matrices under the broader labels (derived, not measured): the model's task recall falls to about 0.61–0.65 and its accuracy to about 76–80%; the baseline's recall to 0.52 and accuracy to 73%. The ranking survives. The absolute numbers don't.
So I treat every number above as an internal-consistency check, not proof. With labels that unreliable, a better score on my own set can't show the model is better. The test that can is a shadow comparison on real traffic: run the model next to the baseline, log both verdicts, let the model decide nothing, and have the disagreements reviewed. If the reviewed disagreements favour the model, that is evidence; 40/41 on my own set isn't.
A shadow bug worth knowing about. The first version of the shadow compared the model to the baseline's raw verdict. But the baseline only acts when its confidence is ≥ 0.7, so "baseline says task at 0.64, model says task" was logged as agreement while the effective decisions differed. That undercounts disagreements exactly where the baseline is marginal, which is where the comparison matters most. The fix: log the effective decision, compare effective against shadow, and keep the raw agreement as a secondary field.
The Suggestion Gate Was Reading Length
The second classifier was even cheaper: a frozen Qwen3-Embedding-0.6B (the same embedder used for retrieval) plus a multinomial logistic layer. That's 1,024 × 4 weights and 4 biases, 4,100 parameters, temperature-calibrated on dev (T = 0.20). Trained on 106 short (user, assistant) pairs, it scored F1 0.947 on its sealed 58 for "suggest vs stay quiet" (precision 0.90, recall 1.00), and 0.931 on the 4-class version.
The training pairs were at most 141 characters long. Real assistant answers are thousands of characters. So I tested what length does, by padding the assistant text in the sealed set to a target length with text unrelated to the decision:


| Padding added | none | 500 chars | 1,000 | 2,500 | 5,000 |
|---|---|---|---|---|---|
| Unrelated prose, appended: real suggestions suppressed (of 27) | 0% | 52% | 67% | 93% | 89% |
| Unrelated prose, prepended: suppressed | 0% | 48% | 63% | 89% | 96% |
| Office-like paragraph: quiet turns that now fire (of 31) | 3 | 26 | 26 | 29 | 30 |
Both directions fail. Unrelated text drags real suggestions to "quiet". Office-like text drags quiet turns to "suggest". The verdict follows whatever dominates the pooled embedding. The probe never learned "is there a suggestion cue in this turn". It learned "does this short pair look like my training pairs".
That killed it as a gate, and changed the design. The replacement idea is a content-free gate: train on the LLM baseline's own logged decisions, using metadata about the turn rather than an embedding of its text. That means no embedder, no truncation, no length shift, real-length training data by construction, and drift you can observe.
Serving Without a Custom Server
The first serving path was a tiny sidecar (30–80 ms per thread on CPU). The better one was a stock text-embeddings-inference (TEI) server, which can serve a sequence-classification model but returns a softmax over all three MNLI labels, not my two-way p_task.
The client folds it back:
p_task = softmax_entail / (softmax_entail + softmax_contradiction)
The decision is unchanged by the fold: both softmax terms share a denominator and exp is monotone, so p_task > 0.5 exactly when logit_entail > logit_contradiction, and a tie gives "not task" in both paths. That's covered by unit tests. Served in fp16 and pinned to a model revision, the TEI lane reproduced 40/41 on the sealed set, the same as the fp32 reference, using about 0.6–0.8 GB of GPU memory. Every move of the serving lane is guarded by a reference capture that fails if any score drifts by more than 0.01.
Two more serving bugs were caught before they could matter. Both would have produced silent failures:
- The embedding client for the suggestion gate spoke one API dialect while the serving embedder spoke another. Deployed as-is, every shadow pass would have quietly done nothing, in exactly the environment the real-traffic sample had to come from. The artifact now declares its embedding API, and both dialects were verified to the same confidence (0.9463 vs 0.9465).
- The serving index used 768-dimension vectors while the probe expected 1,024. A dot product over the shorter vector would have returned confident junk. It now refuses to score on a width mismatch and warns once.
What I'd Do Differently
- Reuse a head before you initialise one. With 90 examples, EFL on an NLI model beat a fresh head on DistilBERT and a probe on embeddings.
- Run the zero-shot baseline with the same hypothesis. 14/41 told me the prior was there and what fine-tuning actually had to fix.
- Don't let the same process write the training data and the eval. They share a definition, and the model learns your definition, not the world's.
- Run a blind relabel before you celebrate. 9 of 41 labels moved. That's bigger than the gap I was excited about.
- Do the paired test. 40/41 vs 39/41 on the same items is McNemar p = 1.0.
- Test the input distribution you'll actually serve. A 141-character training set says nothing about 3,000-character inputs. Padding experiments are cheap and brutal.
- Compare effective decisions in shadow mode, not raw verdicts. Thresholds are part of the system you're replacing.
- Make silent failures loud. API dialects, vector widths, missing pins: each one fails quietly unless the code refuses to guess.
The model I'm proudest of here is a 355M encoder that learned a decision boundary from 90 rows in 77 seconds. The thing I'd keep is the habit of checking the ruler before anyone switches the model on.