The Hidden-Mass Trap in KV-Cache Compression
Why two caches can give identical attention outputs, then diverge when the same new tokens arrive.
Long-context inference gets more expensive as the key-value (KV) cache grows. Prefix sharing can avoid duplicating common context across sessions. Quantization, eviction, and subsampling can shrink what each session keeps. For a long-running agent, the cache that passes an evaluation now also has to work after the next tool response arrives.
In Append-Observational Geometry and Nonlinear Widths of Softmax Attention States, we show that two histories can agree on every current attention query and respond differently to the same continuation. We call the test of how they behave under common continuations append observability.
What softmax hides
For each query, softmax attention returns a weighted average. The sum of the weights before normalization is the historical normalization mass. It determines how strongly the cached context influences the answer once new tokens enter the average.
Take ten tokens with identical keys and scalar values of +1. Keep just one token at its original weight. Both caches still return +1 on every query. Now append three tokens with that same key and values of −1 to both caches. The full cache returns about +0.54. The compressed cache returns −0.50. The difference comes entirely from how much historical weight each cache carried forward.

When cache blocks can be merged safely
The weighted sum and the normalization mass each add across disjoint blocks. We use Thompson’s 1963 metric on a positive-cone representation of those two quantities. In that metric, the error of merging independently approximated blocks is at most the largest block error. A serving engine can therefore merge summaries in parallel and retain a per-block error guarantee. Any new approximation performed after a merge has its own error budget.
Where compression reaches a hard limit
Brouwer’s invariance of domain and the Borsuk–Ulam theorem help establish limits on continuous representations. In the paper’s examples, every stored token has the same value, so current outputs reveal nothing about the keys. Future appends reveal enough of the hidden mass to force one real coordinate per independently varying key parameter below a specified error threshold. In the orthogonal-key construction, the threshold stays bounded away from zero as history grows, and ordinary unit-weight appends expose the gap within a number of tokens proportional to the history length.
What concurrent sessions can share
Using collective nonlinear widths, we derive the same accounting rule for a fixed-key family analyzed with Fourier–Bessel expansions and for a variable-key family where only the hidden mass carries information. A joint representation stores the shared coordinates once and the private coordinates once per session. With 60 shared and 20 private coordinates per session, eight independent representations use 640 coordinates. A joint representation uses 220. As concurrency grows, private state accounts for most of the remaining cost.
Maintaining a cache as the stream grows
When a fixed feature expansion approximates the attention kernel to bounded relative error, Carathéodory–Tchakaloff cubature can preserve the necessary moments using a bounded number of weighted tokens. With approximate solvers, a Bentley–Saxe merge tree limits accumulated solver error to logarithmic growth in stream length. With fixed precision and feature count, a shared scale exponent makes weight storage grow doubly logarithmically with the stream length. Some existing attention coresets inherit append guarantees by restoring the weights their approximation analyses already rely on.
What to measure in a serving evaluation
Run a full cache and its compressed counterpart through the same continuation. Track the difference in normalized outputs and the relative error in the softmax normalizer. Include a checkpoint after merging independently compressed blocks if the serving stack uses chunked context.
The proofs cover one softmax head with bounded values, a fixed query domain, and the same externally chosen continuation for both caches. Extending the analysis to rotary embeddings, more general key geometries, and generation where past outputs determine future inputs remains open. End-to-end throughput and task accuracy require separate measurements.