synodic-ai™ ML SYSTEMS
ML Systems Desk · Inference Efficiency

Where inference cost accumulates: an energy law for the KV cache, mid-depth eviction scoring and prefix-coded experts

Three papers posted on 2026-11-01 and 2026-11-02 examine where the cost of LLM inference builds up beyond the arithmetic of a single token: in the key-value (KV) cache that every new token adds to, in the choice of which cached tokens to evict, and in the expert weights that a mixture-of-experts (MoE) model reads from SSD. Each replaces a fixed per-unit assumption with a model of how cost depends on the state a request has already built up.

A token's cost depends on the tokens before it

The SIMPLE Law for Energy Cost of LLM Inference starts from a billing mismatch: generative AI is billed per token, yet tokens are not equally expensive. Each token enters the KV cache and raises the cost of those that follow, so energy grows non-linearly along a sequence whose tokens look identical. The authors note that no analytical model states what a token costs, and that the most accurate prior model is a fit that absorbs architecture into coefficients and must be refitted for each LLM. They derive closed-form expressions for the computational and memory-access complexity of inference in terms of architectural hyperparameters, covering multi-head attention (MHA) and grouped-query attention (GQA), and compare a family of analytical models of increasing granularity.

The result, the SIMPLE Inference Model to Predict LLMs Energy, is a four-parameter law that separates prefill from decode, and decode into a KV-cache cost and a next-token computation cost. On traces of 13 dense LLMs from six families, it reaches an R-squared of 0.969 and a mean absolute percentage error of 11.97 percent, 3.1 to 3.5 times lower than the prior state of the art, without per-model calibration.

Because the law is analytical, it also explains. Prefill energy grows quadratically with the hidden dimension, so larger models pay most for long inputs, and more aggressive GQA grouping of the KV cache cuts per-token energy by up to three times relative to standard MHA. Raising the reasoning-token budget pushes output length beyond the analytically derived energy minimum, so energy grows super-linearly; accuracy rises with the budget, but energy rises faster, and intelligence per joule peaks at an intermediate budget, falling by up to 3.14 times across a fourfold range of budgets. Agentic serving raises energy per request 13.0 times relative to non-agentic requests, because both the prefill and KV-cache terms grow with input length. Prefix caching removes most of the prefill cost, 93 percent, but leaves the KV-cache term untouched, so even a cached agentic request costs 4.8 times more.

Which layer should decide what the cache forgets

Who Should Score the Cache? Mid-Depth Layers Are the Best Judges of KV-Cache Eviction looks at the standard way to bound that cache. Eviction methods rank tokens by attention scores, and each layer scores its own cache; the author knows of no eviction method that asks which layer should score. Across twenty-one models, the depth of the scoring layer governs eviction quality. On the eighteen models with per-layer caches, from 0.5B to 109B parameters, long-context retrieval accuracy collapses when shallow layers score, peaks between 0.4 and 0.75 of the model's depth and degrades at the last layer. The explanation offered is that a layer judges tokens well only once it has used the question to find the answer, which takes several layers.

Modeling eviction as a top-k cut, the paper computes the probability that the answer survives from prefill attention and reproduces the measured curves. That model selects a scoring layer from calibration prompts with known answers. The selected layer is the best measured layer on most models and never significantly below it, and it improves on the own-layer default on 16 of 18 models, significantly on seven, all at 14B parameters or below; on larger models the default is already close to the best mid-depth layer. Scoring every cache from the selected layer, with one set of kept tokens for all heads, beats per-head SnapKV by 18 to 43 points on five models up to 14B under tight budgets, and the gain carries over to financial filings at 32K context with the same memory budget and no extra forward pass.

The same curve explains a penalty in shared-cache models, where several layers read one cache and the layer that writes it scores by default: in one such model the writer is shallow and loses 28 points to a mid-depth reader at a 10 percent budget. The result has a boundary, too: in open-book question answering on LongBench, no mid-depth layer beats the own-layer default.

Precision as depth, not as separate copies

PagedMoE: Cross-Precision Expert Caching for Token-Level Dynamic Precision in SSD-Resident MoE Inference addresses local inference of large MoE models, where sparse routing lets the routed-expert pool live on SSD while DRAM caches recently used experts. At practical DRAM cache sizes, substantial SSD input/output stays on the critical path even when it overlaps with computation. Token-level dynamic precision, which allocates bits to each expert by its importance and quantization sensitivity, should reduce that traffic, but if each bit-width of an expert is stored as an independent object, the cache cannot reuse data across precisions and overlapping data is fetched repeatedly.

PagedMoE treats precision as the refinement depth of one shared expert state. Each expert is stored once using a prefix-compatible tree codebook and a bitplane layout, so lower-precision representations are valid prefixes of higher-precision ones, and cached data can be reused or extended by fetching only the missing bitplanes. The system chooses the prefix length before input/output from the current routing weights and offline, expert-specific error profiles, and it executes cached prefixes of 1 to 8 bits directly without materializing full-precision experts. At an average routed-expert precision of 2.5 bits, quality is close to GPTQ-INT4 on one evaluated MoE model and to MXFP4 on most evaluated tasks of a second. With a 24 GiB expert cache it reaches 8.89 tokens per second on the first model, 1.33 times the throughput of the same dynamic requests served with independent precision objects and 1.56 times that of uniform 4-bit execution.

Cost follows state

In each paper the expensive quantity is state rather than arithmetic. SIMPLE shows that the KV-cache term grows with every token and survives prefix caching, which is why agentic requests with long inputs cost so much more. The eviction paper shows that the quality of bounding that state depends on which layer is asked to judge it, a choice that existing methods had not treated as a variable. PagedMoE shows that for SSD-resident experts the useful unit of caching is a nested refinement rather than a separate copy for each precision.

Together they argue for pricing and capacity planning that start from the state a request builds up. A per-token price hides the KV-cache term, a fixed eviction rule hides a layer choice, and a per-precision cache hides the overlap between precisions. Each paper makes the hidden variable explicit and then optimizes it.

Implications for serving teams

For teams that serve or host LLMs, the results translate into four planning changes.

Limits of the evidence

SIMPLE is validated on traces of dense models on one GPU type, so MoE models and other hardware are outside its reported evidence, and its error of about 12 percent is an average. The eviction gains are concentrated at 14B parameters and below, and open-book question answering showed no benefit. PagedMoE's abstract reports quality relative to 4-bit baselines and throughput at one expert-cache size, so behavior under other memory budgets is not shown there.

Sources