arXiv(opens in a new tab)cs.LGSep 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2609.35621

Cartridges++: KV Cache Compression without Off-Context Derailment

Sonia Laguna, Joao Monteiro, Marco Cuturi, Pierre Ablin, Eleonora Gualdoni

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Sonia Laguna, Joao Monteiro, Marco Cuturi, Pierre Ablin, Eleonora Gualdoni

Apple

Serving long documents to a Large Language Model (LLM) repeatedly is expensive: computations grow with context length, and the memory footprint of the key-value (KV) cache balloons. Compressed KV (CKV) representations aim to mimic the cache of a document and are typically computed once and for all, ahead of inference time. Methods to obtain CKVs range from drop mechanisms that reduce their number of columns, to learned approaches. Among the latter, Cartridges have emerged as a leading compression method, learning compact KV representations through distillation on relevant Q/A pairs. While existing evaluations focus primarily on whether Cartridges and other CKVs yield approximately similar responses to document-related, on-context queries, we investigate the crucial deployment question of whether they can handle off-context queries, something the native KV representation is particularly good at, thanks to the mechanics of attention. We observe a fundamental trade-off: while Cartridges perform better for on-context queries, heuristic-variants preserve better the original LLM's ability to operate off-context. We measure this through their capability to avoid context contamination in their response, retain general knowledge, and follow instructions. We propose Cartridges++, simple modifications to Cartridges that retain off-context abilities at small or negligible cost. The router variant decides at inference time whether the query should use the learned long-context memory, while the data-mixing variant allocates a small fraction of training Q/As to queries outside the reference long document. Our study shows that assessing CKVs on document utility alone can mask substantial degradation in broader model capabilities, yet those issues can be fixed with benign changes to CKV inference or training.

Correspondence: SL: slaguna@ethz.ch; JM: jmonteiro2@apple.com; MC: m_cuturi@apple.com; PA: p_ablin@apple.com; EG: e_gualdoni@apple.com.

Note: SL: work done as intern at Apple.

Date: September 29, 2026

1 Introduction

Long-context reuse is expensive. Large language models (LLMs) are increasingly used to reason over persistent, long-form information, including reports, knowledge bases, or medical records (Bai et al., 2024). In these settings, the same context is reused across many queries, creating a need for memory mechanisms that persist this context across queries (Zhang et al., 2023; Xiao et al., 2024; Eyuboglu et al., 2026; Hardalov et al., 2026). Transformers naturally provide such a representation through the key-value (KV) cache, which stores a state for every prefix token at every layer. However, retaining the cache introduces a second cost: its memory footprint grows linearly with context length, and the increasing length of the cache also raises decoding cost, making long contexts expensive both to store and to serve. This motivates compressed KV (CKV) representations: compact versions of the document's KV cache that can be computed once and reused across subsequent queries. CKVs can be constructed through retained-state methods that select or merge existing KV states (Zhang et al., 2023; Xiao et al., 2024; Li et al., 2024; Yang et al., 2024; Kim et al., 2025), or learned methods that optimize compact representations (Zweiger et al., 2026; Eyuboglu et al., 2026; Hardalov et al., 2026). We study reusable, document-specific CKVs for a fixed pretrained LLM: each memory is constructed for one document and reused without knowing future queries. Among learned variants, Cartridges have emerged as a prominent method, optimizing document-specific KV states through distillation on question-answer pairs (Eyuboglu et al., 2026).

Figure

Figure 1 Cartridges preserve context fidelity but disrupt capability; CARTRIDGES++ cancels that degradation. Left: illustrative responses to an on-context query (solid arrows) and an unrelated Saturn question (dashed arrows) handling context with eviction, Cartridges and our method. Right: aggregate context fidelity and capability preservation across long-context datasets (see Appendix E.1 for details). C++DC_{++}^{D} and C++RC_{++}^{R} denote data mixing and routing variants of CARTRIDGES++, AM R^{R} routed Attention Matching. The arrows highlight the gains attributed to our variants: they retain the same context fidelity while upgrading significantly their general capabilities.

Cartridges amplify context interference. Cartridges offer a favorable compression–utility trade-off, preserving document-level performance where retained-state methods degrade. Yet, this notion of utility leaves open a complementary question: at what cost? Recent work shows that answer accuracy alone is insufficient to evaluate eviction methods for KV compression (Liu et al., 2026; Chen et al., 2026; Ai et al., 2026), which can discard semantically important information or disrupt instructions and reasoning in the context. These evaluations, however, remain on context: they concern what compression preserves or loses from the source document itself. They do not test the reality of deployment where future queries need not concern the stored document.

As the interaction with a user slightly veers off-context, we argue that CKVs can be more brittle and run the risk of being influenced by the stored memory when the query does not call for it. For this reason, CKV mechanisms should also be evaluated off-context. The rationale is that the mechanics of attention can efficiently turn off interactions between the native KV caches and queries that are unrelated to the context. We posit (and verify experimentally) that such a property is lost for CKVs, particularly learned ones such as Cartridges. A full long context already induces interference on such queries (Shi et al., 2023; Yoran et al., 2024), and heuristic eviction methods retaining native KV states show a similar, limited degradation. A recent hybrid method, Attention Matching (Zweiger et al., 2026), retains selected native keys while fitting attention biases and new values, and occupies an intermediate regime of off-context degradation. Cartridges, however, sit at the more disruptive end of this spectrum. Despite providing substantially stronger context fidelity, they introduce larger interference, perturbing the model even more than the full, uncompressed context they are meant to approximate. We call the missing requirement capability preservation: when a memory is irrelevant, its presence should not substantially degrade the underlying LLM's behavior relative to operating without the context. Thus, the method that best preserves the utility of the stored document is also the one for which context-external interference becomes a substantial deployment concern. To our knowledge, we are the first to expose this hidden cost of Cartridges, characterizing its failure modes and evaluating mitigations, as illustrated in Figure 1.

Mitigating Cartridge interference. This observation motivates targeting Cartridges directly. We seek to preserve their context fidelity while recovering the benign off-context behavior of the underlying model. We introduce CARTRIDGES++, with two complementary strategies. First, an inference-time relevance router decides whether an already-trained Cartridge should be used. Second, a training-time strategy mixes document-relevant examples with a small fraction of general-purpose ones. Together, these strategies preserve the LLM capabilities when the stored memory is irrelevant and its utility on document-dependent queries. Our contributions are as follows:

● We introduce a two-sided evaluation of reusable, document-specific CKVs that measures not only context fidelity on relevant queries, but also capability preservation on unrelated queries across general knowledge, instruction following, and context contamination during generation.

● We quantify off-context interference in Cartridges: despite their strong on-context fidelity, Cartridges amplify interference off-context.

  • We introduce CARTRIDGES++ to mitigate off-context derailment when Cartridges are loaded. We propose two complementary variants: C++DC_{++}^{D}, which uses data mixing during training, and C++RC_{++}^{R}, which leverages a relevance router at inference. Across four long-context benchmarks, both improve capability preservation while retaining the document-utility gains.

References (1)

  • [...] Observations are evidence, not verdicts