MoE Model Tops the Usage Leaderboard: Why 2x the Tokens Can Still Cost Less
This article unpacks a common misreading of AI API leaderboards: when a large sparse Mixture-of-Experts (MoE) model tops an aggregated usage chart while consuming roughly twice the tokens of the runner-up, it does not follow that the model is either the best or the most expensive—token counts measure workload, not cost. We break the total bill into its real drivers: per-token price versus total task cost, the prefill-versus-decode cost structure, and KV cache size. We then show how an architecture that activates roughly twice the parameters per token can still deliver a lower total task cost on long-context coding work, walking through cost accounting, architecture (shallow-and-wide design, fine-grained experts, sparse attention, and a host-memory n-gram lookup), why long-context coding tasks can use fewer tokens, common leaderboard pitfalls, and a practical framework for comparing models on your own tasks with consistent billing metrics. Includes a cost formula, Python snippets, and comparison tables.
How to read “top of the charts + 2x tokens”
Recently, a cloud provider open-sourced a Mixture-of-Experts (MoE) model with a parameter count in the hundreds of billions (call it Model A), positioned as a “high cost-performance mainstay model.” Shortly after launch, it climbed to the top of an aggregator platform that benchmarks calls across many model APIs, with token consumption roughly double that of the runner-up (call it Model B).
Seeing “top of the charts” and “double,” it is tempting to draw two conclusions: first, that it is the most popular and therefore the best; second, that it consumes more tokens and is therefore more expensive. Both inferences skip a critical step. Leaderboards blend unit price, output length, task difficulty, and billing conventions; token counts are a proxy for workload, not a measure of cost. The real question worth answering is: how can a model that activates roughly twice the parameters of its rival hold the top spot while also driving down the cost of an entire task?
Take the comparison in the setup as an example. One intuitive answer: Model A activates about 11.3 billion parameters per token, Model B about 6.7 billion, yet A’s KV cache is 1.8× smaller than B’s at a 262K context length and 2.4× smaller at 8K. On long-context coding tasks, its token consumption is actually only a fraction of B’s, so the total cost per task ends up lower. The rest of this article unpacks this accounting across three layers: billing structure, architecture design, and leaderboard methodology.
1. Get the accounting straight: an MoE model’s “unit price” and “total price” are not the same thing
1.1 Prefill and decode have different cost structures
| Dimension | prefill (process input) | decode (generate token by token) |
|---|---|---|
| Bottleneck | compute-bound | memory-bound |
| Main overhead | reading the activated expert weights; the attention part grows roughly quadratically with context length | every token requires reading the activated expert weights, then reading the history KV cache again |
| Cost trend | the longer the context, the higher the per-token prefill cost | the longer the context, the higher the per-token decode cost |
Take Model A—about 220B total parameters and about 11.3B activated per token—as an example: each forward pass activates only about 5% of all parameters. Model B has about 180B total parameters and activates about 6.7B, a slightly higher activation ratio, but both belong to the “large-capacity, low-activation” family of sparse MoE models.
1.2 Peak price vs. average price per token
The cost of the decode phase is roughly made up of three parts:
- Weight reads: shared across all requests, so they can be amortized by increasing the batch size;
- KV cache reads: private state belonging to each request; they cannot be amortized across requests and only grow as the context lengthens;
- Routing and expert-parallel communication: under expert-parallel deployment, tokens are dispatched to experts on different devices via all-to-all communication, and the results are gathered back.
The “price per million tokens” used for estimates is usually an average taken at some context length. Activating more parameters makes the weight-related part more expensive; a leaner KV cache and fewer tokens on long-range tasks pull the average price back down. The two forces partially offset, so any comparison must state at what context length and what concurrency it was measured.
1.3 Total task cost = Σ(inputs + outputs + cache per call)
Once you break a complete task into several model calls, its total cost is the sum of each call’s charge. The total depends not only on token counts but also on the billing structure—for example, the price ratio between input and output, whether prefix caching is discounted, and whether tiered pricing applies.
This is exactly why vendor comparisons tend to emphasize “total task cost” rather than “price per million tokens”: in long-range tasks, the context is re-read repeatedly and cache hits are uneven, so a unit price cannot reflect the real bill.
It is worth noting that the two facts in the setup—nearly double the activated parameters per token, yet a lower total task cost—can hold simultaneously without relying on any proprietary optimization. It follows from the cost structure itself.
2. Architecture breakdown: how can this design save both compute and KV cache?
Note: the structural figures in this section come from the vendor’s published configuration. I have not tested Model A locally, so the conclusions here are based mainly on mechanism-level reasoning; please validate them against your own tests.
From public information, Model A and Model B share a very similar skeleton:
- both use 12 layers of sparse attention;
- both configure 512 routed experts;
- both use 4 residual streams;
- both include a large n-gram lookup table resident in host memory.
So the differences between them come mainly from the “width” of each expert and the KV structure of the attention, not from the macro paradigm.
2.1 Shallow and wide: trading depth for compute
Spreading about 220B total parameters across 12 layers makes both the per-layer parameter count and the expert size grow noticeably. When a single layer carries more capacity, each token must activate more experts or wider experts. This “shallow and wide” design has one direct benefit: the KV cache scales with the number of layers, so 12 layers are inherently more memory-efficient than a conventional model with dozens of layers.
2.2 Fine-grained experts: a lower activation ratio, more sensitive routing
Cutting experts into finer pieces makes each expert smaller, so you can keep a larger total capacity while controlling the total activated amount. 512 experts is a typical fine-grained configuration. Its cost is more sensitive routing:
- Load imbalance: a few popular experts get over-selected and become bottlenecks; cold experts receive almost no training, wasting capacity.
- Communication amplification: under expert-parallel deployment, the more scattered the activated experts, the more frequent the cross-device communication.
- Low utilization at small batch sizes: when concurrency is insufficient, many experts process only one or two tokens, weight reuse drops, and bandwidth utilization falls.
On the training side, auxiliary losses are commonly used to constrain the routing distribution, as sketched below:
def router_loss(router_logits, topk_idx, num_experts):"""router_logits: [num_tokens, num_experts], router scorestopk_idx: [num_tokens, topk], the expert IDs selected for each token"""# 1) Load-balancing loss: mean of squared expert-selection counts# The closer to a uniform distribution, the smaller this term,# which prevents a few experts from being overused.counts = torch.bincount(topk_idx.flatten(), minlength=num_experts).float()f = counts / counts.sum() # actual assignment fraction# 2) Mean router confidence, preventing routing from collapsing onto a few expertsprobs = torch.softmax(router_logits.float(), dim=-1).mean(0)aux = num_experts * (f * probs).sum()# 3) z-loss: suppresses overly large router logits to stabilize trainingz = torch.logsumexp(router_logits.float(), dim=-1).square().mean()return aux, 1e-3 * z
On the inference side, you need to observe expert hit rate, queue time, and drop rate from load-test data. Weaker performance at small batch sizes and low concurrency does not mean it is weak under high-concurrency serving; you must test against your real traffic shape.
2.3 Sparse attention: design knobs tied to KV size
The size of the KV cache can be computed precisely:
KV_bytes = 2 × layers × kv_heads × head_dim × seq_len × bytes_per_elem
The factor of 2 accounts for one copy each of K and V. Just from the layer count, 12 layers versus a conventional 60 layers can cut the KV cache to about one-fifth.
| Design knob | Mechanism | Cost |
|---|---|---|
| Fewer layers | KV cache drops linearly with layer count | Higher per-layer capacity and training difficulty |
| Fewer KV heads (multi-query / grouped-query attention) | KV heads far fewer than query heads | Slightly reduced expressiveness; needs training support |
| Smaller head_dim | Each KV head takes up less space | Lower per-head information capacity |
| Sliding window + a few global tokens | Most tokens only see a neighboring window | Very-long-range dependencies need an extra pathway |
| KV quantization (e.g., 8-bit) | Size is halved directly | Precision loss and extra operators |
Per the setup, B’s KV cache is 1.8× A’s at 262K and 2.4× A’s at 8K. The ratio changes with length, which indicates the gap comes from “the part that grows with length”—that is, the per-layer KV structure—rather than from a fixed overhead.
A quick extrapolation: let A’s KV cache at 262K be S, so B’s is 1.8S. Working backward, in the short-context regime B’s length-dependent portion is roughly 3.42× A’s:
1.8 × 262 ≈ 3.42 × 138 (in K)
In other words, once the context enters the “long” range, B’s KV cache rapidly expands toward—and can even exceed—that gap.
Here is a comparison under an equal hardware budget; the columns are, in order, the model, the KV cache at 262K, the number of concurrent sequences a single card can hold, and the KV read per token.
| Model | KV cache at 262K | Concurrent sequences per card | KV read per token |
|---|---|---|---|
| Model A | 1 × S | N | 1× |
| Model B | 1.8 × S | ~N/2 | 1.8× |
Two conclusions follow:
- Half the concurrency, double the unit cost: on the same accelerator, B can serve only about half the concurrency under long contexts, so the hardware cost per token is roughly twice A’s.
- The longer it writes, the slower it gets: when generating at 262K, B must read nearly twice the KV per generated token as A, so decode speed decays faster as the context lengthens.
Under short contexts, weight reads dominate and B’s low-activation advantage is more pronounced. But its length-dependent KV portion is about 3.42× A’s, so it gets quickly overtaken once the context grows. So B is “friendly to short requests, strained on long ones,” while A is “friendly to long contexts, with a slightly higher unit price on short requests.”
2.4 A host-memory n-gram lookup: moving part of the “memory” out of VRAM
An n-gram lookup is a long-standing idea: statistics are gathered over contiguous fragments from the corpus or context to build a “fragment → successor” lookup structure, and at inference time a hit yields candidates directly, reducing the model’s computational load. Placing it in the MoE context, the benefits and costs are roughly:
- Benefits: boilerplate code, interface definitions, and documentation fragments that recur heavily in long contexts can be reused directly, bypassing repeated computation; keeping the lookup structure in host memory rather than VRAM does not eat into the precious VRAM budget, indirectly leaving more room for the KV cache.
- Costs:
- it occupies host memory and memory bandwidth;
- it requires custom operators to wire the lookup results into the inference flow;
- the effect depends on the task: hit rates are high for code and templated text, but may be very low for open-domain conversation;
- the larger the table, the colder it gets, and memory-access locality worsens.
- How to validate: compare per-thousand-token cost, throughput, and generation quality with the lookup on versus off.
Be wary of attribution bias, too. “The KV cache is 1.8× smaller at 262K” is a static comparison of storage size, while “several times fewer tokens on long-range tasks” is a dynamic result of generation behavior. The lookup saves computation and some memory access; it does not necessarily show up directly in the KV size, and the two should not be conflated.
3. Long-context coding tasks: why can tokens drop several-fold?
The typical flow of a long-context coding task is the model iterating between “read files → edit code → run tests → read errors → edit again”:
- each round re-injects the relevant files into the context;
- each round re-reads the conversation history, and prefill and KV cache overhead accumulate with each round;
- a single wrong edit can add several more round trips.
Differences between models on the same task come mainly from three things:
- Single-edit correctness: a model that gets an edit right the first time significantly shortens the later rounds and the context;
- Information retention in long contexts: multiple residual streams and sparse attention working together are meant to retain key information as the context lengthens;
- Context-management strategy: whether it is “cram everything in” or “retrieve + summarize + expand on demand.”
This also explains a common pattern on leaderboards: the model that consumes more tokens is not necessarily the one with the lowest unit price, but often the one that can “get the task done.” Developers are willing to spend more tokens for a single successful delivery.
4. Why the leaderboard can’t be read as just “calls #1 + 2x tokens”
4.1 Three common misconceptions
- Misconception 1: Top of the charts = strongest. Call volume is a weighted result of all kinds of user demand; cheap, fast models naturally attract a large number of simple requests, and a leaderboard’s ranking has little to do with a capability ranking.
- Misconception 2: 2x tokens = more expensive. Tokens measure workload, not the bill; you still have to multiply by unit price, cache discounts, and success rate. Retries after a failed task also consume tokens, and produce nothing.
- Misconception 3: Using leaderboard data directly to make a selection. An aggregator’s user base, default parameters, output lengths, and caching strategies all differ, so cross-model comparability is limited.
4.2 Three measurement questions to ask
- Are the metrics consistent? Do these count: input tokens on a cache hit, reasoning (chain-of-thought) tokens, tokens from folding in multimodal input, and tokens from failures and retries. With different metrics, a 2x gap may be purely a statistical artifact.
- Are the tasks comparable? The input-to-output token ratio, the distribution of context lengths, and the number of tool calls all significantly affect the total bill.
- Is the billing comparable? Output unit price, cache discounts, tiered pricing, and batch interfaces all need to be normalized onto a common basis.
5. Putting it into practice: unify your metrics, tally the total
5.1 A cost formula on a consistent basis
Let the input, output, and cache-hit token counts of the i-th call be xᵢ, yᵢ, and hᵢ, and let the input, output, and cache-hit unit prices be p, q, and r (per million tokens). Then the total cost of a single task is:
Cost = Σᵢ [ (xᵢ − hᵢ) × p + yᵢ × q + hᵢ × r ] / 1,000,000
from dataclasses import dataclass@dataclassclass Call:prompt_tokens: int # all input tokens for this requestcompletion_tokens: int # output tokens for this request (including reasoning content)cached_tokens: int # tokens among these that hit the cache and are billed at a discount@dataclassclass Price:input_per_m: float # currency / million input tokensoutput_per_m: float # currency / million output tokenscached_per_m: float # currency / million cache-hit tokensdef task_cost(calls, price):total = 0.0for c in calls:# cached_tokens is a subset of prompt_tokens, so it is not double-countedfresh = c.prompt_tokens - c.cached_tokenstotal += (fresh * price.input_per_m+ c.cached_tokens * price.cached_per_m+ c.completion_tokens * price.output_per_m) / 1e6return total
5.2 A three-step selection process
- Build a minimal task set from your own data: cover typical input lengths (e.g., 8K / 32K / 128K) and typical output lengths, with at least 20 samples per scenario.
- Collect usage per round of calls: read the
usagefield returned by the API directly, rather than estimating by hand. - Compute three metrics on a common basis: total cost per task, end-to-end latency, and task success rate (e.g., unit-test pass rate).
5.3 Cache-friendly and long-context cost management
Server-side caching mechanisms vary by implementation, but “a stable prefix” is a universal prerequisite:
[fixed] System instructions + tool definitions + project conventions[semi-fixed] Codebase summary, API docs (index them, retrieve on demand)[variable] Current task description, incremental file content
- Keep the stable prefix up front: keep system prompts, tool definitions, and project conventions as unchanging across requests as possible, to create conditions for a higher cache hit rate.
- Replace “cram everything in” with retrieval: inject only the relevant fragments on top of a codebase index, rather than stuffing the whole repository into the context.
- Compress history promptly: periodically summarize early content in long sessions to prevent the context from monotonically ballooning.
- Control output length: output tokens are usually more expensive than input, so structured-output constraints and clear stopping conditions effectively reduce wasted generation.
These methods do not depend on any specific product; they apply just as well when you switch models.
5.4 Checkpointing long-running tasks
Once a long-running task fails partway, the tokens already spent are wasted. Break the task into small stages with checkpoints—for example, save intermediate results each time a sub-goal is completed, and resume from the checkpoint after a failure rather than rerunning from scratch. On the engineering side, you can also use message queues to decouple task scheduling, object storage to persist intermediate artifacts, and logging plus monitoring and alerting to track each call’s token usage and latency. Managed services such as those offered by Baidu AI Cloud can serve as options for this kind of general-purpose infrastructure.
5.5 Illustration: the bill under the same input but different outputs and hit rates
The unit prices and token usage in the table below are illustrative figures, used only to show the calculation method. A and B stand for two model classes: “high activation, low KV” and “low activation, high KV.”
| Item | A | B |
|---|---|---|
| Input / output / cache-hit price (per 1M) | 2 / 8 / 0.4 | 1.2 / 5 / 0.2 |
| Simple Q&A: input / output tokens | 8K / 1K | 8K / 1K |
| Simple Q&A: cache hit rate | 50% | 50% |
| Long-context coding: total input / total output tokens | 400K / 8K | 1.6M / 16K |
| Long-context coding: cache hit rate | 70% | 20% |
Using the formula from 5.1:
- Simple Q&A: the context is short and weight reads dominate, so B’s average per-token price is lower, and its cost is about 54% of A’s.
- Long-context coding: the context is long and re-read repeatedly, so A leverages its low KV overhead and high cache hit rate, and its cost is about 31% of B’s.
6. Conclusion: from “comparing unit price” to “tallying the total”
Back to the question in the title: “top of the usage charts + 2x tokens” indicates that a model is used a lot and used on heavier tasks, not that it is more expensive or more powerful. To judge whether such an MoE model is “worth it,” hold on to four main threads:
- Tally the total, don’t compare unit prices;
- Look at KV cache efficiency and cache-friendliness;
- Measure on your own tasks;
- Keep the metrics consistent.
This framework does not depend on any single model. Architectures iterate fast, but the cost structure is stable: whoever can finish a task with less “effective work” wins in long-context and high-concurrency scenarios.
