TailAlloc: Allocating the KV Cache by Tail-Risk Contribution, Not Standalone Risk
Abstract
Long-context inference caches key-value (KV) pairs for every token read, and at long contexts that cache dominates serving cost. Quantisation and sparse attention shrink it without choosing how many tokens each attention head keeps; KV eviction does, under a fixed budget, so a scoring rule picks which tokens a head discards and an allocator sets how much budget it gets. Every published allocator minimises a sum of per-head risks, and that sum is the wrong quantity: it is the model's tail risk only when heads are comonotonic, failing on the same requests, and otherwise overstates it by a median 55% over six captures on three model families. What governs the tail is each head's Euler risk contribution, its average error on the requests where the model's total error is worst; by it, 6–38% of heads are tail hedges whose error moves against the model's, and rescored on the tail risk itself no published allocation beats a uniform budget. We therefore propose TailAlloc, which estimates these Euler risk contributions on a calibration set and allocates against them with a marginal-gain greedy algorithm. This replaces direct tail averaging with a covariance-based closed-form estimator where tail samples are scarce. Against the exactly solved optimum of the separable objective — the strongest published allocator, its dual gap certified — TailAlloc wins 124 of 140 rows under leave-one-capture-out, by a median 1.96 percentage points. Task metrics move too: a contribution-built allocation gains +2.59 [+1.78, +3.40] over a matched uniform budget on RULER at 4096, and on LongBench it clears an equal split on two captures of six, the separable optimum on none. We further note that when design-space effects fall below an evaluation's resolution, average benchmark scores do not provide evidence for the corresponding design choice.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.