Adaptive Mass-Segmented KV Compression for Long-Context Reasoning
Junzhe Yang, Xiaoyu Shen
NeurIPS page · Open on the map
Category: Efficient LLM Inference & Training › KV Cache Optimization · Type: new method · Keywords: KV cache compression, long-context reasoning, region wipe-out, allocate-then-score, attention-based segmentation
Areas: LLM Reasoning › Efficient Reasoning › KV Cache Compression; Memory › Model Memory Optimization › KV Cache Optimization; Long Context › Long-context mechanisms › KV cache eviction
Summary
AMS introduces an allocate-then-score KV compression framework that partitions each head's cache into adaptive segments with region-wise quotas and minimum-keep guarantees, preventing region wipe-out and improving long-context reasoning accuracy by up to 20 points.
Explained to a 5-year-old
Big computer programs that write text need to remember everything they have written before. They keep this memory in a special place called a cache, but this cache can only hold a limited amount of information. If the cache is full, the program has to choose which parts of the memory to keep and which to forget. The usual way of choosing is to pick only the most important single words, but this can cause whole chunks of the story to disappear. When those chunks are missing, the program starts to make mistakes and repeats itself. The new idea splits the memory into big sections and makes sure each section keeps some words, so nothing important is lost.
Explained to a 5-year-old, longer
When a computer program writes long stories or solves math problems, it needs to remember everything it has written before. It stores this memory in a special area called a cache, but this cache can only hold a limited amount of information. If the cache is full, the program has to choose which parts of the memory to keep and which to forget. The usual way of choosing is to pick only the most important single words, but this can cause whole chunks of the story to disappear. When those chunks are missing, the program starts to make mistakes and repeats itself. The new idea is to look at the whole memory and split it into big sections, like slices of a pizza. Each slice gets a rule that says how many words it must keep, so no slice loses everything. It also uses a smooth way to remember past choices, so the memory stays stable over time. This helps the program keep more of what it has written and think more clearly. As a result, the program can answer questions better and solve harder problems. It works for many different kinds of tasks, like math, coding, and general questions. The method is easy to add to existing programs and does not make them much slower.
For a technical reader
The paper addresses the memory bottleneck in long-context language model decoding, where the key-value cache can quickly fill up. Existing compression methods select tokens individually, which often discards whole reasoning spans and harms accuracy. The proposed solution separates cache allocation from token scoring, using an attention-based mass distribution to split each head's cache into adaptive segments with guaranteed minimum retention. An exponential moving-average credit mechanism makes the allocation aware of past compressions, smoothing cache evolution over multiple recompressions. Experiments show the approach can boost pass@1 accuracy by up to 20 points on math and reasoning benchmarks while adding almost no decoding overhead.
Problem
Long-context autoregressive models suffer from KV cache memory bottlenecks, and existing compression methods that select tokens individually tend to over-focus on local attention spikes, causing depletion of contiguous reasoning spans and disrupting model reasoning.
Method
The approach decouples budget allocation from token scoring, using an attention-based quality-mass distribution to segment each head's cache into adaptive regions with region-wise quotas and minimum-keep guarantees, and employs an exponential moving average credit mechanism to make allocations history-aware.
Results
The approach improves pass@1 accuracy by up to 20.0 points over baseline scorers on the evaluated benchmarks, sometimes even surpassing uncompressed full-KV decoding, with negligible decoding-time overhead.
Contributions
It introduces a scorer-agnostic, allocate-then-score KV compression framework that partitions cache into adaptive segments with region-wise quotas and history-aware EMA credit, preventing region wipe-out and enhancing reasoning quality across multiple long-context tasks.
Practical relevance
Enables efficient long-context inference for large language models on limited hardware, improving reasoning accuracy without significant speed cost.
Research questions this paper is counted under
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction