TL;DR
When large language models think through long, multi-step problems, their memory—the Key-Value (KV) cache—balloons rapidly, forcing us to evict less "important" tokens to save space. Standard compression methods treat this like a global battle royale where individual tokens compete to survive, accidentally erasing entire paragraphs of crucial intermediate logic in a failure mode called Region Wipe-out. This paper introduces Adaptive Mass-Segmented (AMS) KV compression, a universal plug-in that shifts from cutthroat token competition to smart neighborhood zoning, ensuring every step of a model's train of thought keeps a seat at the table.
What Problem Does This Paper Address?
Imagine trying to solve a complex math proof while someone periodically rips random pages out of your scratchpad to save desk space. When LLMs generate long Chain-of-Thought (CoT) sequences, their KV cache (which stores past token representations so the model doesn't recompute them) grows linearly, hitting a severe memory bandwidth wall.
To bound memory, existing decoding-time compressors periodically score cached tokens (using attention weights or geometry) and keep the global Top-$k$ winners. The authors discover a glaring structural flaw in this global competition: attention naturally spikes around a few "heavy hitter" tokens. Under tight budgets, entire contiguous blocks of distributed, intermediate reasoning get outcompeted and deleted simultaneously—a phenomenon they term Region Wipe-out.
When an entire bridge of logic vanishes, the model loses the plot. It silently alters problem constraints (Problem Drifting), abandons valid intermediate conclusions (Premature Overturning), or spirals into endless, degenerate text loops (Repetition Collapse).
Methods
Instead of inventing yet another token-importance scorer, the authors rethink how memory budgets are distributed, proposing an "allocate-then-score" paradigm. AMS is a training-free, plug-and-play layer that wraps around existing scorers in four steps:
- Spatial Mass Partitioning: Rather than using recent attention scores directly for survival, AMS normalizes them into a 1D probability distribution ("quality mass") across the sequence. By slicing this sequence whenever cumulative mass crosses fixed thresholds, high-attention regions are carved into fine-grained segments, while quieter regions are grouped into broader ones.
- Guaranteed Regional Quotas: Before any token is judged, AMS distributes the memory budget across segments proportional to their mass. Crucially, every segment gets a strict minimum quota (protecting intermediate steps from total wipe-out), alongside standard "must-keep" rules for initial sink tokens and the very latest tokens.
- Local Plug-and-Play Scoring: Now, whatever base scorer you prefer (e.g., TOVA, Expected Attention, KeyDiff) runs locally within each segment to pick the Top-$q_i$ tokens for that specific zone, physically gathering them into a compact cache (which works cleanly with paged memory systems like vLLM).
- EMA Temporal Smoothing: Because attention spikes jump around as generation progresses, segment boundaries can jitter wildly across compression rounds. AMS keeps an Exponential Moving Average (EMA) "credit" history of past mass, smoothing out transient spikes so consistently useful regions stay protected.
Datasets
Because AMS requires no training, all datasets are existing benchmarks used strictly for evaluation:
- Mathematical Reasoning: MATH500, AIME24, AIME25, and GSM8K (shorter natural-language word problems).
- General Long-Context & Retrieval: Code completion (Repo), Open-Domain QA (TriviaQA), LongBench, and Needle-in-a-Haystack (NIAH) for sparse retrieval.
Key Insights and Ideas
- Attention is a better map than a guillotine: Using attention purely to execute individual tokens causes myopia. Treating attention macroscopically as a spatial density map preserves the narrative arc of a reasoning chain.
- Less memory can yield smarter answers: Counterintuitively, compressed caches with AMS occasionally beat the uncompressed Full KV baseline. Pruning low-utility tokens while preserving regional structure appears to reduce "attention dilution," helping the model focus.
- Better compression actually speeds up wall-clock generation: You might expect extra segmentation math to slow things down. Instead, because standard compressors starve the model of context, they trigger Repetition Collapse—causing the model to babble in loops until hitting max token limits. By preventing logical deadlocks, AMS finishes problems in fewer tokens and less time.
Key Results
Tested primarily on DeepSeek-R1-Distill-Qwen (7B and 32B) and OpenThinker3-7B across tight per-layer budgets ($T_{\text{keep}} \in \{256, 512, 1024\}$):
- Massive gains under tight budgets: At $T_{\text{keep}} = 256$ on MATH500 (7B), plugging AMS into Expected Attention jumps pass@1 accuracy by +16.0 points (32.6% $\rightarrow$ 48.6%), and boosts KeyDiff by +20.0 points (22.8% $\rightarrow$ 42.8%).
- Beating uncompressed baselines: On MATH500, AMS-Expected hits 54.0% ($T_{\text{keep}}=512$) and 54.2% ($T_{\text{keep}}=1024$), surpassing uncompressed Full KV (52.8%). It also beats Full KV on code completion (27.44% vs. 24.04%).
- Universal modularity & scale: AMS improves every tested scorer—including geometric (TriAttention, up to +6.4 points) and reasoning-specific (R-KV, up to +8.4 points) methods—and scales cleanly to 32B models (+16.8 points over AdaKV-ExpE2 at budget 256).
- System efficiency: On MATH500, AMS-Expected uses the exact same physical memory as standard gather-based eviction (15.0 GB vs. 39.6 GB for masking-based AdaKV) while cutting average decoding time from 67.1s (TOVA) down to 41.4s, and reducing token repetition rates by 5.4%.
Limitations and Future Work
In the main text, the authors explicitly state that production-serving efficiency (such as multi-request throughput at scale, beyond single-request latency and vLLM compatibility validation) remains outside the scope of their measurements. Broader methodological limitations and societal impacts are deferred to Appendix A, which is not included in the provided document.
Summary updated