BERT vs Small Language Models for Intent Classification: Train an Encoder, Prompt Only When Labels Change
Published intent-detection research favours a trained BERT or sentence-encoder classifier once you have 10 to 30 examples per intent. Small generative models fit changing labels, and neither handles unknown intents without a tested threshold.
For intent classification with a stable list of intents and even 10 to 30 labeled examples per intent, train a BERT-family classifier or a sentence-encoder classifier such as SetFit first. In the published benchmarks, those trained encoders reach 83% to 97% accuracy on standard intent datasets. The best zero-shot small language models reach 71% to 84% on two of the same datasets, BANKING77 and CLINC150, under different test conditions. A prompted small model is worth testing when intents change faster than you can relabel, and every option needs its own tested rule for rejecting messages that match no intent.
A small language model here means a generative model that writes its answer
BERT is itself small by current standards. The BERT-Large model used in the PolyAI intent study has 340 million parameters, and ModernBERT-base, a 2024 encoder, has 149 million. So the useful comparison is not about size. It is about how the model produces a label.
Three designs compete for the same job, and each one learns from a different kind of supervision:
- A fine-tuned classification head on BERT adapts the whole encoder to your labeled examples and outputs a probability for each trained intent. The BERT paper describes this as adding one output layer to the pre-trained model.
- A sentence encoder with a light classifier keeps a pre-trained encoder fixed, or tunes it briefly, and trains a small classifier on its embeddings. PolyAI's dual-encoder detectors and Hugging Face's SetFit both work this way.
- An instruction-tuned generative model reads a prompt that lists the valid intents and writes one of them as text. It needs no training examples, but its output must be matched to a valid label.
The first two designs can only ever return an intent that they were trained on. The third can return any text, including a label that does not exist, so its output has to be matched to a valid label or restricted to the list.
Trained encoders win the few-shot comparison that has been run
The idea that few labels favour a prompted model does not match the intent-specific evidence. In 2020, PolyAI researchers tested fixed USE and ConveRT sentence encoders against fully fine-tuned BERT-Large on three intent datasets. With only 10 examples per intent, the combined USE and ConveRT detector scored 85.19% on BANKING77, 93.26% on CLINC150 and 85.83% on HWU64. Fine-tuned BERT scored 83.42%, 91.93% and 84.86% on the same splits.
The gap closed with more data. With full training sets, fine-tuned BERT scored 93.66% on BANKING77, slightly above the dual encoders at 93.36%. The authors also report that fine-tuned BERT failed to converge in 2% of seed runs, while the encoder-based detectors stayed stable across hyperparameter settings. That stability matters when there are too few examples to spare a validation set.
The training cost was small for both. The PolyAI detector trained and evaluated on BANKING77 in 65 seconds on a dual-core laptop CPU. Fine-tuned BERT took 567 seconds on a TPU, because it ran out of memory on an 11 GB consumer GPU.
SetFit takes the same approach and also tunes the encoder briefly on pairs of examples. Its authors report that SetFit with a 110-million-parameter MPNet body beat standard fine-tuning by 19.3 points on average with 8 examples per class. It matched T-Few, a 3-billion-parameter prompt-based method, while being more than 27 times smaller. Training on 8 examples took about 30 seconds on an AWS GPU instance, at about $0.025 per run in 2022 prices. None of SetFit's six main test sets is an intent dataset, so its intent accuracy has to be measured on your own data.
Small generative models now classify intents usefully with no examples at all
The strongest case for a generative model is that it needs no labeled data. A July 29, 2026 preprint by Ganesh, Dozier and Seals evaluated 41 open-weight models, from 135 million to 9 billion parameters, on eight English intent datasets with zero examples. The authors found that instruction-tuned 3B models can outperform several 7B base models.
The best scores were respectable but lower than those of trained encoders. The top zero-shot accuracy was 83.6% on CLINC150 and 70.8% on Banking77. Qwen2.5-3B-Instruct had the highest average among models under 4 billion parameters, at 0.632 across all eight datasets. Mistral-7B-Instruct-v0.3 led overall at 0.660.
These numbers cannot be lined up directly against the PolyAI table. The 2026 study scored only the first 500 test examples of each dataset, used exact-match accuracy on free text, and counted invalid outputs as wrong without reporting how often they occurred. It also found that leading models on MASSIVE were statistically indistinguishable, and that SNIPS no longer separates models at all. The authors report no comparison against a fine-tuned BERT or SetFit baseline.
Robustness differed sharply between similar models. Typos cost Qwen2.5-7B-Instruct 1.3 points on MASSIVE but cost Qwen2-7B-Instruct 11.7 points. A model that leads on clean test data can therefore fall behind on real user messages.
Unknown intents are the weak point for every design
Real traffic contains messages that match no intent, and a classifier that forces them into a known intent gives a confidently wrong answer. The CLINC150 dataset was built to measure this. It holds 22,500 in-scope queries and 1,200 out-of-scope queries, with 1,000 of the out-of-scope queries kept for testing.
In the 2019 CLINC150 study, BERT reached 96% or higher in-scope accuracy, yet every method struggled to reject out-of-scope queries. With a probability threshold chosen on validation data, BERT rejected 52.3% of out-of-scope test queries. Adding an extra "out-of-scope" class to training rejected only 40.3%. The best system in any setting reached 66% out-of-scope recall, and only after extra out-of-scope training examples were added.
The authors chose recall as the key measure for a practical reason. A missed out-of-scope query gives the user a completely wrong response, while a false rejection only triggers a fallback message.
The generative side has no equivalent evidence. The 41-model study did not test out-of-scope detection. It did measure calibration, which is how well a model's stated confidence matches its accuracy, and the results were mixed. Five of eight instruction-tuned models were less calibrated than their base versions, and the authors caution that a low calibration error can come from a model that is consistently unsure. A generated label or a token probability is therefore not a reliable rejection signal until it has been tested on held-out unknown messages.
The decision depends on your labels, your rate of change and your rejection target
No published study has run a fine-tuned BERT, SetFit and a prompted small model on the same intent data with the same unknown-intent test. Until that comparison exists, the evidence supports a conditional choice:
- If intents are few, fixed and keyword-driven, a set of rules or keyword matches may meet the target without any model to serve.
- If intents are stable and you can label 10 to 30 examples each, train a sentence-encoder classifier or SetFit first, because it led the few-shot intent results and trains in minutes.
- If you have hundreds of examples per intent, a fine-tuned BERT-family model such as ModernBERT is equally strong and well understood.
- If intents change weekly or you have no labels yet, test an instruction-tuned 3B to 7B model with constrained output and a held-out accuracy check.
- If a trained encoder rejects too many real messages, add a generative fallback only for rejected cases, and only if the gain on those cases justifies the extra serving cost.
The cost difference is large at moderate volume. On Hugging Face Inference Endpoints list prices, a 2-vCPU CPU instance costs $0.067 an hour and a single T4 GPU costs $0.50 an hour. For one always-on replica over a 720-hour month, that is $48.24 against $360. Qwen2.5-3B-Instruct used 5.79 GB of GPU memory in the 2026 study, so it fits on a T4. Whether a 2-vCPU instance meets a p95 latency target for a given encoder has not been measured. An always-on fallback endpoint costs the same each month whether it handles 1% or 50% of traffic, because the endpoint is billed by the minute while it runs.
Labeling is a separate cost that sits outside these serving figures. A taxonomy of 77 intents at 30 examples each needs 2,310 labeled messages, and the cost of labeling them depends on who does the work. A prompted model needs no training labels, but it still needs a labeled test set to show that it meets the target.
Parsec, which describes itself as a small language model lab, publishes a different kind of candidate called TOD. TOD scores a supplied list of options and returns one probability per option, rather than writing text. It is built from LoRA adapters on Gemma 4 12B, so users must accept the Gemma 4 licence. Parsec's TOD page lists a flat $0.30 per 1,000 decisions. Parsec has published no intent-classification result for TOD, so its accuracy on this task is unknown.
A fair comparison on your own data needs five things in place
Published scores come from different test sets, metrics and supervision, so the only result that settles the choice is one run on your own messages. The test needs these elements to be trustworthy:
- Split real messages into separate training, calibration and test sets, and keep a set of messages that match no intent in the test set.
- Run each trained model at several label budgets and seeds, such as 10, 30 and all examples per intent, and add a run in which some intent definitions have changed.
- Report macro-F1, recall on rare intents and false acceptance of unknown messages, with confidence intervals, rather than accuracy alone.
- Include ambiguous, paraphrased, misspelled and multi-intent messages, because the 2026 study showed that typos can move one model by more than 11 points.
- Measure p95 latency, throughput and memory on the hardware that you will deploy, with the real prompt length and number of candidate intents.
Classification is a separate job from explaining a choice, extracting arguments such as an amount or a date, and deciding whether an action may run. A model that picks the right intent has not thereby earned the authority to execute it.
Sources
- Devlin et al., BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding: https://arxiv.org/abs/1810.04805
- Casanueva et al., Efficient Intent Detection with Dual Sentence Encoders: https://arxiv.org/abs/2003.04807
- Tunstall et al., Efficient Few-Shot Learning Without Prompts (SetFit): https://arxiv.org/abs/2209.11055
- Hugging Face, SetFit repository: https://github.com/huggingface/setfit
- Larson et al., An Evaluation Dataset for Intent Classification and Out-of-Scope Prediction: https://aclanthology.org/D19-1131/
- Ganesh, Dozier and Seals, Selecting Open-Weight Language Models for Zero-Shot Intent Classification: A Systematic Evaluation of 41 Models: https://arxiv.org/abs/2607.27421
- Warner et al., ModernBERT paper: https://arxiv.org/abs/2412.13663
- Hugging Face, ModernBERT-base model card: https://huggingface.co/answerdotai/ModernBERT-base
- Hugging Face, Inference Endpoints pricing: https://huggingface.co/docs/inference-endpoints/pricing
- Parsec, TOD: https://parseclab.ai/tod/
- Parsec, TOD model card: https://huggingface.co/parsecai/tod