Alternatives to GPT for Classification Compared: SetFit, Fine-Tuned BERT, Haiku, Gemini Flash and Cascades
A buyer's guide by situation, with November 2026 list prices. The number of labelled examples you have decides whether a small LLM, SetFit, a fine-tuned encoder or a cascade is the better buy.
The number of labelled examples that you have determines which alternative to GPT fits text classification: a small LLM with almost none, SetFit with a few per class, and a fine-tuned BERT encoder with thousands. With almost no labels, a small LLM such as Claude Haiku 5.5, gpt-6-luna or Gemini Flash-Lite with a structured-output enum costs about $0.045 to $0.145 per 1,000 short predictions. With 8 to 64 labels per class, SetFit matches or passes few-shot prompting. With a few thousand labels, a fine-tuned BERT-family encoder led on accuracy in two 2026 studies and on cost and latency in one, and a cascade can add an LLM for the uncertain cases.
The options differ most in the labelled data that they need and the price per prediction
The table compares the main options on cost at list or modelled prices and on the labelled data that each one needs. LLM costs assume 400 input tokens and 10 output tokens per prediction, with no caching, at the official Anthropic, OpenAI and Google prices on November 24, 2026. Encoder costs are the modelled serving costs from a February 2026 study.
| Option | Cost per 1,000 predictions | Labelled data needed | Best fit |
|---|---|---|---|
| Fine-tuned DistilBERT, BERT or RoBERTa | $0.005 to $0.033, modelled | A few thousand examples | Stable labels, high volume |
| Claude Haiku 5.5 or gpt-6-luna | $0.045 | None, or a few in the prompt | Few or changing labels |
| OpenAI Decisions API or Gemini Decision 1 | $0.04 | None | Few labels, probabilities needed |
| Gemini 3.5 Flash-Lite | $0.145 | None, or a few in the prompt | Few or changing labels on Gemini |
| OpenAI gpt-5.4-mini | $0.345 | None, or a few in the prompt | GPT baseline to test against |
| Cascade: encoder, then Haiku 5.5 for 30% | About $0.019 to $0.047 | Enough to train the first stage | Mixed easy and hard inputs |
Batch APIs from Anthropic, OpenAI and Google halve the LLM prices in the table. Google's pricing page says that Gemini Decision 1 does not support the Batch API. Gemini 3.8 Flash, which costs about $0.34 per 1,000 on these assumptions, doubles to about $0.68 on January 1, 2027. Gemini 2.5 Flash requests route to Gemini 3.5 Flash-Lite from December 1, 2026.
With almost no labels or labels that change often, prompt a small LLM with a structured-output enum
An LLM needs no training data. You put the label list and instructions in the prompt and change the labels by editing it. That is the main reason to keep an LLM for classification, and the main reason that it costs more per prediction: every request carries the full label list as input tokens.
Because a label is only a few tokens long, the bill is set almost entirely by input. On Claude Haiku 5.5, a 400-token request with a 10-token answer spends 89% of its cost on input. Shortening the instructions and the label descriptions cuts cost almost in proportion.
All three providers can force the answer into your label set. Anthropic's structured outputs docs say that they "guarantee schema-compliant responses through constrained decoding," support enum values and list claude-haiku-5-5. OpenAI's guide says that Structured Outputs constrains completed, non-refusal output to the supplied JSON Schema. Google's docs describe a Gemini enum as a list of "possible strings for classification tasks."
The evidence for prompting is strongest at the smallest label counts. A 2023 study used Banking77, a public set with 77 banking intents. With one example per class, GPT-4 scored 80.4 micro-F1, more than 20 points ahead of SetFit. The accuracy of Haiku 5.5, gpt-6-luna and Gemini Flash-Lite on Banking77 or other standard sets has not been measured.
Check two details before you compare quotes. Anthropic's pricing page says that Claude 4.7 and later models use a tokenizer that produces about 30% more tokens for the same text. Anthropic also says that most batches finish in under an hour, while OpenAI's batch docs promise completion within 24 hours. Median and 95th-percentile latency for Haiku 5.5, Gemini Flash-Lite and gpt-6-luna on a classification workload have not been measured in any published study.
With 8 to 64 labels per class, SetFit matches or passes few-shot prompting
SetFit fine-tunes a small sentence-embedding model on a few labelled examples per class and needs no prompts. The SetFit documentation says that with 8 labelled examples per class on a customer-review sentiment set, it "is competitive with fine-tuning RoBERTa Large on the full training set of 3k examples."
The 2023 Banking77 study shows how quickly SetFit catches up. GPT-4 led at three examples per class, with 83.1 micro-F1 against 76.7 for SetFit. SetFit reached 83.5 at five examples, 88.1 at ten and 91.2 at twenty. Fine-tuning on all 10,003 training examples reached 94.1, so twenty examples per class came within 3 points of the full model.
The original SetFit paper from 2022 found a similar pattern. With 8 labels per class, SetFit averaged 62.3 across its test sets, against 43.0 for standard RoBERTa-large fine-tuning. On the RAFT few-shot benchmark, SetFit on a 355-million-parameter model scored 71.3, against 62.7 for the 175-billion-parameter GPT-3. The smaller SetFit-MPNet model trained in about 30 seconds on one AWS GPU instance, at $0.025 per run. The serving cost of SetFit per 1,000 predictions has not been measured in these studies. A single study that compares SetFit, fine-tuned encoders and prompting at 500 and 5,000 labels per class has not been published.
With a few thousand labels and steady volume, a fine-tuned encoder leads on accuracy, latency and cost
An encoder such as DistilBERT, BERT, RoBERTa or DeBERTa produces one score per label in a single pass. It runs on a CPU and gives probabilities that you can check and correct.
A February 2026 preprint by Alberto Andres Valdes Gonzalez tested fine-tuned BERT, DistilBERT and RoBERTa against prompted GPT-4o and Claude Sonnet 4.5 on IMDB, SST-2, AG News and DBPedia. The encoders won on three of the four sets. On AG News, RoBERTa scored 94.63 macro F1, against 89.65 for few-shot GPT-4o. On DBPedia, BERT scored 99.40, against 96.12 for zero-shot GPT-4o. The LLMs won only on IMDB, with few-shot Claude at 96.48 against 94.84 for RoBERTa.
The encoders were also faster. DistilBERT answered in a median of 98 to 235 milliseconds on a 2-vCPU Cloud Run service, against 326 to 417 milliseconds for GPT-4o and 1,003 to 1,435 milliseconds for Claude Sonnet 4.5. The author ranks DistilBERT first on every dataset.
The largest gap on a many-class set comes from an October 2026 preprint by Amir Rafe and Subasish Das. Fine-tuned DeBERTa-v3-large reached 0.950 accuracy on Banking77, against 0.821 for the hosted decision model Jev. Its expected calibration error was 0.022, against 0.073 for Jev, so its confidence scores tracked its hit rate more closely.
Good calibration is needed before any confidence threshold can be automated. The scikit-learn documentation defines it plainly: among predictions given a probability near 0.8, about 80% should be correct. A rule such as "send anything below 0.9 to a human" only works if 0.9 means 90% right. The CalibratedClassifierCV class in scikit-learn can correct an encoder's probabilities after training. Generative LLMs are harder to calibrate, because a study presented at ICLR 2024 found that LLMs that state their own confidence tend to be overconfident. The calibration of Haiku 5.5, Gemini Flash and gpt-6-luna on standard classification sets has not been measured.
An encoder also suits teams that need audit trails or on-premises serving. It runs on your own hardware, and DeBERTa-v3-base is published under the MIT licence.
When some inputs need an LLM, a calibrated cascade sends it only the uncertain share
A cascade puts a cheap, calibrated model first and sends its low-confidence cases to an LLM. Rafe and Das measured one on the 150-intent CLINC-150 set. A first stage that scored 0.863 on its own sent 30% of decisions to Gemma-4-31B. The combined system matched Gemma's 0.942 accuracy at 0.37 of Gemma's cost. The 2023 FrugalGPT paper reported that a learned cascade can match GPT-4 with up to 98% lower cost.
An LLM can also build the first stage's training set. A 2021 study presented at EMNLP found that labels from GPT-3 cost 50% to 96% less than human labels for the same downstream performance. Mixing GPT-3 and human labels worked better than either alone on a small budget. No published study has measured a cascade with a 2026 small LLM as the second stage at several thresholds.
Parsec, a small-language-model lab, sells a decision model called TOD that follows this pattern in front of an existing assistant. It ranks options from a supplied list, and a confidence gate passes low-confidence turns to the parent LLM. According to Parsec's TOD page, it costs $0.30 per 1,000 decisions, flat for up to 48,000 tokens of context. That is more than Haiku 5.5 for a short ticket, but Haiku 5.5 would cost $4.80 per 1,000 calls at 48,000 input tokens. Parsec's page also shows TOD scoring below its untrained base model on a public decision benchmark and says that the next release will fix this. Parsec publishes no price for tuning a decision model on a customer's data.
At 1 million predictions a month, the options range from about $5 to $345 at today's list prices
The worked example uses one workload for every option, so that each assumption is visible:
- Volume is 1 million predictions a month.
- Each prediction carries 400 input tokens of instructions, label list and text, and returns 10 output tokens.
- There is no prompt caching and no reasoning output.
- Prices are list prices from the official pricing pages on November 24, 2026.
- Encoder serving uses the 2026 study's modelled range of $0.005 to $0.033 per 1,000.
On those assumptions, the monthly bills are:
- A fine-tuned encoder costs about $5 to $33 to serve.
- Claude Haiku 5.5 costs $45, made up of $40 for input at $0.10 per million tokens and $5 for output at $0.50 per million. Through the batch API it costs $22.50.
- gpt-6-luna costs the same $45, or $22.50 in batch. Its Decisions API, which bills input only, costs $40.
- Gemini 3.5 Flash-Lite costs $145, or $72.50 in batch.
- Gemini 3.8 Flash costs about $338 through December, and about $675 from January 1, 2027.
- gpt-5.4-mini costs $345, or $172.50 in batch.
- A cascade that sends 30% to Haiku 5.5 costs $13.50 for the LLM plus $5 to $33 for the encoder, or about $19 to $47.
- The same cascade with gpt-5.4-mini as the second stage costs about $109 to $137.
The cheapest LLMs now cost only 4 to 9 times as much as a modelled DistilBERT service. In the February 2026 study, zero-shot GPT-4o cost roughly 35 to 70 times as much as DistilBERT on the same dataset. A cascade behind Haiku 5.5 costs about the same as Haiku alone, while a cascade behind gpt-5.4-mini cuts that bill by more than half.
Sources
- Valdes Gonzalez, Cost-Aware Model Selection for Text Classification: https://arxiv.org/abs/2602.06370
- Valdes Gonzalez, full results (HTML): https://arxiv.org/html/2602.06370
- Tunstall et al., Efficient Few-Shot Learning Without Prompts (SetFit): https://arxiv.org/pdf/2209.11055
- Hugging Face, SetFit documentation: https://huggingface.co/docs/setfit/index
- Loukas et al., Making LLMs Worth Every Penny: https://arxiv.org/pdf/2311.06102
- Rafe and Das, Benchmarking System One decision models against trained classifiers: https://arxiv.org/html/2610.00346
- Xiong et al., Can LLMs Express Their Uncertainty?: https://arxiv.org/abs/2306.13063
- scikit-learn, Probability calibration: https://scikit-learn.org/stable/modules/calibration.html
- Chen, Zaharia and Zou, FrugalGPT: https://arxiv.org/abs/2305.05176
- Wang et al., Want To Reduce Labeling Cost? GPT-3 Can Help: https://arxiv.org/abs/2108.13487
- Microsoft, DeBERTa-v3-base model card: https://huggingface.co/microsoft/deberta-v3-base
- Anthropic, Pricing: https://platform.claude.com/docs/en/about-claude/pricing
- Anthropic, Structured outputs: https://platform.claude.com/docs/en/build-with-claude/structured-outputs
- Anthropic, Batch processing: https://platform.claude.com/docs/en/build-with-claude/batch-processing
- OpenAI, API pricing: https://developers.openai.com/api/docs/pricing
- OpenAI, Structured Outputs: https://developers.openai.com/api/docs/guides/structured-outputs
- OpenAI, Batch API: https://developers.openai.com/api/docs/guides/batch
- OpenAI, Decisions API: https://developers.openai.com/api/docs/guides/decisions.md
- Google, Gemini API pricing: https://aistudio.google.com/docs/pricing
- Google, Gemini structured output: https://aistudio.google.com/docs/structured-output
- Parsec, TOD: https://parseclab.ai/tod/
- Parsec, Decision models: https://parseclab.ai/solutions/decision-models/