Frontier quality at 1% of the cost: a production benchmark of LLM classifiers
Problem Statement
Many product classification tasks, such as policy-violation screening, support-intent detection and review topics, need subtle common-sense language understanding, which frontier LLMs handle well. Those same tasks also impose strict latency budgets (here, 200ms for real-time publication gating), high request volumes (thousands of requests per minute, RPM) and a need for controllable precision/recall tradeoffs. Frontier APIs are slow, priced per token and return fixed verdicts, while off-the-shelf small models are fast but miss domain-specific distinctions. The post quantifies this tension on a real production task instead of a public benchmark.
Key Novelty
- A production-grounded benchmark that plots open-weight, proprietary generative, 'decision' (probability-returning) and fine-tuned models on a single quality-latency frontier under a real 200ms budget, with server-side gateway latency and cost modeling.
- Fine-tuning a ~2B-effective-parameter model, with logprob extraction for thresholdable scores, shifts the frontier itself. Prompt engineering, even with a 2,700-word prompt with worked examples, only moves models along the frontier and does not close the gap for models fast enough to deploy.
- An explicit cost-crossover analysis. Fixed GPU cost and linear per-token API cost break even at roughly 15–30 RPM, so the fine-tune-vs-API decision becomes a function of volume, latency, the need for a threshold, and the availability of labeled data.
- Max F1 is used as a common metric across score-producing and verdict-only models. This exposes a practical limitation of verdict-only APIs: they give a single fixed precision-recall point (e.g., 0.82 precision / 0.96 recall, favoring recall where false positives are costly), and moving it requires rewriting the prompt.
Evaluation Highlights
- Fine-tuning Gemma4-E2B raised max F1 from 0.563 to 0.902, on par with the best proprietary models (GPT-6.1 Sol, Claude Sonnet 5.5). Median latency was 35ms and p99 about 85ms, versus about 900ms median and multi-second p99 for frontier models even in low-thinking mode.
- The detailed 2,700-word prompt gave proprietary models 1–3 F1 points, roughly matching the fine-tuned classifier at much higher latency. Models under the latency budget gained only modestly, and a large gap remained.
- At thousands of RPM, frontier APIs cost about two orders of magnitude more than one self-hosted RTX Pro 6000 GPU. The detailed prompt added a further 20–40%. Cheaper proprietary options cost about 5x the GPU with lower accuracy, and Jev's cost quadrupled with the detailed prompt because its API offers no cached-input discount.
- Among off-the-shelf models, Gemma4-31B on a single GPU was both faster and more accurate than GPT-6 Luna, the fastest proprietary generative model tested. TypeSafe's Jev, a decision model returning probabilities, was the most accurate off-the-shelf model under 100ms.
- Caveats on the evaluation: (a) it covers a single task, on 10,000 weighted held-out examples; (b) max F1 picks the best threshold on the evaluation set itself, which flatters score-producing models relative to verdict-only ones; (c) the fine-tuning recipe is not disclosed; and (d) the assumed 71% cache hit rate is acknowledged to favor the API models.
Signal Assessment
Methodology
- Selected a real production task, pricing/payment-transparency policy violation screening. It requires high precision, runs at thousands of RPM, and has a 200ms real-time latency budget.
- Fine-tuned Gemma4-E2B through Airbnb's internal GLOWC framework on hundreds of thousands of de-identified in-domain examples (from users who had not opted out of AI training). Logprobs are extracted to produce a continuous, thresholdable score.
- Self-hosted the open-weight baselines with vLLM 0.28.0 on a single NVIDIA RTX Pro 6000. Models up to 12B parameters ran in bf16; larger models used public FP8/NVFP4 checkpoints. Proprietary models were called through vendor APIs, in low-thinking mode because more thinking did not meaningfully improve quality.
- Evaluated every model on a 10,000-example weighted held-out set, first with a concise ~400-word prompt and then with a detailed 2,700-word prompt containing worked examples and common false positives.
- Measured max F1 (a threshold sweep for score-producing models, the verdict F1 for verdict-only models) and cross-checked rankings against PR-AUC and accuracy. Latency is server-side handling time recorded at the serving gateway.
- Modeled cost from observed input/output tokens at public list rates (October 2026), assuming a generous 71% cached-input hit rate. Costs were expressed as multiples of a single rented GPU, and the RPM break-even point was computed.
System Components
Airbnb's internal shared framework for fine-tuning open-weight language and vision-language models into classifiers, with batch inference and serving infrastructure.
A 2B-effective-parameter open-weight model fine-tuned on in-domain labeled data. It outputs logprob-derived scores for threshold-based precision/recall control.
Serves the open-weight models on a single RTX Pro 6000 GPU, using bf16 for small models and FP8/NVFP4 quantized checkpoints for larger ones.
GPT-6.1 Sol, Claude Sonnet 5.5 and GPT-6 Luna, called via vendor APIs in low-thinking mode. They return binary verdicts rather than scores.
A proprietary API that returns a probability instead of generated tokens. This makes it thresholdable and fast; it was the best off-the-shelf model under 100ms.
Combines max-F1 threshold sweeps, gateway-level latency measurement and a token-based cost model with cache assumptions to compare fixed GPU cost against per-token API cost.
Results
| Aspect | Details |
|---|---|
| Fine-tuning quality lift | Gemma4-E2B max F1 rose from 0.563 to 0.902, on par with the best frontier proprietary models. |
| Fine-tuned latency | About 35ms median and about 85ms p99, well under the 200ms budget. |
| Frontier API latency | GPT-6.1 Sol and Claude Sonnet 5.5 took about 900ms median and multiple seconds at p99, even in low-thinking mode. |
| Off-the-shelf open-weight models | Fast, with quality and latency rising with size, but quality plateaus well below frontier and fine-tuned models. Gemma4-31B beat GPT-6 Luna on both speed and accuracy. |
| Detailed 2,700-word prompt | Gave proprietary models +1 to 3 F1 points, roughly matching the fine-tuned model. Gains for fast models were modest, and the prompt raised API cost by 20–40%. |
| Verdict vs. score | GPT-6.1 Sol sits at a fixed 0.82 precision / 0.96 recall. Scores allow threshold tuning without prompt rewrites. |
| Cost at thousands of RPM | Frontier APIs cost about 100x one self-hosted GPU. Cheaper APIs cost about 5x, with lower accuracy. |
| Break-even volume | Below roughly 15–30 RPM, frontier APIs are cheaper than a dedicated GPU. |
Key Takeaways
- If you have high volume (above about 30 RPM), tight latency budgets and hundreds of thousands of labeled examples, fine-tuning a ~2B open-weight model can match frontier quality at a fraction of the cost and latency.
- Extract logprobs to turn generative models into scored classifiers. Thresholds let you tune the precision/recall tradeoff for asymmetric error costs, which verdict-only APIs cannot do without prompt rewrites.
- Prompt engineering has diminishing returns for small, fast models. Labeled examples teach edge cases that even a 2,700-word prompt cannot spell out, and longer prompts add latency and per-token cost.
- Model cost as fixed GPU cost versus linear per-token API cost, and compute the break-even RPM for each task. For low-volume or fast-changing tasks, a prompted frontier model is often the better choice.
- Benchmark on your own production task with server-side latency and realistic cache-hit assumptions. Public benchmarks rarely reflect real latency, cost and precision constraints.
- Shared fine-tuning and serving infrastructure (like GLOWC) amortizes the engineering cost of the fine-tune route, letting teams focus on data and task definition.
Description
At Airbnb, we use AI models for classification tasks, such as detecting risky user-generated content, identifying why customers contact support, and recognizing topics in reviews. These tasks require subtle language understanding and the common sense to interpret what people leave unsaid.