LIVE · Thursday 3 December

Fine-Tuned BERT, ModernBERT or an LLM for Text Classification? Cost per 1,000 Items and Which to Pick

A buyer's guide to the four ways to build a text classifier in late 2026, with the published accuracy, latency and per-item costs behind each, and a worked monthly bill for a million items.

By Surya8 min read

Pick a fine-tuned BERT-style encoder when your labels are fixed, you have a few hundred or more labelled examples and you classify at volume: in a February 2026 benchmark it beat zero-shot and few-shot GPT-4o and Claude Sonnet 4.5 on three of four datasets, at about a cent per 1,000 AG News items against 28 to 44 cents for the zero-shot LLMs. Pick a prompted LLM when you have no labelled data, when your labels change often, or when getting the label right needs world knowledge. Fine-tuning a decoder LLM buys a few more accuracy points at a much higher training cost. The newest small LLMs now list at prices near an encoder's, but their accuracy on classification has not been published.

The four options

A fine-tuned encoder. BERT, RoBERTa, DeBERTa-v3 and ModernBERT are models of about 110 to 435 million parameters that read the whole input and output a label. You train one on your own labelled examples and serve it yourself; in the February 2026 benchmark below, BERT trained on DBpedia in under 50 minutes on one A100. ModernBERT is the newest of the family. Released in December 2024 under Apache 2.0, it accepts 8,192-token inputs, and its paper reports a GLUE average of 88.4 for the 149-million-parameter base model against 88.1 for DeBERTa-v3-base and 84.7 for BERT-base.

A prompted LLM, zero-shot or few-shot. You describe the labels in a prompt, optionally add examples, and call an API per item. There is nothing to train and labels can change with a prompt edit.

A prompted LLM with retrieved examples. Instead of fixed examples, you retrieve the labelled items most similar to each input and put them in the prompt. It needs a labelled pool but no training.

A fine-tuned decoder LLM. You fully fine-tune an open model such as Llama on your labelled data and use it as a classifier. It is the most accurate option in the studies that test it, and the most expensive to train.

How they compare on accuracy

The most useful recent head-to-head is Alberto Andres Valdes Gonzalez's "Cost-Aware Model Selection for Text Classification," submitted to arXiv on February 6, 2026. It fine-tuned BERT, DistilBERT and RoBERTa and ran GPT-4o and Claude Sonnet 4.5 zero-shot and few-shot at temperature 0 on four public datasets. Fine-tuned BERT scored 94.43 macro-F1 on AG News against 89.65 for the best GPT-4o setting and 91.35 for Claude; 94.42 on SST-2 against 90.45 and 94.41; and 99.40 on DBPedia against 97.06 and 98.83. The LLMs won IMDB, a long-review sentiment set, where Claude reached 96.48 against BERT's 93.43.

Where the label depends on knowledge rather than patterns, the result flips. Zhang and colleagues, in Findings of EMNLP 2025, found "BERT-like models excel in pattern-driven tasks, while LLMs dominate those requiring deep semantics or world knowledge": on hallucination detection, zero-shot LLaMA-3-8B scored 86.2 F1 against 75.6 for fine-tuned RoBERTa, while on disguised Chinese toxic text RoBERTa scored 88.4 against 79.6 for GPT-4o.

Retrieval narrows the gap. Olesia Khrapunova's October 2025 study found fine-tuned encoders 10 to 25 accuracy points ahead of zero-shot LLMs on AG News and the 77-intent BANKING77 set; adding retrieved similar examples consistently raised LLM accuracy, and on BANKING77 put GPT-4o slightly ahead of the best encoder. Chain-of-thought lowered accuracy.

Fine-tuning a large decoder goes furthest. In a Meta study, a fully fine-tuned Llama3-70B reached 91.9% on 20 Newsgroups against 88.1% for fine-tuned RoBERTa-large and 80.4% for zero-shot GPT-4, but training ran on eight A100 80GB GPUs for hours to about three days.

Two comparisons buyers ask for have not been published. No study tests a fine-tuned ModernBERT or DeBERTa-v3 against GPT-4o or Claude Sonnet 4.5 on the same data. And no study plots a learning curve from about 50 to 5,000 labels to show where a fine-tuned encoder overtakes a prompted LLM; the crossover has not been measured.

What each option costs and how fast it is

Option Accuracy (AG News macro-F1) Cost per 1,000 items p50 latency
Fine-tuned BERT, Cloud Run CPU 94.43 $0.010 197 ms
Fine-tuned DistilBERT, Cloud Run CPU 94.11 $0.006 108 ms
GPT-4o, zero-shot 87.93 $0.28 411 ms
Claude Sonnet 4.5, zero-shot 91.35 $0.44 1,435 ms

All figures from the February 2026 paper at January 22, 2026 prices, with encoders on Google Cloud Run at 2 vCPUs and 2 GiB.

The paper excludes training cost, which for an encoder is small: the under-50-minute BERT run on one A100 is a one-off, spread over every item it later classifies. Latency depends on input length. On long IMDB reviews, CPU-served BERT took 480 milliseconds at p50 against 345 for GPT-4o, so long documents favour a GPU or a smaller encoder; DistilBERT took 235.

Reliability: invalid labels and repeatability

A prompted LLM can return a label that is not in your set. The February 2026 paper constrained outputs to a single label but did not report how often that failed, so the invalid-label rate for these models has not been measured. OpenAI's Structured Outputs constrains completed responses to a JSON Schema, including an enum of allowed labels; its guide says refusals and incomplete responses are not covered, so you still need a fallback.

Repeatability is a moving target. At temperature 0 the paper's repeated LLM runs had a standard deviation of at most 0.25 macro-F1 points, but Anthropic's API version 2026-10-21 returns an error for any request that sets temperature. A study of South Slavic languages found zero-shot LLMs often matched fine-tuned encoders but cited "less predictable outputs" among the reasons fine-tuned BERT-like models "remain a more practical choice for large-scale automatic text annotation."

Worked example: one million items a month

Take a news-tagging workload like AG News, one million items a month, zero-shot prompts, using the February paper's token counts: about 106 input tokens per item for GPT-4o and 122 for Claude, with a label of one to five tokens.

At the paper's measured rates, fine-tuned BERT on Cloud Run costs $10.44 a month and DistilBERT $5.73. Zero-shot GPT-4o costs $276 and Claude Sonnet 4.5 $440.58. Few-shot prompts roughly triple the LLM bills: $903.50 and $1,271.58.

Both LLMs are leaving. Anthropic retires Claude Sonnet 4.5 on November 30, 2026, and OpenAI shuts down GPT-4o on January 14, 2027. Their successors at current list prices change the bill. OpenAI lists gpt-6-luna at $0.10 per million input tokens and $0.50 per million output. With reasoning set to none and GPT-4o's token counts, that is 106.4 × $0.10 + 1 × $0.50, or about $11 a month; at its default medium reasoning, each 100 reasoning tokens per item adds about $50. Anthropic lists Claude Haiku 5.5 at the same $0.10 and $0.50. Raising Claude's token counts by 30% for the newer tokenizer Anthropic describes gives 158 × $0.10 + 6.5 × $0.50, or about $19 a month. Claude Sonnet 5.5, the named replacement, costs $2 and $10, about $382 a month on the same tokens. Both providers' batch APIs halve these figures for work that can wait.

On these assumptions the cheapest LLMs cost about the same as a CPU-served encoder, and Sonnet 5.5 still costs about 37 times as much as BERT. The accuracy of Luna, Haiku 5.5 and Sonnet 5.5 on these datasets has not been published, so the cheap rows are a price, not a recommendation.

Getting training data cheaply

If labelled data is what you lack, an LLM can make it. Wang and colleagues found in 2021 that training smaller models on GPT-3 labels cost "50% to 96% less" than human labels for the same downstream performance, and that mixing in human labels worked best on a limited budget. Gilardi, Alizadeh and Kubli found zero-shot ChatGPT beat crowd-workers on four of five tweet-annotation tasks at under $0.003 per annotation. Labelling with an LLM, checking a sample by hand and fine-tuning an encoder on the result combines the LLM's zero-data start with the encoder's running cost. No end-to-end test of that route with current LLMs and ModernBERT has been published, so score the result on a trusted held-out set.

Parsec, a small language model lab, sells a managed version of the fine-tuned-small-model route: it trains compact models on a customer's traffic and sends low-confidence requests to a closed frontier model. It publishes no price for this service.

Which to pick

Your situation Pick Main reason
Fixed labels, 500+ examples, high volume Fine-tuned encoder Won 3 of 4 datasets at about $0.01 per 1,000
No labelled data Prompted LLM, then distil LLM labels 50-96% cheaper than human
Labels change monthly Prompted LLM A prompt edit, not a retrain
Label needs world knowledge Prompted LLM 86.2 vs 75.6 F1 on hallucination detection
Many fine-grained intents, labelled pool LLM with retrieved examples Edged past encoders on BANKING77
Top accuracy, GPUs available Fine-tuned decoder LLM 91.9% vs 88.1% on 20 Newsgroups

Bottom line

For a fixed label set with a few hundred examples and real volume, fine-tune an encoder; start with BERT-base or ModernBERT-base and serve it on a small CPU or GPU instance. For changing labels, knowledge-heavy labels or no data, prompt an LLM, and use its labels to train an encoder once the scheme settles. Fine-tune a large decoder only if the last few accuracy points justify days of multi-GPU training. Whatever you pick, build a held-out test set first, because the cheapest new LLMs have not been measured on these tasks.

Sources

More in Research

All Research →