TriAgent → Reducing LLM inference cost

Reducing LLM inference cost

Most production pipelines send every query to the most capable model available. Measured on financial sentiment, only 1.5% of queries actually need it.

CIKM 2026 arXiv:2607.19794 Code

The cost at scale

Annual inference cost at 10 queries per user per day, using public 2025 API prices and GPU rental amortised at $0.40/hour for self-hosted models:

Strategy10K users1M users10M users
Always-GPT-4$365K$36.5M$365M
Always-GPT-4o-mini$11K$1.10M$11.0M
Always-Qwen-7B (self-hosted)$1.05K$105K$1.05M
Always-FinBERT$18$1.8K$18K
Tier routing (TriAgent)$1.65M

At 10M users that is $363M/yr saved against always-GPT-4 and $9.3M/yr against always-GPT-4o-mini.

These are scenario estimates, not guarantees. They assume the cache hit rate and specialist accuracy measured in the paper carry over to the production workload, and that per-query API prices remain within an order of magnitude of 2025 published rates. A different workload mix scales the savings proportionally.

Log-log plot of annual inference cost in US dollars against user count from one thousand to ten million, with five lines: always-GPT-4 highest, then GPT-4o-mini, then self-hosted Qwen-7B, then TriAgent routing, with always-FinBERT lowest. All lines are straight on log axes, showing cost scales linearly with users.
Annual inference cost against deployment scale. Every policy scales linearly with user count, so the gap between the top and bottom lines compounds rather than closing. The routed system tracks near the specialist-only floor while retaining LLM-level accuracy on the queries that need it.

Where the queries actually go

At the Balanced operating point:

TierReference modelShare of trafficLatencyCost / 1k
L1word-level lexicon (VADER)70%~0.03 ms~$0
L2sentence transformer (FinBERT, 110M)28.5%~1.5 ms~$0.0005
L3LLM reasoner (Qwen2.5-7B)1.5%100s of ms~$0.11

Routing without a learned router

The escalation decision uses the Semantic Divergence Index — the absolute difference between two tiers' scores. That is arithmetic over outputs the pipeline already computed, which has a practical consequence: there is no router to train, no labelled routing set to collect, and nothing to retrain when you swap a model in or out.

SystemRouting signalTraining data neededRetrain on model swap?
TriAgentinter-tier divergencenoneno
FrugalGPTlearned scorer confidencelabelled examplesyes
RouteLLMlearned preference modelhuman preference pairsyes

The accuracy question

The intuition that the biggest model is the most accurate does not survive measurement here. On Financial PhraseBank:

ModelMacro-F1Bootstrap 95% CIRelative cost
FinBERT (110M)0.883[0.873, 0.893]
Qwen-7B0.809[0.796, 0.820]~200×

The confidence intervals do not overlap. A 110M-parameter specialist is statistically better than a 7B general-purpose LLM on this task, at roughly 1/200th the cost — which puts the always-LLM policy off the Pareto front entirely.

Scatter plot of macro-F1 against log-scale cost per thousand queries. Routing strategies form a Pareto frontier curving up and to the right. The always-Qwen-7B point sits below and to the right of the FinBERT point, meaning it costs more and scores worse, placing it off the frontier.
The cost–accuracy Pareto frontier. Always-L3 sits below and to the right of always-L2 — it costs more and scores worse. Routing strategies sweep the frontier between the specialist floor and the committee ceiling.

Which tier can you drop?

ConfigurationMacro-F1Cost / 1kVerdict
L1 + L2 + L3 (full)0.88$0.0006baseline
L1 + L2 (drop the LLM)0.70$0.000087.5× cheaper, 1.8 pp behind
L1 + L3 (drop the encoder)−13 ppcatastrophic

The specialist is the irreplaceable tier; the LLM is the most expendable. If you are choosing where to spend engineering effort, fine-tune the domain encoder before you upgrade the reasoner.

Accuracy is not the only thing that pays

On a 20-ticker trading back-test the ordering is not what the F1 table predicts:

StrategySharpeReturn %
SDI single-stage routing3.503.4
SDI two-stage routing2.902.8
Always-VADER1.512.0
Always-FinBERT1.360.8
Always-Qwen-7B0.110.3

The most expensive policy is the worst on a risk-adjusted basis. And always-VADER beats always-FinBERT on Sharpe despite far worse F1 — classification accuracy and downstream value are only loosely coupled.

Before you adopt this

The approach depends on your mid-tier specialist being well calibrated. Where it is not, it performs worse than doing nothing: on TFNS, where FinBERT collapses to F1 0.66, the critic protocol drops to 0.65 against the LLM's own 0.76. Run the one-shot check described on the critic plateau page before committing.

Related