Cheaper Than an LLM for Yes/No Classification: SetFit, Distillation, ModernBERT or a Cached Haiku 5.5 Prompt
Which replacement fits depends on how many labelled examples you have, how long your inputs are and how costly a wrong answer is. Here are the options by situation, with list prices per 1,000 decisions.
The cheapest way to replace an expensive LLM for yes/no classification is a fine-tuned encoder such as DistilBERT or ModernBERT, trained on labels that the LLM produces once. A February 2026 study measured DistilBERT at $5 to $12 per million decisions, with accuracy close to prompted Claude Sonnet 4.5 on short binary text. With almost no labels, SetFit trains on 8 to 16 examples per class. If you need answers today, a cached Claude Haiku 5.5 prompt with a one-token answer costs about $0.041 per 1,000 decisions at Anthropic's November 2026 list prices. The Message Batches API halves that to about $0.021 when every prefix is a cache hit.
Your labelled data, input length and cost of errors decide the right option
Three questions narrow the choice quickly. The first is how many labelled examples you already have, because that decides what you can train. The second is how long each item is, because prompted LLMs kept an accuracy edge on long inputs in published tests. The third is how much a wrong answer costs, because that decides whether you need a fallback to a stronger model.
The table maps the main options to the situations they fit. Costs use list prices and one item shape: 1,000 tokens of fixed instructions and examples, a 300-token item and a two-token answer.
| Situation | Option | Published evidence | Cost |
|---|---|---|---|
| No labels, answers needed now | Claude Haiku 5.5 with a cached prefix | Few-shot Sonnet 4.5: 94.41 F1 on SST-2 | $0.041 per 1,000 |
| No labels, need a probability | Jev 1.14 or Gemini Decision 1 | Yes/no answer returned as a probability | $0.055 to $0.13 per 1,000 |
| 8 to 64 labels per class | SetFit | 71.3 on RAFT against 62.7 for GPT-3 | $0.025 to train |
| Hundreds of labels | LLM labels, then a distilled student | Up to 80% fewer LLM labels needed | About $7.20 per 10,000 labels |
| Thousands of labels | Fine-tuned DistilBERT or ModernBERT | DistilBERT: 93.49 F1 on SST-2 at 98 ms | $0.005 to $0.012 per 1,000 |
| Costly errors | Encoder plus LLM fallback | Deferred share not yet measured publicly | About $0.084 per 1,000 at 10% deferred |
No single study has run all of these options on the same yes/no datasets with the same cost accounting. The rows combine different papers and price lists, so treat them as orders of magnitude and test the finalists on your own data.
If you have no labels and need answers now, make the LLM call as cheap as possible
Keeping the LLM for a while is sensible when no labelled data exists yet. Three settings cut its cost without changing the model's task:
- Moving fixed instructions and examples into a cached prefix bills them at $0.01 per million tokens on Haiku 5.5, against $0.10 uncached. The prefix must be at least 512 tokens on Haiku 5.5, Sonnet 5.5 and Opus 5.5, or it will not be cached and no error will be returned.
- Asking for a one-token answer with a small
max_tokenskeeps output cost close to zero. Batched requests need amax_tokensvalue of at least 1. - Sending work that can wait through the Message Batches API halves input and output prices. Anthropic says most batches finish within an hour, and batches that are not done in 24 hours expire.
Anthropic's pricing page says that caching and batch discounts stack. Cached Haiku 5.5 in a batch therefore costs about $0.021 per 1,000 decisions in the best case. Cache hits in batches are "best-effort," however, and Anthropic says users typically see hit rates of 30 to 98 percent. For the same item shape, cached Sonnet 5.5 costs about $0.72 per 1,000 and uncached Opus 5.5 about $5.24.
Haiku 5.5's accuracy on public yes/no benchmarks has not been published. The nearest published reference is few-shot Claude Sonnet 4.5 in the February study, which reached a macro F1 of 94.41 on SST-2 at January 2026 prices.
If you need a probability without training, a decision API returns one directly
A cascade needs a confidence score that you can threshold. Several hosted models return a probability instead of generated text.
- TypeSafe's Jev 1.14 lists $0.042 per million input tokens with free output, available from October 14, 2026. Its yes/no "Noul" answer is a single probability. Its documentation suggests 0.7 and 0.3 as starting thresholds and says to give the band between them "its own outcome in code."
- Google's
gemini-decision-1charges $0.10 per million input tokens and "returns calibrated probabilities," according to its documentation. It supports neither context caching nor the Batch API, so repeated instructions are billed in full.
For the 1,300-token item above, that works out at about $0.055 per 1,000 for Jev and $0.13 for Gemini Decision 1. Neither has published accuracy on IMDB or SST-2.
If you have 8 to 64 labelled examples per class, SetFit is built for that range
SetFit fine-tunes a sentence-embedding model on pairs of labelled examples and then fits a small classifier. It uses "No prompts or verbalizers," according to its README. Hugging Face's launch post, from September 2022, says that it typically needs 8 or 16 examples per class. With 8 per class, training took 30 seconds on an NVIDIA V100 at a cost of $0.025.
On the RAFT few-shot benchmark, SetFit on RoBERTa Large scored 71.3, against 62.7 for GPT-3. That comparison predates current LLMs, so it shows what SetFit can do with few labels rather than how it compares with Haiku 5.5. A logistic regression on text embeddings is an even cheaper baseline to try first. None of the studies in this article compare it with an LLM, so its accuracy has to be tested on your own data.
If you have hundreds of examples, let the LLM label the rest and distill
Distillation uses the LLM as a one-time labeller. You run the LLM over a few thousand real examples, train a small student on its labels, and test the student on a hand-labelled set. The hand-labelled set matters because a student tested only against LLM labels inherits the LLM's mistakes as "correct" answers.
- Performance-Guided Knowledge Distillation, presented at EMNLP 2024, uses the LLM to generate training data that targets the student's errors. Its authors report students "up to 130X faster and 25X less expensive" than the LLM.
- The Federal Reserve working paper "LLM on a Budget," from December 2025, sends only the most informative examples to the LLM. It reports "up to 80% reduction in sample requirements" compared with random sampling, with students from SVMs to DistilBERT.
Labels are cheap at current list prices. Ten thousand labels from Claude Opus 5.5 through the Batch API with caching cost about $7.20 for the item shape above. The 80 percent figure is a best case on the authors' own datasets.
If you have thousands of examples, fine-tune DistilBERT for short text or ModernBERT for long text
The February 2026 study, "Cost-Aware Model Selection for Text Classification," fine-tuned BERT, RoBERTa and DistilBERT and served them on Google Cloud Run with 2 vCPUs and 2 GiB of memory. On SST-2, a binary dataset of single sentences, DistilBERT reached a macro F1 of 93.49 at $5.19 per million requests and a median latency of 98 milliseconds. Few-shot Claude Sonnet 4.5 reached 94.41 at $599.67 per million and about 1.1 seconds. The paper's abstract says that the encoders ran at "one to two orders of magnitude lower cost and latency."
On IMDB, where each item is a full review, the LLMs scored higher. Few-shot Claude Sonnet 4.5 reached 96.48 and RoBERTa reached 94.84. ModernBERT targets that gap with an 8,192-token context, which its authors call "over 16x larger than most existing encoders." The base model has 149 million parameters and is released under Apache 2.0. No published study has compared ModernBERT with a prompted LLM on cost per decision, so that comparison has not been measured. Large fine-tuned models can also win on accuracy. Zhao and colleagues reported in December 2024 that a fully fine-tuned Llama3-70B outperformed RoBERTa-large on 20 Newsgroups and MASSIVE, but that paper does not discuss running cost.
Training adds little to the cost. The paper excluded training cost but says that the best validation result usually came within the first epoch. If a ModernBERT-base run took two hours on an A10 at Lambda's on-demand price of $1.29 per hour, it would cost $2.58. That run time is an assumption.
If errors are costly, calibrate the encoder and send only the uncertain band to the LLM
A cascade runs the encoder on every item and defers the middle band of probabilities to a stronger model. It depends on calibration. Scikit-learn describes a reliability diagram as a plot of the fraction of positives against the predicted probability. Its CalibratedClassifierCV can correct drift with sigmoid scaling or isotonic regression. The documentation warns that isotonic regression is "more prone to overfitting" on small datasets. It matches or beats sigmoid scaling with more than about 1,000 samples. The February study did not test calibration, and it names "probability calibration and abstention logic" as open questions.
Parsec, a small language model lab, sells a decision model called TOD that applies the same idea in front of an existing LLM. A confidence gate lets TOD handle a decision when it is confident and passes the item unchanged to the parent model otherwise. According to Parsec's TOD page, it costs $0.30 per 1,000 decisions, flat for up to 48,000 tokens of context. That price suits long, policy-heavy decisions more than short texts, where cached Haiku 5.5 costs about a seventh as much. Parsec publishes no yes/no text classification accuracy for TOD, and its fees are added to the parent model's cost.
No public study has measured what share of yes/no traffic a calibrated encoder resolves at a given threshold. That share decides the blended cost, so measure it on your test set before choosing thresholds.
A worked example shows that the fallback model matters as much as the encoder
Suppose that a team runs 5 million real-time yes/no decisions a month. Each request carries 1,000 tokens of fixed instructions, a 300-token item and a two-token answer. All prices are list prices from Anthropic and from the February study's encoder costs.
- Running Sonnet 5.5 without caching costs about $13,100 a month.
- Adding a cached prefix to Sonnet 5.5 cuts that to about $3,600.
- Switching to cached Haiku 5.5 cuts it to about $205, if Haiku meets the accuracy bar.
- Running a distilled DistilBERT on all traffic costs about $26 to $62 a month at the paper's rates.
- Adding a 10 percent fallback to cached Sonnet 5.5 brings the encoder setup to about $422 a month.
- Adding a 10 percent fallback to cached Haiku 5.5 instead brings it to about $83 a month.
The one-time setup is small: about $7.20 for 10,000 Opus 5.5 labels and about $2.58 for training on the assumed run time. The hand-labelled test set costs staff time, which is not priced here.
Under these assumptions, a team on an uncached large model saves the most by caching and moving to a smaller model, and neither step needs training data. The encoder route then saves a further $140 to $180 a month at this volume against cached Haiku 5.5, and more as volume grows. A Sonnet 5.5 fallback can cost more than an all-Haiku setup, so the fallback should be the smallest model that handles the hard cases well. Long items are the cases where the LLM may need to stay the main classifier, because encoders trailed prompted LLMs on full-length reviews in the February study.
Sources
- Cost-Aware Model Selection for Text Classification (arXiv 2602.06370): https://arxiv.org/abs/2602.06370
- Cost-Aware Model Selection, full text: https://arxiv.org/html/2602.06370
- IMDB dataset card: https://huggingface.co/datasets/stanfordnlp/imdb
- SST-2 dataset card: https://huggingface.co/datasets/stanfordnlp/sst2
- Zhao et al., Advancing Single- and Multi-task Text Classification through LLM Fine-tuning (arXiv 2412.08587): https://arxiv.org/abs/2412.08587v1
- Anthropic, Pricing: https://platform.claude.com/docs/en/about-claude/pricing
- Anthropic, Batch processing: https://platform.claude.com/docs/en/build-with-claude/batch-processing
- Anthropic, Prompt caching: https://platform.claude.com/docs/en/build-with-claude/prompt-caching
- TypeSafe, Models: https://docs.typesafe.ai/models.md
- TypeSafe, Confidence: https://docs.typesafe.ai/confidence.md
- Google, Decisions API: https://aistudio.google.com/docs/decisions-api
- Google, Gemini API pricing: https://aistudio.google.com/docs/pricing
- Hugging Face, SetFit: Efficient Few-Shot Learning Without Prompts: https://huggingface.co/blog/setfit
- SetFit repository: https://github.com/huggingface/setfit
- Di Palo et al., Performance-Guided LLM Knowledge Distillation (EMNLP 2024): https://aclanthology.org/2024.emnlp-main.215/
- Federal Reserve, LLM on a Budget (FEDS 2025-108): https://www.federalreserve.gov/econres/feds/llm-on-a-budget-active-knowledge-distillation-for-efficient-classification-of-large-text-corpora.htm
- Hugging Face, ModernBERT announcement: https://huggingface.co/blog/modernbert
- ModernBERT-base model card: https://huggingface.co/answerdotai/ModernBERT-base
- Lambda, GPU cloud pricing: https://lambda.com/pricing
- scikit-learn, Probability calibration: https://scikit-learn.org/stable/modules/calibration.html
- Parsec, TOD: https://parseclab.ai/tod/