---
title: "Cache Me If You Can — paper by Adithya et al. (2025)"
description: "How PruLong reduces long-context memory, why KV cache lifetime matters, and what experiments reveal about accuracy and efficiency."
canonical: "https://research.elamur.ai/free/en/papers/adithya-2025-cache-me-if-you-can/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/adithya-2025-cache-me-if-you-can/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2025](https://md.research.elamur.ai/free/en/papers/2025/) / Cache Me If You Can: How Many KVs Do You Need for Effective Long-Context LMs?

# Cache Me If You Can: How Many KVs Do You Need for Effective Long-Context LMs?

Paper · 2025 · Adithya Bhaskar, Alexander Wettig, Tianyu Gao et al.

**Authors:** [Bhaskar](https://md.research.elamur.ai/free/en/authors/bhaskar/), [Adithya](https://md.research.elamur.ai/free/en/authors/adithya/), [Wettig](https://md.research.elamur.ai/free/en/authors/wettig/), [Alexander](https://md.research.elamur.ai/free/en/authors/alexander/), [Gao](https://md.research.elamur.ai/free/en/authors/gao/), [Tianyu](https://md.research.elamur.ai/free/en/authors/tianyu/), [Dong](https://md.research.elamur.ai/free/en/authors/dong/), [Yihe](https://md.research.elamur.ai/free/en/authors/yihe/) and [Danqi Chen](https://md.research.elamur.ai/free/en/authors/danqi-chen/) · **Year:** 2025 · **Venue:** arXiv (Cornell University) · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

[**0** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W4417539660) · [arXiv (Cornell University)](https://openalex.org/S4306400194) · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [PDF](https://arxiv.org/pdf/2506.17121)
- [arXiv 2506.17121](https://arxiv.org/abs/2506.17121)
- [OpenAlex](https://openalex.org/W4417539660)

Citations: OpenAlex, 2026-10-14.

## What it is about

How PruLong reduces long-context memory, why KV cache lifetime matters, and what experiments reveal about accuracy and efficiency. · about 38 minutes to read

**In this deep dive**

1. [Summary](#dd-summary)
2. [Ideas worth borrowing](#dd-ideas-worth-borrowing)
3. [How Mova uses it](#dd-how-mova-uses-it)
4. [The problem and its context](#dd-the-problem-and-its-context)
5. [The method, step by step](#dd-the-method-step-by-step)
6. [Experiments and results](#dd-experiments-and-results)
7. [What the ablations show](#dd-what-the-ablations-show)
8. [Limitations](#dd-limitations)
9. [What came after](#dd-what-came-after)

### Summary

A language system can accept a very long document and still be expensive to use. During generation, a [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/) normally retains intermediate representations of earlier tokens so that later tokens can attend to them. These representations form the key-value cache, usually shortened to KV cache. Its memory requirement grows with the amount of text processed and generated. “Cache Me If You Can” asks how much of this information must remain available for long-context tasks to keep working. Its central contribution is a way to compare memory-saving methods across the whole inference process, including the often overlooked period when the input is being read.

The authors introduce the KV footprint: a measure that counts retained cache entries across their lifetimes, rather than inspecting cache size at a convenient moment. An entry consumes memory even when the current computation does not consult it. A method that removes most entries only after reading the entire prompt can therefore look economical during generation while requiring substantial memory beforehand. The paper also defines a critical KV footprint, the smallest footprint that preserves at least 90% of the full-attention reference score on a particular task. This turns the comparison into a practical question: how much memory can a method save before its quality falls beyond the chosen tolerance?

The paper improves two approaches to cache eviction. For methods that ordinarily prune the cache after reading the prompt, it introduces chunked eviction, which removes entries between input chunks. A patched version preserves the importance signal used by the original methods by attaching the prompt’s final query tokens to intermediate chunks. For methods that divide attention heads between global retrieval and local streaming, the authors propose PruLong. It learns which heads need unrestricted access by optimizing next-token prediction on natural long-context text, while progressively encouraging discrete decisions about each head’s role.

The experiments cover 21 datasets in 8 task categories, combining long-input evaluation from HELMET with long-output tasks from LongProc. PruLong is particularly effective on recall, where the paper reports a critical-footprint improvement of roughly 12 points over DuoAttention. Patched PyramidKV is strongest in several other categories, including retrieval-augmented generation and many-shot in-context learning. There is no universal winner. Changing the input chunk size can damage quality, and none of the evaluated methods produces a useful footprint reduction on the demanding Travel Planning task while preserving the required performance. The result is both an improved eviction method and a clearer account of what memory-efficiency claims must measure.

### Ideas worth borrowing

Measure the lifetime of a resource. A small final allocation can conceal a large earlier burden. The KV footprint makes retained information count throughout the period when it occupies memory, including intervals when it is not actively used. The same principle applies to temporary indexes, intermediate analysis graphs, document-processing buffers, and cached search results. Measuring only the final artifact can reward a pipeline that releases resources too late.

Define efficiency under a quality constraint. The critical footprint asks for the least resource use compatible with an explicit performance requirement. This makes the comparison easier to interpret than a collection of unrelated quality and sparsity settings. Elsewhere, the same design can identify the smallest search beam, shortest evidence packet, or cheapest analysis configuration that preserves an agreed level of task success. The tolerance must remain visible because a different requirement can change the preferred method.

Make decisions using the information the task actually needs. Naive chunked eviction scores cache entries using the end of the current chunk. Patched eviction instead carries the prompt’s final query tokens into intermediate processing. This distinction matters because the most recent text is not necessarily the text that explains what will be asked. Query-aware indexing, document selection, and evidence compression can borrow this separation between processing order and task relevance.

Learn structured roles rather than pruning indiscriminately. PruLong assigns attention heads to global or local behavior. Some components keep access to distant information, while others operate with a bounded recent context. This suggests a reusable design for systems with heterogeneous responsibilities: identify which components require a complete history and which can safely use a restricted view. The assignment should be evaluated through the final task, since an intuitive division can still discard essential information.

Align optimization with the deployed decision. PruLong changes both the learning objective and the treatment of discrete head assignments. It learns through next-token prediction and uses a relaxation designed to approach the binary choices required at inference. The broader lesson is to inspect gaps between what training rewards and what deployment actually executes. A smooth proxy, a representation-matching objective, or an arbitrary threshold can be convenient without accurately representing the final decision.

Separate algorithmic accounting from implementation measurements. The paper uses idealized footprint measures alongside GPU memory and throughput. Each answers a different question. Resource accounting exposes whether a method retains unnecessary state; hardware measurements show what a particular implementation achieves. Keeping both makes comparisons more useful when kernel quality, batching, or memory reclamation changes the observed ranking.

### How Mova uses it

Mova is a small language system written in Rust, with explicit linguistic rules, learned parameters, and graph-based state. Its native reading pipeline differs substantially from autoregressive Transformer generation. The paper therefore does not establish that Mova needs a KV cache or that PruLong can be inserted directly into its core. The useful connections are mostly about resource accounting, bounded context, evaluation, and the admission of compressed observations. The status marks below are proposed mappings against documented mechanisms, rather than evidence that this paper has already produced measured improvements in Mova.

Idea: Account for the lifetime of retained information. Where: Section 2.1 and Figure 1. Area: resource measurement. Mova: частково є (`tools/jobs` records estimates and actual resource use; `tools/twin` compares predictions with measurements). Mova could extend this accounting to the lifetime of temporary trees, frames, evidence packets, and retained graphs during a complete task. Why Mova: a pipeline can produce a compact final answer while keeping large intermediate structures alive unnecessarily; a lifetime measure would reveal where earlier release might help.

Idea: Distinguish stored information from information currently consulted. Where: Section 2.1, the active, inactive, and evicted classifications. Area: data structures. Mova: частково є (the distinction between the important graph in RAM and durable graph knowledge is described in `docs/architecture.md` and `docs/knowledge.md`). A more explicit runtime account could distinguish resident observations that a reader uses from resident observations it merely keeps. Why Mova: low access frequency alone does not mean low memory cost, and unused resident data should remain visible in efficiency reports.

Idea: Minimize resources subject to a declared quality requirement. Where: Section 2.1, critical KV footprint. Area: evaluation. Mova: частково є (regression gates and held-out evaluation already constrain changes to rules and parameters). A proposed extension would find the least expensive reader or worker configuration that satisfies a stated task-quality requirement. Why Mova: this would compare bounded configurations through their usable outcomes, rather than treating a smaller graph or faster run as an improvement on its own.

Idea: Evaluate the complete sequence of processing stages. Where: Sections 2.1 and 3. Area: pipeline evaluation. Mova: частково є (`tools/enrich` preserves distinct preparation, review, and staging states; worker workflows retain outcomes across explicit interfaces). Mova could report resource use across parsing, graph construction, specialist reading, and answer production together. Why Mova: savings in the final reader can be outweighed by expensive preparation, just as a small decoding cache can conceal a costly prompt-reading stage.

Idea: Release intermediate state between bounded chunks. Where: Section 3, chunked eviction. Area: data processing. Mova: частково є (`tools/dictindex` imports documents in bounded batches and publishes successful batches transactionally). A separate proposal is to identify temporary representations that can be discarded after a chunk has yielded its admitted observations. Why Mova: bounded batches control work size, while explicit release conditions would also control how much temporary state survives between batches.

Idea: Preserve the task query while selecting evidence. Where: Section 3, patched chunked eviction. Area: information retrieval. Mova: частково є (`world/src/knowledge/retention/fastread.rs` aligns question frames with document frames; mice use attention terms over a shared graph). Mova could compare chunk-local evidence selection with selection conditioned on the actual question throughout reading. Why Mova: the end of a text chunk may be a poor guide to the evidence needed for a later question.

Idea: Separate selection context from admitted document facts. Where: Section 3, discarding the temporary query-token KVs outside the final chunk. Area: knowledge representation. Mova: частково є (`tools/dictindex` keeps source provenance distinct from narrative content, and enrichment treats proposals separately from admitted knowledge). A query attached for relevance scoring should remain marked as task context instead of becoming a fact extracted from the document. Why Mova: this would let task-aware reading use the question repeatedly without contaminating the retained world with assumptions from that question.

Idea: Share underlying state across multiple consumers. Where: Section 3, the grouped-query correction for PyramidKV and SnapKV. Area: storage architecture. Mova: вже є (`world/src/knowledge/retention/mice.rs` runs specialist profiles over a shared parse and retained graph). The paper reinforces the value of checking that specialist-specific views do not accidentally duplicate the complete underlying representation. Why Mova: sharing is useful only if implementation details preserve it when different consumers select different observations.

Idea: Aggregate selection evidence at the level where storage is shared. Where: Section 3, selecting cache entries using attention aggregated within a query group. Area: aggregation. Mova: нове (a proposed audit and aggregation policy for shared observations; an equivalent policy is not established by the digest). Specialists could contribute relevance evidence to a common retained observation instead of independently retaining duplicate copies. Why Mova: this could reconcile specialist preferences with a shared storage budget, although aggregation must not erase a minority specialist’s essential evidence.

Idea: Assign global and local responsibilities explicitly. Where: Section 4, retrieval and streaming head roles. Area: system architecture. Mova: частково є (`docs/architecture.md` separates compiled global knowledge, domain modules, and current context). Mova could investigate which reader operations require complete document access and which can work from bounded recent or selected state. Why Mova: explicit access requirements could reduce repeated scanning without pretending that all inference needs the same amount of context.

Idea: Optimize through the final task instead of an internal resemblance measure. Where: Section 4, next-token prediction in place of hidden-state reconstruction. Area: evaluation and learning. Mova: частково є (school controls, held-out self-play, and paired assessment already evaluate downstream behavior). For a proposed compressed graph or evidence selector, the decisive check should be whether readers still answer correctly with adequate justification. Why Mova: preserving graph shape or increasing frame counts does not establish that useful meaning survived.

Idea: Test the gap between soft scores and discrete admission. Where: Section 4 and Appendix B, hard-concrete masks and final head selection. Area: statistics and decision rules. Mova: частково є (`prag/src/eval.rs` evaluates confidence against correctness; admission gates make discrete decisions). Mova could test whether score-based proposals remain reliable after thresholding or ranking selects a bounded set. Why Mova: a well-behaved continuous score can still yield a poor admitted subset, especially near the selection boundary.

Idea: Treat the resource target as part of training and validation. Where: Section 5.3 and Figure 5. Area: optimization. Mova: нове (a proposed budget-conditioned training comparison, with application status unknown). When learning reader parameters or evidence rankings, Mova could compare configurations trained for the intended retained-state budget against configurations compressed only afterwards. Why Mova: the paper shows that selecting the deployment budget after learning can miss the behavior of a system trained to operate under that constraint.

Idea: Introduce a restriction gradually. Where: Appendix B, target-sparsity warmup. Area: optimization. Mova: нове (a proposal for bounded statistical components, instead of a change to hard correctness rules). A reader trained with progressively tighter evidence budgets could be compared with one exposed immediately to the final restriction. Why Mova: gradual restriction may preserve useful behavior while the ranking parameters adapt, but its value for Mova remains unverified.

Idea: Train or tune on varied natural workloads. Where: Section 4 and Table 3. Area: data. Mova: частково є (the teacher loop and corpus tools work with several text sources, while `tools/sources` records source identity and rights). Mova could test evidence-selection policies on varied admitted texts rather than only artificial retrieval exercises. Why Mova: exact lookup tasks do not cover every dependency needed for explanation, state tracking, or multi-step reading.

Idea: Preserve the larger system while adapting a small control mechanism. Where: Section 5.3, freezing ordinary weights during head-role learning. Area: modular adaptation. Mova: частково є (compiled rules and parameters change through separate tested paths, and enrichment stages drafts before admission). A proposed optimization could adjust a bounded reader policy while holding parsing and knowledge interpretation fixed. Why Mova: a narrow experiment makes regressions easier to attribute and reduces the chance that resource optimization changes unrelated linguistic behavior.

Idea: Use simple retrieval as an independent stress test. Where: Section 5.2, recall analysis. Area: evaluation. Mova: частково є (`world babi` and fast-reader answer analyses test recovery from represented text). A dedicated retrieval check could accompany more complex reasoning evaluations whenever context is compressed. Why Mova: failure to recover an explicit fact should be distinguished from failure to reason correctly after retrieving it.

Idea: Evaluate resource policies across different task families. Where: Sections 5.1 and 5.2. Area: evaluation design. Mova: вже є (the documented assessments cover school courses, word problems, story reading, and spatial tasks). A proposed extension would compare the same memory or selection policy across those families under matched conditions. Why Mova: a policy that preserves dictionary lookup or simple story recall may still damage long explanations or quantitative state tracking.

Idea: Include long-result workloads in efficiency evaluation. Where: Section 5.1 and Table 4, LongProc. Area: workload design. Mova: частково є (operational workflows can retain intermediate results and recursively call capabilities through bounded interfaces). Mova could measure tasks that produce extended traces or many derived observations alongside tasks with long inputs and short answers. Why Mova: storage pressure can arise from accumulated output and intermediate reasoning as well as from the original document.

Idea: Treat chunk size as a semantic condition. Where: Section 5.2 and Figure 4. Area: robustness. Mova: нове (a proposed boundary-sensitivity evaluation for readers and import paths). The same text and questions could be processed with different chunk boundaries and batch sizes, then compared for answers and evidence. Why Mova: an implementation setting that appears to concern memory alone can change which relationships remain available to the reader.

Idea: Match training conditions to inference conditions. Where: Section 5.4 and Figure 6. Area: distribution shift. Mova: частково є (`tools/enrich` checks source fingerprints, and fast reading distinguishes fresh-text reading from prepared-graph reading). Mova could explicitly vary whether tuning and deployment use the same representation, chunking, and specialist access policy. Why Mova: a learned strategy may depend on an observation regime that disappears when the operational configuration changes.

Idea: Maintain a quality-resource frontier instead of selecting one universal setting. Where: Section 5.2 and Figure 4. Area: optimization and reporting. Mova: частково є (`tools/twin` records predicted and observed costs, and groupants describe declared domains and checks). Mova could retain several non-dominated reader configurations for different resource limits. Why Mova: the cheapest admissible setting may depend on the task and required quality, so one default should not conceal useful alternatives.

Idea: Keep peak occupancy separate from accumulated occupancy. Where: Appendix A. Area: resource measurement. Mova: частково є (`tools/jobs` has memory and time limits). Mova could report both the largest resident state and an aggregate lifetime measure. Why Mova: a short-lived peak may prevent a task from running at all, while a moderate allocation retained for a long workflow creates a different operational cost.

Idea: Measure implementation performance alongside an abstract cost model. Where: Appendix F. Area: benchmarking. Mova: вже є (`tools/twin` separates prospective cost predictions from measured runs, and GPU stages have explicit exactness or approximation boundaries). A future graph-compaction experiment should similarly report abstract retained-state counts together with actual memory and timing. Why Mova: a theoretically smaller state can still perform poorly because decoding, indexing, or synchronization dominates runtime.

Idea: Isolate modifications with a small factorial comparison. Where: Appendix F, the separate C and P variants. Area: experimental design. Mova: вже є (the documented French work includes ablations, negative controls, and combined-change evaluation). A storage-sharing change and an evidence-selection change should be tested separately and together. Why Mova: this identifies which modification saves resources, which preserves quality, and whether their interaction matters.

Idea: Preserve failed configurations in the comparison. Where: Section 5.2, Travel Planning. Area: evaluation integrity. Mova: вже є (self-play journals retain unsuccessful experiments, and unsupported operational requests keep explicit failures). Resource-saving proposals should remain rejected when they cross the agreed quality boundary, even if their memory figures look attractive. Why Mova: a clear unsuccessful case is useful evidence about the scope of a method.

Idea: Report the approximation introduced by a search over settings. Where: Table 2, linear interpolation between measured configurations. Area: statistics. Mova: нове (a proposed reporting rule for estimated budget thresholds). If Mova estimates a critical resource level between tested settings, the report should distinguish the estimate from an executed configuration. Why Mova: a numerical threshold can appear more exact than the experimental grid supports.

Idea: Separate recoverable storage compression from irreversible evidence deletion. Where: Sections 2.1 and 2.2, eviction and orthogonal compression methods. Area: storage semantics. Mova: вже є (`pack` provides byte-exact storage compression and verified repacking). Any future reader-state eviction should be described separately from `pack` compression because the former removes access to information while the latter preserves recoverable bytes. Why Mova: the two mechanisms need different checks and support different claims about retained knowledge.

Idea: Consider adaptive retention as a separate future mechanism. Where: the limitations and future-work discussion. Area: context policy. Mova: нове (a proposal for task-dependent observation retention, with implementation and benefit unknown). Explicit rules could retain additional state when a question requires distant entities or unresolved dependencies, instead of imposing one fixed local window everywhere. Why Mova: this fits Mova’s preference for inspectable rules, but would require evidence that the retention triggers identify genuine needs.

### The problem and its context

#### Why the cache becomes a bottleneck

The paper concerns a particular cost of long-context [language models](https://md.research.elamur.ai/free/en/concepts/language-model/). When a Transformer generates a continuation, its attention layers use representations of earlier tokens. Keys help determine which earlier positions are relevant; values supply the information combined into the current representation. Keeping those keys and values avoids recreating the entire previous computation at every generated token.

This cache is useful precisely because generation repeatedly returns to the past. The difficulty is that retaining more past text requires more cache memory. The paper illustrates the scale with Llama-3-70B: a 128K-token prompt would require 42GB for its KV cache. This is a cache requirement, instead of a statement about the total memory needed to serve the system. The authors use it to show why supporting a long context window does not automatically make that window economical.

Long inputs are only part of the problem. The introduction points to extended reasoning outputs, citing [DeepSeek-R1](https://md.research.elamur.ai/free/en/papers/deepseek-ai-2025-deepseek-r1-incentivizing-reasoning-capability/), as an example of workloads with lengthy generated sequences. A cache policy optimized for reading a document followed by a brief answer may behave differently when generation itself continues for a long time.

The authors consequently distinguish two stages. Prefilling processes the input and constructs the state needed to begin generation. Decoding then produces successive output tokens while consulting and extending that state. Some efficiency methods concentrate on the first stage, while others reduce costs mainly in the second. Comparing their reported sparsity without considering this distinction can give a misleading impression of how much memory they save.

#### Why sparse attention is not necessarily a smaller cache

An attention mechanism can avoid reading many cache entries while leaving those entries allocated. This distinction separates computational sparsity from eviction. Dynamic sparsity methods choose which blocks to consult for the current operation. The paper describes a hierarchy in which relevant blocks move from high-bandwidth memory into on-chip memory for computation. Avoiding unnecessary transfers can improve execution, but it does not imply that the unselected blocks disappear from the larger memory.

Prefill-specific sparsity has a related limitation. It can accelerate input processing without establishing a smaller persistent cache or reducing the burden of subsequent generation. The authors therefore treat these methods as complementary to their own focus. They are not dismissed as ineffective; they optimize a different part of the resource problem.

The paper makes a similar distinction for quantization. Reducing numerical precision changes how much space each stored item occupies. Eviction changes which items remain stored at all. The discussion includes quantization work such as [GPTQ](https://md.research.elamur.ai/free/en/papers/frantar-2022-gptq-accurate-post-training-quantization/) among approaches that could be combined with cache eviction. Its results do not test every such combination.

Architectural changes are another separate direction. [Grouped-query attention](https://md.research.elamur.ai/free/en/papers/ainslie-2023-gqa-training-generalized-multi-query/) shares KV information across queries, while other designs share state across layers or reduce its dimensionality. The paper cites [DeepSeek-V2](https://md.research.elamur.ai/free/en/papers/deepseek-2024-ai-deepseek-v2-strong-economical-efficient/) in its discussion of dimensionality reduction and [Gemma 3](https://md.research.elamur.ai/free/en/papers/gemma-2025-team-gemma-3-technical-report/) among systems using a mixture of local and global attention. These establish the surrounding design space; the experiments concentrate on eviction applied to an existing long-context system.

#### The two eviction families

Recency eviction keeps a limited recent window, usually with a small preserved set of initial positions called attention sinks. Its attraction is straightforward: once an old entry falls outside the retained region, future operations do not require it and its memory can be released. The cache of a local head can therefore remain bounded as the sequence grows.

The weakness is equally direct. A distant fact may become relevant again. StreamingLLM supplies the local-attention pattern discussed by the paper, while DuoAttention and MoA preserve global access for selected heads. The question changes from whether all distant entries are dispensable to which components need them.

Post-fill eviction takes a different route. It first processes the prompt with its full cache, then scores entries and removes those judged less useful for generation. SnapKV and PyramidKV belong to this family in the paper’s classification. Their decisions can depend on the particular prompt, but the timing matters: the cache has already reached its full input-stage size before pruning occurs.

This is especially consequential for a long prompt followed by a short answer. Most of the sequence may already have been processed before the first eviction. A small final cache then describes only a limited portion of the overall workload. The paper’s framework is designed to make that earlier retention visible.

#### Why chunked input processing changes the comparison

Long prompts need not be handled in one monolithic forward pass. Chunked prefilling divides the input into smaller pieces. The paper notes that this can reduce temporary memory requirements and allow shorter requests to make progress alongside parts of longer requests. It gives [SGLang](https://md.research.elamur.ai/free/en/papers/zheng-2023-sglang-efficient-execution-structured-language/) as an example of a framework using chunked input processing.

Chunking creates opportunities to discard state before the complete prompt has been consumed. It also exposes a methodological problem: a method evaluated only with one large prefill may have a different memory profile when adapted to incremental processing. Conversely, an adaptation can alter quality if its eviction decisions use information that differs from the original method’s scoring context.

The authors want one framework that accommodates these possibilities without confusing stored state, consulted state, and the moment of deletion. Their answer is to track retained entries throughout the sequence and ask how far each method can reduce that quantity before crossing a visible quality boundary.

### The method, step by step

#### Start with what remains in memory

The paper begins from an input sequence and the continuation generated from it. Each attention head produces key and value vectors for token positions. These vectors have a head-specific dimensionality, and their accumulated storage forms the KV cache.

The important accounting distinction is whether an entry can still be needed. An active entry participates in the current attention operation. An inactive entry remains stored but is not used in that operation. An evicted entry has been removed because the method will not use it later. Both active and inactive entries count towards the footprint.

The normalized footprint can be written from the paper’s definition as follows:

```
KV footprint = retained-entry count aggregated over query positions / corresponding count under full causal attention
```

“Retained-entry count” includes entries that are currently active and entries that are currently inactive. “Query positions” supply the paper’s idealized progression through the sequence. The denominator uses the same workload with ordinary causal attention. The resulting fraction expresses the method’s retained-state burden relative to that reference.

This is an abstraction of memory use over the inference process. It does not assign a measured wall-clock duration to each operation. That distinction becomes important when interpreting throughput. A query position is an accounting step, while actual execution time also depends on implementation and hardware behavior.

Figure 1 illustrates the calculation with a footprint of 26/36 = 72.2%. The point of the example is the accounting rule: entries count for as long as they remain retained. A method benefits by making an irrevocable deletion earlier, provided that the deletion does not undermine the required task performance.

#### Turn the footprint into a constrained comparison

A small footprint alone is not enough. A method could achieve extreme deletion by keeping almost nothing and answering poorly. The paper therefore compares methods through the smallest footprint that still satisfies its performance requirement.

```
Critical KV footprint = smallest evaluated or interpolated footprint retaining at least F of the full-attention score
```

Here, F is the retained fraction of the reference performance. The paper uses F = 90%. The full-attention score is measured on the same task as the compressed configuration. “Critical” therefore refers to a task-specific boundary, instead of a universal property of the method.

The experiments sweep settings that produce different footprints and scores. Because the evaluation is expensive, the reported critical values use linear interpolation between measured points. An interpolated crossing identifies an estimated boundary in the observed tradeoff curve. It should not be confused with a separately executed configuration at precisely that crossing.

The methodological choice is useful because it fixes the question asked of every method. A comparison no longer depends solely on whether one method happens to score slightly better at an arbitrary sparsity. It asks which method preserves the required quality with the least retained state.

#### Adapt post-fill pruning to incremental input

SnapKV and PyramidKV estimate cache importance from attention received from the prompt’s final tokens. In the setting used here, the scoring region contains the last 64 input tokens. The methods smooth the attention signal with a moving average before retaining the entries with the strongest scores.

Their allocation policies differ. SnapKV gives layers equal cache budgets. PyramidKV assigns smaller budgets to later layers. The paper concentrates on PyramidKV in its main comparison because it generally performs better, while also reporting SnapKV results.

Naive chunked eviction applies the same general scoring procedure after each input chunk. The method uses that chunk’s final scoring tokens and removes entries before continuing. This saves memory earlier than conventional post-fill pruning, but it changes the meaning of the importance estimate.

Suppose the final question appears near the end of the prompt. An earlier chunk may finish with background material that has little connection to that question. Scoring from the chunk ending can then preserve information useful for the local text while removing information required by the actual task. The paper’s patched procedure addresses this mismatch.

Patched chunked eviction appends the prompt’s final query tokens to each intermediate chunk during its forward computation. Those temporary tokens provide the importance signal. Their KV entries are discarded after intermediate processing; they become ordinary retained input only when the final chunk is reached.

From a long prompt to an evaluated eviction policy The steps in order.

The patch changes which information guides selection, not merely how frequently selection occurs. Its additional computation is the processing of the attached query context. Its intended benefit is that intermediate decisions remain oriented toward the task that will follow the prompt.

#### Preserve grouped-query sharing

The authors identify a separate implementation issue in applying SnapKV and PyramidKV to grouped-query attention. Different query heads can prefer different cache entries. Selecting independent retained sets for each query head can replicate KV storage that the architecture was designed to share.

The correction chooses one retained set for each query group using attention aggregated across that group’s queries. This aligns the selection unit with the storage-sharing unit. For Llama-3, the paper’s small-scale experiments show that the correction boosts performance and cuts memory usage to one-eighth of its previous level.1-8B-Instruct.

This result should be interpreted at the stated scope. It concerns the avoidance of KV replication in that implementation setting. It is not a claim that every complete inference workload becomes 8x smaller or faster. The hardware appendix later examines the actual memory and throughput effects separately.

#### Learn which heads require global access

PruLong addresses recency eviction rather than importance-based deletion after each chunk. Like DuoAttention, it gives heads a choice between full attention and streaming attention. During learning, a gate controls the mixture.

```
Attnᵢⱼ(Q, K, V) = zᵢⱼ · Attnfull(Q, K, V) + (1 − zᵢⱼ) · Attnstreaming(Q, K, V)
```

The index i identifies a layer, and j identifies an attention head within that layer. Q, K, and V denote queries, keys, and values. Attnfull can access the full permitted causal history. Attnstreaming uses the retained local window and attention sinks. The gate zᵢⱼ determines which behavior contributes: a value of 1 selects full attention, while 0 selects streaming attention.

DuoAttention learns continuous gates by matching final hidden representations to those of the original system. It also applies a sparsity penalty and later converts the learned gate ranking into discrete assignments. Its training examples are synthetic retrieval tasks.

PruLong changes the objective, the treatment of the gates, and the training distribution. Its main objective is next-token prediction on natural long-context text. The gates are modeled as discrete random choices during the formulation, with a differentiable relaxation used for optimization. A target-sparsity constraint encourages the required proportion of streaming heads.

The paper expresses the combined objective through an expected prediction term and a Lagrangian penalty:

```
maxλ₁,λ₂ minπ Eₓ∼D,z∼Bern(π) [(1/N) Σₙ₌₀ᴺ⁻¹ log pθ(xₙ₊₁ | x:ₙ; z) + λ₁(s(π) − t) + λ₂(s(π) − t)²]
```

D is the training corpus, and x is a sampled sequence of length N. The conditional probability pθ describes the next token given its preceding context and the attention assignments z. The ordinary parameters are represented by θ. Each gate is drawn from a Bernoulli distribution controlled by π. The function s measures mask sparsity, and t is the desired sparsity. The trainable multipliers λ₁ and λ₂ enforce that target through linear and squared deviation terms.

There is a notation issue worth separating from the mechanism. The displayed objective contains a log-probability term, while the accompanying explanation describes minimizing next-token prediction loss. The substantive account is that predictive quality and a target-sparsity constraint jointly determine the gates. Reading the displayed sign convention as an independent claim about maximizing prediction error would contradict that explanation.

#### Make discrete choices trainable

A binary choice is difficult to optimize directly with ordinary gradient descent. PruLong uses the hard-concrete approach from pruning research. It begins with sampled uniform noise:

```
u ∼ Uniform(0, 1)
```

The symbol u is a random draw used to generate a relaxed gate. The paper truncates the sampling interval in practice so that logarithms do not encounter its endpoints.

The noise and a learned parameter then produce a smooth gate:

```
g = σ((log(u / (1 − u)) + log α) / τ)
```

The function σ is the sigmoid, which maps its input into the interval between 0 and 1. The learned quantity log α controls the preference for keeping a head global. The temperature τ controls the sharpness of the relaxation. This construction connects the method to [Gumbel-Softmax reparameterization](https://md.research.elamur.ai/free/en/papers/jang-2016-categorical-reparameterization-gumbel-softmax/) and the [Concrete distribution](https://md.research.elamur.ai/free/en/papers/maddison-2016-concrete-distribution-continuous-relaxation-discrete/).

The smooth sample is stretched:

```
g̃ = l + g · (r − l)
```

The lower endpoint is l, and the upper endpoint is r. The paper uses the interval [−0.1, 1]. Stretching places some relaxed samples outside the ordinary gate interval.

The result is clipped:

```
z̃ = min(1, max(0, g̃))
```

The variable z̃ is the resulting hard-concrete gate. Values below the lower boundary become 0, while values above the upper boundary become 1. This gives the distribution actual probability mass at discrete gate values while retaining a differentiable path through its continuous portion.

The underlying Bernoulli preference is expressed as:

```
πᵢⱼ = σ(log αᵢⱼ)
```

The parameter πᵢⱼ is the probability associated with the global-attention choice for the corresponding head in the Bernoulli formulation. The subscripts again identify its layer and head.

Sparsity is the expected proportion of gates that do not remain active:

```
s = 1 − (1 / LH) Σᵢⱼ P(zᵢⱼ > 0)
```

L is the number of layers, H is the number of heads per layer, and the sum runs over those head positions. The probability term measures whether a gate remains non-zero. The appendix explains that the hard-concrete distribution makes this quantity available in closed form, allowing the sparsity constraint to be optimized.

During training, the target rises gradually from the unrestricted starting configuration towards the desired final sparsity. At completion, the learned gate parameters are ranked. The chosen highest-ranked heads receive full attention, while the remaining heads become streaming heads. A different cutoff can produce another sparsity, although the paper finds that quality is generally strongest near the target used during training.

#### Use natural long-context data without changing ordinary weights

The default training material comes from the long-context pretraining mixture described by Gao and colleagues. It contains a 40% : 60% mixture of short and long data. For this study, long documents are adjusted to the supported context size by truncating the 512K material to 128K and replacing the long mixture’s 64K documents accordingly.

This is training for head-role assignment, not ordinary continued pretraining of all parameters. The main configuration freezes the regular weights. The authors explain that updating them could damage instruction-following behavior. They separately explore unfrozen weights in the training-stage analysis.

The reported PruLong configuration uses a token batch size of 1,048,576, a sequence length of 131,072, and 1,000 training steps. The sparsity warmup lasts 800 steps. Its local window contains 1,024 tokens, with 128 sink tokens. These settings describe how the learned restriction is introduced and what streaming attention can retain.

The authors release the PruLong code and associated artifacts. Their contribution includes both the learned method and the implementations needed to examine chunked eviction under the same broader accounting framework.

### Experiments and results

#### What is evaluated

The main experiments use Llama-3.1-8B-Instruct, from the [Llama 3 family](https://md.research.elamur.ai/free/en/papers/grattafiori-2024-llama-3-herd-models/). HELMET supplies tasks with long inputs and relatively short responses. LongProc adds workloads requiring extended generated outputs. The selection emphasizes settings where the reference system has meaningful ability, so compression is tested against something more informative than an already unsuccessful baseline.

Recall evaluates whether explicit information can be recovered from a long context. Its datasets include JSON key-value retrieval and RULER variants involving numerical needles, UUIDs, or several values associated with a key. The metric is substring exact match, abbreviated SubEM. These tasks are useful because failure is less entangled with complex interpretation after retrieval.

[Retrieval-augmented generation](https://md.research.elamur.ai/free/en/concepts/retrieval-augmented-generation/) evaluates answering with retrieved material amid substantial context. The category includes [Natural Questions](https://md.research.elamur.ai/free/en/papers/kwiatkowski-2019-natural-questions-benchmark-question-answering/), [TriviaQA](https://md.research.elamur.ai/free/en/papers/joshi-2017-triviaqa-large-scale-distantly-supervised/), PopQA, and [HotpotQA](https://md.research.elamur.ai/free/en/papers/yang-2018-hotpotqa-dataset-diverse-explainable-multi/). These datasets cover different question distributions, including long-tail entities and multi-hop questions. The reported metric is again SubEM.

Reranking uses [MS MARCO](https://md.research.elamur.ai/free/en/papers/bajaj-2016-ms-marco-human-generated/) and NDCG@10, which evaluates the ordering of retrieved passages. Many-shot in-context learning tests classification from a large collection of examples in the prompt. Its datasets include question classification and intent classification. These tasks examine whether retained context supports a mapping learned from demonstrations, rather than simply preserving an isolated fact.

Long-document question answering includes [NarrativeQA](https://md.research.elamur.ai/free/en/papers/kocisky-2018-narrativeqa-reading-comprehension-challenge/) and a novel-based task from ∞Bench. Summarization uses novel and legal-document material. Their evaluation includes reference-based model judgments and ROUGE F1 where specified. These categories require interpreting extended content, so their scores reflect more than exact retrieval.

LongProc contributes HTML-to-TSV extraction and Travel Planning. HTML-to-TSV measures row-level F1 while requiring structured output. Travel Planning evaluates whether generated itineraries satisfy the task. The paper uses the 6K→3K setting for that task. HTML-to-TSV includes an output setting of 10K tokens, making it relevant to cache growth during generation.

The dataset inventory also makes clear that context settings are not identical to exact realized lengths. For example, the RAG entries include average input lengths of 121K and 113K. A context-window label describes the evaluation regime, while the inventory records the actual average token counts for each dataset.

#### How the configurations are compared

DuoAttention and PruLong are evaluated across head sparsities from 10% to 90%. Their streaming configuration keeps a local window of 1024 tokens and 128 sinks. PyramidKV’s eviction fraction is varied over a corresponding range, with 64 tokens supplying the importance signal. The default prefill chunk size is 32K.

The main tradeoff plots place task performance against KV footprint. A reference line gives the full-attention score, and another marks the 90% retention requirement. This presentation allows a method to have a good curve in one region and a poor curve elsewhere. It avoids reducing the whole comparison to one arbitrary compression setting.

MoA is discussed as relevant prior work but is not included in the executed comparison. The authors report that its training did not scale to the long sequences needed here. This matters when interpreting the scope of the baseline set: the paper compares important feasible candidates, rather than every proposed method under an identical implementation.

#### Recall favors learned head specialization

Recall is the clearest strength of PruLong. The main analysis reports that its critical KV footprint is roughly 12 points lower than DuoAttention’s. This is a reduction in the footprint needed to preserve the chosen fraction of reference quality. It is not a claim that every recall score improves by that amount.

A controlled training comparison gives a more concrete picture of the quality gap. The following scores come from Table 3, where compressed configurations use 70% streaming heads and 8K chunked prefilling. “Pretraining mix” denotes the natural long-context data used by PruLong.

Recall score under alternative head-training settings PruLong trained on natural long text preserves recall much better than the compared compressed configurations.

**The numbers**

| System or setting | Recall score |
| --- | --- |
| Full-attention reference | 95.2 |
| DuoAttention, BookSum Passkey | 49.2 |
| DuoAttention, pretraining mix | 38.6 |
| DuoAttention, pretraining mix with extended training | 39.3 |
| PruLong, pretraining mix (this paper) | 91.4 |
| PruLong, BookSum Passkey | 65.2 |
| PruLong, Context Synthesis | 21.6 |

The chart should not be interpreted as an isolated test of data alone. It includes methods with different objectives and gate-learning procedures. Its value is that it shows the interaction: natural long text helps substantially when used with PruLong’s formulation, while substituting that data into DuoAttention does not reproduce the improvement.

The authors regard recall as a useful warning signal for heuristic eviction. If a method loses explicit information under a demanding retrieval probe, strong performance on another category does not establish that its compressed context remains broadly reliable. The paper does not claim that recall alone is a complete measure of long-context competence.

#### Other categories prefer different policies

PruLong also attains the smallest critical footprint on reranking and HTML-to-TSV in the main comparison. It improves on DuoAttention across the evaluated categories except Travel Planning. These results show that learned head specialization is useful beyond synthetic lookup, but they do not make it the best choice everywhere.

Patched PyramidKV is strongest on several categories where prompt-conditioned selection is particularly effective. The authors identify ICL, RAG, long-document question answering, and summarization as categories where the patch allows it to achieve the leading critical footprint. Its ability to score entries using the task’s final query context matters substantially.

The resulting division is informative. A fixed head-role assignment can preserve broad retrieval capacity without reselecting entries from each prompt. Prompt-conditioned eviction can instead concentrate storage on the particular material a request appears to need. Neither advantage eliminates the other method’s failure modes.

Travel Planning remains a difficult negative result. The authors report that none of the methods yields a meaningful footprint reduction while meeting their performance requirement on this reasoning-heavy task. A configuration can still produce some correct itineraries at a low footprint, but that does not mean it preserves enough of the original system’s capability.

#### What actual memory measurements show

The hardware appendix uses fixed comparison settings. DuoAttention and PruLong have 70% streaming heads. PyramidKV and SnapKV receive a cache allowance of 30% of the context window. These settings do not produce perfectly identical KV footprints, so the hardware comparison should not be mistaken for a precisely matched-footprint experiment.

For the recall workload, the following chart shows peak GPU memory. The PyramidKV and SnapKV entries include both the query-group sharing correction, labeled C in the paper, and patched eviction, labeled P.

Peak GPU memory on Recall at the hardware-comparison settings Learned head specialization uses less peak memory than the corrected importance-based eviction variants in this comparison.

**The numbers**

| System or setting | GiB |
| --- | --- |
| DuoAttention | 26.6 |
| PruLong (this paper) | 26.3 |
| PyramidKV with P and C | 33.7 |
| SnapKV with P and C | 33.7 |

The appendix generally finds that DuoAttention and PruLong have the strongest throughput and lowest peak memory among the compared implementations. It also finds that avoiding KV replication typically lowers peak memory for PyramidKV and SnapKV by around 25%, although throughput can decline slightly.

Quality remains necessary to interpret those resource figures. In the HTML-to-TSV hardware comparison, methods with similar or reduced memory can have very different extraction scores. The following values use the appendix’s fixed settings instead of the critical-footprint crossings.

HTML-to-TSV row F1 at the hardware-comparison settings PruLong retains substantially more structured-extraction quality than the compared alternatives at these settings.

**The numbers**

| System or setting | Row F1 score |
| --- | --- |
| DuoAttention | 18.24 |
| PruLong (this paper) | 30.47 |
| PyramidKV with P and C | 2.14 |
| SnapKV with P and C | 1.62 |

This result illustrates why memory numbers cannot stand alone. A very small retained cache is not useful if it destroys the application’s output. It also explains the value of task-specific tradeoff curves: an importance-based method can be competitive on RAG yet unsuitable for a long structured-generation workload at the same nominal cache allowance.

### What the ablations show

#### The task query matters during intermediate eviction

The naive and patched versions of chunked eviction isolate the effect of the scoring context. Both can remove entries during prefilling. The difference is whether they use the current chunk’s ending or the prompt’s final query tokens to estimate importance.

Patched selection is usually better at a comparable footprint. In the recall comparison, the paper reports a 30% reduction in critical footprint relative to naive eviction. The patch also helps PyramidKV become the leading method in several non-recall categories.

This does not prove that the final prompt tokens always contain a perfect description of future relevance. It shows that retaining the original methods’ intended scoring context is important when moving their decisions earlier. The generalization is about preserving a decision’s information requirements during an implementation change.

#### Data and objective work together

Table 3 compares training distributions for both PruLong and DuoAttention. DuoAttention’s default BookSum Passkey training is synthetic and retrieval-oriented. PruLong’s default uses natural long-context pretraining material. Both methods are also tested with alternatives.

The natural mixture does not automatically improve DuoAttention. Extending that training by 4x does not close the gap. PruLong, in contrast, works best with the pretraining mixture among its tested data choices. Its BookSum Passkey and Context Synthesis variants are weaker.

This comparison supports the combined design rather than a simple slogan that natural data is always better. The learning objective must extract useful supervision from the distribution. Representation reconstruction on noisy natural text and direct predictive optimization need not identify the same head roles.

The category-level results also show that data choice can affect capabilities differently. In Table 3, PruLong with the pretraining mixture obtains 61.1 on RAG and 30.2 on HTML, while its BookSum Passkey variant obtains 55.3 and 16.9 respectively. These are scores at the fixed comparison setting, not estimates of critical footprint.

DuoAttention’s extended natural-data training is stronger than its default on Travel in that table, yet weaker on several other categories. This variation is another reason to avoid describing one training distribution as universally superior without specifying the objective and task.

#### Training for the intended sparsity helps

Figure 5 holds evaluation sparsity at 70% and varies the target used while learning the gates. This asks whether a ranking learned under one resource constraint transfers cleanly to another.

The answer is qualified. PruLong remains stronger than DuoAttention at other training sparsities, but matching the training target to the evaluated target frequently gives the best performance. A gate ranking is therefore not entirely independent of how aggressively the system is asked to prune during learning.

The mechanism is plausible within the paper’s formulation. Heads are selected jointly through their effect on prediction and the sparsity penalty. When the target changes, the remaining global heads may need to support a different division of labor. Choosing a new final cutoff cannot necessarily recreate the assignments learned under that constraint.

The experiment does not establish that every deployment sparsity requires entirely separate training. It shows that arbitrary post-training threshold changes can carry a quality cost, so the training target belongs among the conditions reported with a result.

#### Smaller prefill chunks create a real trade-off

Reducing chunk size creates more opportunities to evict entries earlier. This can lower the footprint even if the retained-head assignment or eviction fraction remains unchanged. It also changes the information available during each forward pass.

In the main chunk-size analysis, moving from 32K to 8K can reduce performance by up to 20% for DuoAttention and PruLong. The authors find the learned recency methods more sensitive than patched chunked eviction in that analysis. Nevertheless, smaller chunks can lie on the preferred quality-footprint frontier because their earlier deletions reduce resource use.

The appendices complicate any broad ranking of robustness. Their peak-memory and expanded comparisons describe stronger deterioration for PyramidKV and SnapKV in several settings, particularly Recall and ICL. These observations should be read with their respective axes and conditions intact. The paper does not support a single statement that one family is always more resistant to chunk-size changes.

The important conclusion survives that variation: chunk size affects quality as well as memory. It is part of the evaluated attention regime, not a neutral serving option that can be changed without checking outcomes.

#### Applying PruLong before instruction tuning

The authors also ask when head specialization should happen. One possibility is to learn roles after instruction tuning, as in the main experiments. Another is to learn them on a base system and preserve the assignments while instruction tuning proceeds.

For this analysis, the authors use ProLong because its long-context training and instruction-tuning recipe are known. The instruction-tuning data for Llama-3.1-8B-Instruct is not public, which prevents an equivalent reconstruction of that entire process.

The study includes an unfrozen variant that updates ordinary weights during PruLong training. This variant performs best on Recall when inference uses a prefill chunk size of 128 tokens, matching the sliding-window block size used in training. Its quality falls as inference chunk size increases.

The authors hypothesize that weight updates allow specialization to the training attention pattern. That can improve results under matching conditions while increasing sensitivity to a changed pattern. The evidence supports this as an interpretation of the observed trend; it is not a complete causal explanation of every chunk-size effect.

The broader finding is that PruLong can be useful before or after instruction tuning, but moving it earlier does not automatically remove the training-inference mismatch. More integrated training still needs evaluation under the actual serving configuration.

#### Instruction-tuning mixtures are a supporting analysis

The paper also explores mixtures of UltraChat and Tulu instruction-tuning data. This analysis helps establish a suitable instruction-tuned reference for the training-stage experiments. It is not the central source of PruLong’s gains in the main Llama comparison.

The appendix reports that combining the mixtures improves several downstream results relative to using one alone in the investigated settings. Some of the largest effects occur on procedural and reasoning tasks. The authors then shift their main attention to the existing instruction-tuned Llama system after finding persistent chunk-size sensitivity.

This distinction matters for attribution. The paper studies both cache-role learning and the conditions needed to evaluate it around instruction tuning. Improvements from an instruction-tuning mixture should not be silently credited to the cache policy.

#### The hardware ablations separate two corrections

Appendix F evaluates query-group aggregation and query patching independently and together. Aggregation addresses duplicated storage. Patching addresses the relevance signal used for eviction. They solve different problems, even though the combined configuration is frequently the best variant within each importance-based family.

The hardware results generally associate aggregation with reduced peak memory. Patching typically improves quality without a substantial change in measured throughput or peak memory. This is useful evidence that the two modifications should not be treated as one indivisible optimization.

The paper also reports noise in real hardware measurements. Memory reclamation, implementation differences, and run-to-run variation can affect the exact values. The abstract footprint measure helps interpret those results, while the measured figures prevent the abstract account from being mistaken for a complete performance prediction.

### Limitations

#### Limits the authors state

The authors explicitly report that no evaluated method is reliable across every task. The strong results on recall and several application categories coexist with the failure to preserve sufficient Travel Planning performance under meaningful cache reduction. Their conclusions support task-dependent choices instead of one recommended eviction policy for all long-context use.

They also acknowledge that the footprint is idealized. It accounts for retained entries along the query dimension, but it does not fully model execution time, temporary tensors, or all other GPU allocations. Its correlation with hardware results is useful evidence, not an identity between footprint and throughput.

The main evaluation concentrates on one system because of computational constraints. The separate ProLong study explores training-stage questions, but it does not provide a broad architecture-scale comparison. The paper therefore cannot establish that the same head assignments, savings, or robustness patterns will transfer unchanged to other systems.

Fixed local windows are another stated limitation. PruLong determines which heads retain global access, but its streaming behavior does not adapt freely to the content of each request. The authors suggest that future pruning methods could make more context-dependent decisions.

#### Limits visible in the experimental setup

The 90% requirement is a declared evaluation choice. It makes comparisons interpretable, but it does not establish that the resulting quality loss is acceptable in every application. A task with strict correctness needs may reject a configuration that passes this threshold, while a different workload might tolerate more degradation.

Critical footprint is also relative to the reference’s existing ability. Preserving most of a baseline score does not establish strong absolute competence. The paper reduces this concern by choosing tasks where the reference has nontrivial performance, but the distinction remains important when interpreting an efficient configuration.

The task categories aggregate different datasets and metrics. Such grouping reveals broad trends but can conceal uneven behavior within a category. A good average RAG result does not prove that every question distribution or evidence pattern survives equally well.

The estimated threshold crossings depend on the measured hyper-parameter grid and linear interpolation. A reported critical point is consequently less direct evidence than an executed configuration with a measured score and footprint. The paper makes this interpolation explicit, and comparisons should preserve that qualification.

The hardware experiments use fixed settings that are not exactly matched in footprint across method families. They help show whether the abstract account has practical relevance, but they do not isolate algorithmic efficiency under perfectly identical resource allocations. Different implementations also have different kernel and memory-management behavior.

The paper does not establish broad results for multi-turn conversation, interleaved tool use, or speculative generation. It discusses why these settings motivate holistic accounting, and it cites [speculative decoding](https://md.research.elamur.ai/free/en/papers/leviathan-2022-fast-inference-transformers-speculative-decoding/) as another reason the prefill-decoding boundary can become less clear. Those motivations should not be mistaken for completed evaluations of every such workload.

Finally, a smaller footprint is not a complete account of information preservation. Evicted state is unavailable to later attention, but task scores reveal only the consequences measured by the selected benchmarks. A policy that passes these tests may still fail on an untested dependency. The paper’s recall probes make this risk more visible; they cannot eliminate it.

#### How far the central claim reaches

The strongest supported claim is comparative and conditional. Under the evaluated workloads, learned head specialization and query-aware chunked eviction can reduce the retained-state burden more effectively than their predecessors while respecting the chosen quality requirement in several task categories.

The paper does not show that most context is generally unnecessary, that local attention can replace global access everywhere, or that all memory costs are represented by the KV footprint. Its results instead identify where specific deletion policies remain useful and where they cease to preserve capability.

This scope is part of the contribution. The work makes it harder to present a favorable final cache size as a complete efficiency result. It also shows why a good compression method must be evaluated through the information it loses, the stage at which it releases memory, and the tasks it still performs.

### What came after

No subsequent citing work is established here, so there is no supported follow-up result to attribute to PruLong or its footprint framework. The earlier methods discussed throughout the paper are its context and baselines, rather than later developments caused by it.

The authors leave a clear research agenda. Context-dependent pruning could replace some fixed retention decisions. More robust training could reduce sensitivity to prefill chunk size. Broader evaluation could test whether the observed tradeoffs survive changes in architecture, workload, and implementation.

A further open question concerns measurement itself. KV footprint separates an algorithm’s retained-state requirements from incidental implementation quality, while hardware measurements describe what a particular system actually delivers. Future work could connect those views more closely without losing the ability to compare methods fairly. The paper’s lasting methodological proposal is to evaluate memory savings across the complete inference process and to accept those savings only when the required task performance remains intact.

## Cite

Cite as Adithya Bhaskar, Alexander Wettig, Tianyu Gao, Yihe Dong and Danqi Chen. 2025. Cache Me If You Can: How Many KVs Do You Need for Effective Long-Context LMs?. arXiv (Cornell University).

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.48550/arxiv.2506.17121](https://doi.org/10.48550/arxiv.2506.17121) · [arXiv 2506.17121](https://arxiv.org/abs/2506.17121)

```bibtex
@misc{adithya2025cache,
  title = {{Cache Me If You Can: How Many KVs Do You Need for Effective Long-Context LMs?}},
  author = {Adithya Bhaskar, Alexander Wettig, Tianyu Gao, Yihe Dong and Danqi Chen},
  year = {2025},
  doi = {10.48550/arxiv.2506.17121},
  eprint = {2506.17121},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2506.17121}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
