FlexComp: One Model for Every Ratio in Context Compression

arXiv cs.CL Papers

Summary

FlexComp is a method-agnostic framework that decouples compression ratios from training and deployment, allowing a single model to compress LLM context at any ratio using Matryoshka-style training and per-input budget selection for efficient inference.

arXiv:2609.11192v1 Announce Type: new Abstract: Soft context compression condenses a context into a few memory tokens that a frozen LLM consumes in place of the raw text, but existing compressors fix the compression ratio at training and inference: each deployed ratio requires a separately trained model, and the chosen ratio is applied uniformly to all inputs, whose actual needs vary drastically. We propose FlexComp, a method-agnostic framework that decouples the ratio from both training and deployment: Matryoshka-style training samples the memory budget $K$ per instance, turning one model into an any-ratio compressor, and the budget is then chosen per input by: (1) confidence-based cascade routing or (2) a lightweight learned $K$ predictor. Across ICAE, 500xCompressor, and SAC on MRQA, a single FlexComp model matches separately trained fixed-ratio specialists with minimal degradation. Cascade routing preserves over 98% of the mildest ratio's accuracy at up to 266x average compression; the $K$ predictor, in a single compression-decoding pass, reaches 158-236x within 0.7 F1 of the mildest ratio. At serving-scale batch sizes, the $K$ predictor cuts context KV cache by 50% and improves decoding throughput by 47%.
Original Article
View Cached Full Text

Cached at: 09/11/26, 08:25 AM

# FlexComp: One Model for Every Ratio in Context Compression
Source: [https://arxiv.org/html/2609.11192](https://arxiv.org/html/2609.11192)
Kaiyan ZhaoAffiliation:The University of TokyoAffiliation:National Institute of Informatics\{kaiyan1006, miao, tsuruoka\}@logos\.t\.u\-tokyo\.ac\.jp, aizawa@nii\.ac\.jpAkiko AizawaAffiliation:National Institute of Informatics\{kaiyan1006, miao, tsuruoka\}@logos\.t\.u\-tokyo\.ac\.jp, aizawa@nii\.ac\.jpYoshimasa TsuruokaAffiliation:The University of Tokyo

###### Abstract

Soft context compression condenses a context into a few memory tokens that a frozen LLM consumes in place of the raw text, but existing compressors fix the compression ratio at training and inference: each deployed ratio requires a separately trained model, and the chosen ratio is applied uniformly to all inputs, whose actual needs vary drastically\. We proposeFlexComp, a method\-agnostic framework that decouples the ratio from both training and deployment: Matryoshka\-style training samples the memory budgetKKper instance, turning one model into an any\-ratio compressor, and the budget is then chosen per input by: \(1\) confidence\-based cascade routing or \(2\) a lightweight learnedKKpredictor\. Across ICAE, 500xCompressor, and SAC on MRQA, a single FlexComp model matches separately trained fixed\-ratio specialists with minimal degradation\. Cascade routing preserves over 98% of the mildest ratio’s accuracy at up to 266×\\timesaverage compression; theKKpredictor, in a single compression\-decoding pass, reaches 158\-236×\\timeswithin 0\.7 F1111All F1 scores are reported on a 0\-100 scale\.of the mildest ratio\. At serving\-scale batch sizes, the K predictor cuts context KV cache by 50% and improves decoding throughput by 47%\.

## 1Introduction

Large language models \(LLMs\) rarely answer from a question alone: in most applications,*contexts*, such as retrieved passages, tool outputs, documents, or conversation history are needed for generation, besides the prompt\([Lewis et al\., 2020](https://arxiv.org/html/2609.11192#bib.bib5);[Yuan et al\., 2025](https://arxiv.org/html/2609.11192#bib.bib7);[Zhao et al\., 2026](https://arxiv.org/html/2609.11192#bib.bib8)\)\. Serving these context tokens is costly, as they must be prefilled on every query, and their Key\-Value \(KV\) cache occupies memory for the whole generation, often dominating the memory footprint of inference\([Liu et al\., 2025](https://arxiv.org/html/2609.11192#bib.bib9)\)\.*Context compression*offers an attractive remedy: a compressor condenses the context into a small number of soft*memory tokens*, and the LLM can run inference based on the compressed soft tokens instead of the raw context\([Ge et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib1);[Li et al\., 2025](https://arxiv.org/html/2609.11192#bib.bib2);[Zhao et al\., 2025](https://arxiv.org/html/2609.11192#bib.bib3);[Liu et al\., 2026](https://arxiv.org/html/2609.11192#bib.bib4);[Miao et al\., 2026](https://arxiv.org/html/2609.11192#bib.bib26)\)\.

Despite steady progress on compression quality, existing methods share a structural limitation:the compression ratio is fixed at training and inference time\. As illustrated in Figure[1](https://arxiv.org/html/2609.11192#S1.F1)\(top\), supporting multiple operating modes, e\.g\., mild compression for difficult inputs and aggressive compression when memory is scarce, requires training, storing, and serving a separate model for every ratio\. Moreover, whichever ratio is deployed is applied*uniformly*to all inputs, regardless of how much each input actually needs\.

Figure 1:Fixed\-ratio compression vs\. FlexComp\.Top:for existing soft\-token compressors, each deployed compression ratio requires a separately trained model, and the model applies the fixed ratio uniformly to all inputs\.Bottom:FlexComp trains a single model that supports any ratio, and selects the budget per input at inference time, via cascade routing orKKpredictor\.This uniformity is wasteful, because different inputs need very different budgets\. Figure[2](https://arxiv.org/html/2609.11192#S1.F2)shows that for the in\-domain subsets in MRQA\([Fisch et al\., 2019](https://arxiv.org/html/2609.11192#bib.bib6)\), most inputs are already solved with a single memory token \(soft token lengthK=1K=1\)222Following existing work, contexts are segmented into chunks of 510 tokens;K=1K\{=\}1thus means one soft memory token per 510 raw tokens, i\.e\., a compression ratio of 510x\., yet a non\-trivial minority is only solved with far larger budgets\. A fixedKKtherefore loses on both ends: it wastes tokens on the many easy inputs and starves the few hard ones\. Worse, the best fixed choice differs from domain to domain, so no single ratio serves all deployments well\.

Figure 2:The budget each input needs varies drastically\. For each subset, we show the distribution over solvable inputs of the*minimal sufficient budget*: the smallestK∈\{1,10,34\}K\\in\\\{1,10,34\\\}\(number of memory tokens\) at which the SAC Matryoshka model answers correctly\. A large fraction of inputs is already solvable at K=1 \(510x compression\), so any fixed ratio could be suboptimal\.To this end, we proposeFlexComp, a framework that decouples the compression ratio from both training and deployment \(Figure[1](https://arxiv.org/html/2609.11192#S1.F1), bottom\)\. FlexComp has two components\. First, we introduce*Matryoshka\-style training*for context compression, inspired by matryoshka representation learning\([Kusupati et al\., 2022](https://arxiv.org/html/2609.11192#bib.bib10)\)\. Specifically, during training, the soft prompt lengthKKis sampled per instance, so that a*single*model learns to encode the context intoKKmemory tokens for any budget in the supported range\. One model thus replaces an entire family of fixed\-ratio compressors, with no architectural changes to the underlying method\. Second, since the budget is now a free inference\-time variable, we introduce two complementary strategies for choosing it per input:*cascade routing*, which starts from the most aggressive budget and re\-encodes at a larger one only when the decoder is uncertain, and a lightweight*KKpredictor*, which commits to a budget*before*compression and thus answers in a single compression\-decoding pass\. FlexComp is method\-agnostic; we instantiate it on three representative compressors: ICAE\([Ge et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib1)\), 500xCompressor\([Li et al\., 2025](https://arxiv.org/html/2609.11192#bib.bib2)\), and SAC\([Liu et al\., 2026](https://arxiv.org/html/2609.11192#bib.bib4)\)\.

Across in\-domain \(ID\) and out\-of\-domain \(OOD\) question answering tasks on MRQA\([Fisch et al\., 2019](https://arxiv.org/html/2609.11192#bib.bib6)\), a single Matryoshka\-trained model matches separately trained fixed\-ratio specialists at each native ratio \(within 1\.3 F1 in the worst case, and often better on OOD\), cutting the number of trained models fromnnto one\. On top of the same model, adaptive budget selection improves the accuracy\-compression trade\-off over any fixed ratio: cascade routing retains over 98% of the mildest ratio’s accuracy while raising the average compression from 15×\\timesto up to 266×\\times, and theKKpredictor reaches 158–236×\\timesin a single compression\-decoding pass, at a cost of at most 0\.7 F1\. These savings are not merely nominal: at serving\-scale batch sizes, the predictor cuts context KV cache by 50% and improves aggregate decoding throughput by 47% relative to always running at the mildest ratio\.

In summary, our contributions are as follows:

- •We show that Matryoshka training turns a fixed\-ratio context compressor into a single*any\-ratio*compressor, validated on three distinct methods with negligible degradation\.
- •We introduce two per\-input budget\-selection strategies for soft context compression: confidence\-driven cascade routing and theKKpredictor that commits to a budget before compression; for the predictor, we further show these savings translate into gains in KV memory and decoding throughput\.
- •We systematically analyze the accuracy\-compression trade\-off, and find it non\-monotonic at the instance level: on a non\-trivial fraction of inputs, larger budgets preserve surface details that may mislead the decoder, and a single memory token answers correctly where the full budget fails\.

## 2Related Work

Context compression methods fall into two families:*soft*compression, which encodes the context into continuous memory tokens, and*hard*compression, which shortens the prompt in token space by filtering or rewriting the discrete text\. Our work builds on the former\.

#### Soft context compression\.

A growing line of work compresses a context into a small number of continuous memory tokens consumed by a frozen LLM, including gist tokens\([Mu et al\., 2023](https://arxiv.org/html/2609.11192#bib.bib11)\), AutoCompressors\([Chevalier et al\., 2023](https://arxiv.org/html/2609.11192#bib.bib12)\), ICAE\([Ge et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib1)\), 500xCompressor\([Li et al\., 2025](https://arxiv.org/html/2609.11192#bib.bib2)\), EPL\([Zhao et al\., 2025](https://arxiv.org/html/2609.11192#bib.bib3)\)and SAC\([Liu et al\., 2026](https://arxiv.org/html/2609.11192#bib.bib4)\)\. These methods differ in soft token acquisition and supervision signals, but the core idea, representing contexts through soft tokens, remains consistent\. Moreover, they share the same limitation that the compression ratio is uniformly a training\-time constant: each deployed ratio requires its own trained model, and all inputs receive the same budget\. FlexComp targets exactly on this axis and is complementary to all base architectures\.

#### Hard context compression\.

An orthogonal family shortens the prompt in token space, by filtering or summarizing the discrete text, e\.g\., Selective Context\([Li et al\., 2023](https://arxiv.org/html/2609.11192#bib.bib13)\), the LLMLingua series\([Jiang et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib14);[Pan et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib15)\), and RECOMP\([Xu et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib16)\)\. Hard compression preserves interpretability, but achievable ratios are typically modest compared to soft methods\. As with soft compression methods, how much to compress a given input remains an open question, which our budget\-selection strategies are designed to address\.

#### Nested and budget\-conditioned representations\.

Matryoshka representation learning trains embeddings whose prefixes remain valid at multiple dimensionalities\([Kusupati et al\., 2022](https://arxiv.org/html/2609.11192#bib.bib10)\), a principle that can be extended to model widths and other capacity axes\([Devvrit et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib17)\)\. We transfer the one\-model\-many\-budgets principle to context compression, with a structural difference: our budgets are realized by conditioning the encoder on the memory slot count rather than by truncating a fixed representation \(§[3\.2](https://arxiv.org/html/2609.11192#S3.SS2)\)\.

#### Adaptive computation and cascades\.

Allocating inference cost per input has a long history, from early exit\([Miao et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib18)\)to LLM cascades that escalate from cheap to expensive models based on confidence\([Yue et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib19)\)\. Our cascade applies this recipe within a single model, escalating over compression budgets rather than over models, and ourKKpredictor mirrors router\-based approaches that commit to a compute level before execution\([Stripelis et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib20)\)\. Relatedly, KV cache eviction and quantization\([Zhang et al\., 2023](https://arxiv.org/html/2609.11192#bib.bib21);[Li et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib22)\)reduce memory after the full context has been prefilled; soft\-token compression avoids materializing the full\-context cache in the first place\.

## 3Method

Figure 3:Overview of FlexComp\.Left:Matryoshka training in fine\-tuning\. For each instance, a budgetKKis randomly sampled\. The LoRA\-adapted encoder compresses the context intoKKmemory tokens, and the frozen decoder is supervised to generate the answer based on the memory tokens and prompt\.Right:two inference\-time budget\-selection strategies exploiting the resulting freedom\.\(a\)Cascade routing starts at the most aggressive budget and re\-encodes at the next larger one only when the decoder’s confidence falls below the thresholdτ\\tau\.\(b\)TheKKpredictor is a lightweight MLP head that maps budget\-free encoder features to a distribution over𝒦\\mathcal\{K\}and commits to a budget before compression, answering in a single compression\-decoding pass\.Figure[3](https://arxiv.org/html/2609.11192#S3.F3)gives an overview of FlexComp\. We first fix notation and the class of compressors we build on \(§[3\.1](https://arxiv.org/html/2609.11192#S3.SS1)\), then describe Matryoshka training, which converts a fixed\-ratio compressor into a single any\-budget compressor \(§[3\.2](https://arxiv.org/html/2609.11192#S3.SS2)\), and finally two inference\-time strategies for choosing the budget per input: confidence\-based cascade routing \(§[3\.3](https://arxiv.org/html/2609.11192#S3.SS3)\) and a learnedKKpredictor \(§[3\.4](https://arxiv.org/html/2609.11192#S3.SS4)\)\.

### 3\.1Preliminaries: Soft\-Token Context Compression

We first consider an encoder LLMEϕE\_\{\\phi\}, that compresses a contextccofLLtokens intoK≪LK\\ll Lcontinuous*memory tokens*:𝐦1:K=Eϕ\(c;K\)\\mathbf\{m\}\_\{1:K\}=E\_\{\\phi\}\(c;K\), which a frozen decoder LLMDDthen consumes in place ofccto answer a queryqq, i\.e\.,a^=D\(𝐦1:K,q\)\\hat\{a\}=D\(\\mathbf\{m\}\_\{1:K\},q\)\. In practice, the encoderEϕE\_\{\\phi\}is a LoRA\-adapted copy ofDD, that processes the context together withKKtrainable memory tokens\. The decoder consumes the representations of these memory tokens after the encoder as a drop\-in prefix, so the context’s footprint inDD’s KV cache shrinks fromLLtoKKentries\. This formulation covers ICAE\([Ge et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib1)\), 500xCompressor\([Li et al\., 2025](https://arxiv.org/html/2609.11192#bib.bib2)\), and SAC\([Liu et al\., 2026](https://arxiv.org/html/2609.11192#bib.bib4)\), which differ in where the memory tokens are placed and how the encoder is supervised, but share the same interface: the number of memory slotsKKis fixed before training, and the resulting model supports only that budget\. Throughout, we refer toKKas the*budget*; with\|c\|=L\|c\|=L, the corresponding compression ratio isL/KL/K\.

#### Training objectives\.

Existing compressors are trained in two stages, both at a fixedKK\. A*pretraining*stage teaches the encoder to pack generic text into memory tokens: ICAE and 500xCompressor supervise the decoder to regenerate or continually generate the context from𝐦1:K\\mathbf\{m\}\_\{1:K\}\(autoencoding or text continuation objective\), while SAC directly optimizes language modeling conditioned on its semantic anchors\. Abstractly,

ℒPT​\(ϕ\)=𝔼c​\[ℓ⁡\(D⁡\(Eϕ​\(c,K\)\),t⁡\(c\)\)\],\\mathcal\{L\}\_\{\\mathrm\{PT\}\}\(\\phi\)=\\mathbb\{E\}\_\{c\}\\\!\\left\[\\ell\\\!\\left\(D\(E\_\{\\phi\}\(c;K\)\),\\,t\(c\)\\right\)\\right\],\(1\)where the targett⁡\(c\)t\(c\)is the context itself or its continuation\. A subsequent*fine\-tuning*stage adapts the model to downstream use, supervising the answer given the compressed context:

ℒSFT​\(ϕ\)=𝔼\(c,q,a\)​\[ℓ⁡\(D⁡\(Eϕ​\(c,K\),q\),a\)\]\.\\mathcal\{L\}\_\{\\mathrm\{SFT\}\}\(\\phi\)=\\mathbb\{E\}\_\{\(c,q,a\)\}\\\!\\left\[\\ell\\\!\\left\(D\(E\_\{\\phi\}\(c;K\),q\),\\,a\\right\)\\right\]\.\(2\)FlexComp keeps both objectives untouched and changes only howKKis set: Matryoshka sampling \(Eq\.[3](https://arxiv.org/html/2609.11192#S3.E3)\) wrapsℒSFT\\mathcal\{L\}\_\{\\mathrm\{SFT\}\}, while pretraining deliberately remains at a fixed budget, a choice we justify empirically in §[5\.1](https://arxiv.org/html/2609.11192#S5.SS1)\.

### 3\.2Matryoshka Training

FlexComp makes the budget a*conditioning variable*rather than an architectural constant \(Figure[3](https://arxiv.org/html/2609.11192#S3.F3), left\)\. Let𝒦=\{K1<K2<⋯<Kn\}\\mathcal\{K\}=\\\{K\_\{1\}<K\_\{2\}<\\dots<K\_\{n\}\\\}be the set of supported budgets\. During training, for each instance we sample a budgetK∼p⁡\(𝒦\)K\\sim p\(\\mathcal\{K\}\), allocateKKmemory slots, and optimize the same objective as the underlying compressor:

ℒ⁡\(ϕ\)=𝔼\(c,q,a\)​𝔼K∼p⁡\(𝒦\)​\[ℓ⁡\(D⁡\(Eϕ​\(c,K\),q\),a\)\],\\mathcal\{L\}\(\\phi\)=\\mathbb\{E\}\_\{\(c,q,a\)\}\\,\\mathbb\{E\}\_\{K\\sim p\(\\mathcal\{K\}\)\}\\big\[\\ell\\big\(D\(E\_\{\\phi\}\(c;K\),q\),a\\big\)\\big\],\(3\)whereℓ\\ellis the token\-level cross\-entropy of the base method andDDremains frozen\. The single set of weightsϕ\\phiis thus trained to produce, for everyK∈𝒦K\\in\\mathcal\{K\}, a representation*specialized to that budget*: the encoder sees how many slots are available and distributes information accordingly\. We emphasize that, unlike Matryoshka representation learning for embeddings\([Kusupati et al\., 2022](https://arxiv.org/html/2609.11192#bib.bib10)\), the budgets are not realized by truncating a single encoding, asEϕ​\(c,K1\)E\_\{\\phi\}\(c;K\_\{1\}\)is a different forward pass from the firstK1K\_\{1\}tokens ofEϕ​\(c,K2\)E\_\{\\phi\}\(c;K\_\{2\}\), but the training principle is shared: one model, nested budgets, joint supervision\.

Matryoshka training requires no architectural changes to the base compressor and adds no inference\-time overhead relative to a fixed\-ratio model evaluated at the sameKK\. It collapsesnntraining runs andnndeployed models into one, and exposes the full budget range𝒦\\mathcal\{K\}at inference time\.

### 3\.3Inference I: Cascade Routing

The first strategy for choosing the appropriate budget per input requires no additional training \(Figure[3](https://arxiv.org/html/2609.11192#S3.F3), Inference \(a\)\)\. Given an input, we start from the most aggressive budgetK1K\_\{1\}and iteratively escalate\. At stageii, we encode𝐦1:Ki=Eϕ\(c;Ki\)\\mathbf\{m\}\_\{1:K\_\{i\}\}=E\_\{\\phi\}\(c;K\_\{i\}\), decode a candidate answer, and compute a confidence scoresis\_\{i\}from the decoder’s output log\-probabilities, defined as the length\-normalized log\-probability of the decoded answer:

si=1\|a^i\|​∑tlog⁡pθ​\(a^i,t\)\.s\_\{i\}=\\tfrac\{1\}\{\|\\hat\{a\}\_\{i\}\|\}\\sum\_\{t\}\\log p\_\{\\theta\}\(\\hat\{a\}\_\{i,t\}\)\.\(4\)
This score is a reliable proxy for answer quality: it correlates strongly with token\-level F1 at every budget \(Spearman’sρ\\rhoup to 0\.58; §[5\.3](https://arxiv.org/html/2609.11192#S5.SS3)\)\. Ifsi≥τis\_\{i\}\\geq\\tau\_\{i\}, the candidate is accepted; otherwise we discard it and re\-encode at the next budgetKi\+1K\_\{i\+1\}\. The final budgetKnK\_\{n\}always accepts, so the procedure terminates\. The thresholdsτ1,…,τn−1\\tau\_\{1\},\\dots,\\tau\_\{n\-1\}are calibrated once on held\-out data by sweeping the accuracy\-average\-budget trade\-off\. Different threshold settings trace out a controllable operating curve between the most aggressive and mildest budgets\.

### 3\.4Inference II: LearnedKKPrediction

The cascade decides*after*decoding; our second strategy decides*before*compression \(Figure[3](https://arxiv.org/html/2609.11192#S3.F3), Inference \(b\)\), committing to a singleKKper input\.

#### Offline label construction\.

We derive supervision directly from the Matryoshka model itself\. For each training instance\(c,q,a\)\(c,q,a\), we decode at everyK∈𝒦K\\in\\mathcal\{K\}and score the output against the gold answer with Rouge\-1 F1, yieldingFKF\_\{K\}\. The label is the smallest budget whose score is within a toleranceε\\varepsilonof the best achievable one,

K∗=min⁡\{K∈𝒦:FK≥FKn−ε\},K^\{\*\}\\;=\\;\\min\\bigl\\\{\\,K\\in\\mathcal\{K\}\\;:\\;F\_\{K\}\\,\\geq\\,F\_\{K\_\{n\}\}\-\\varepsilon\\,\\bigr\\\},\(5\)withε=0\.1\\varepsilon\{=\}0\.1\. Instances that remain low\-quality even at the full budget \(FKn<0\.5F\_\{K\_\{n\}\}<0\.5\) are excluded from predictor training\. This turns budget selection into annn\-way classification problem requiring no human annotation\.

#### Class balancing\.

The label distribution is heavily skewed: most instances are solvable atK1K\_\{1\}\(Figure[2](https://arxiv.org/html/2609.11192#S1.F2)\)\. Trained on the raw distribution, the predictor collapses to a shortcut of predicting the majority class\. We therefore resample the training set to a balanced1:1:…:11\{:\}1\{:\}\\dots\{:\}1ratio across thennclasses, which we found necessary and sufficient to prevent this collapse \(§[5\.2](https://arxiv.org/html/2609.11192#S5.SS2)\)\.

#### Predictor\.

The predictor operates on a budget\-independent representation of the context: the context chunks are passed through the encoder*without*allocating any memory slots, and the final\-layer hidden states are mean\-pooled over all context tokens into a single vector𝐡∈ℝd\\mathbf\{h\}\\in\\mathbb\{R\}^\{d\}\. A two\-layer MLP \(d→d/2d\\rightarrow d/2, ReLU,d/2→nd/2\\rightarrow n\) maps𝐡\\mathbf\{h\}to a distribution over𝒦\\mathcal\{K\}\. Only the head is trained with cross\-entropy on the labels of Eq\.[5](https://arxiv.org/html/2609.11192#S3.E5)on the balanced dataset\. Because the features are computed from the context alone, the predicted budget is query\-agnostic: it can be computed once per document, offline, and cached alongside the compressed representation\. At inference, budget selection costs one budget\-free encoder forward plus the \(negligible\) head; the input is then encoded once at the predictedK^\\hat\{K\}and decoded once\. Compared with the cascade, the predictor forgoes the decoder’s own confidence signal but replaces up tonnencode\-decode rounds with this fixed cost, and the two occupy complementary points on the cost\-accuracy spectrum\.

## 4Experiments

Table 1:F1 of separately trained fixed\-ratio compressors vs\. a single Matryoshka\-trained model per method, averaged over in\-domain \(ID\) and out\-of\-domain \(OOD\) tasks\.K=34/10/1K\{=\}34/10/1correspond to15×/51×/510×15\\times/51\\times/510\\timescompression\.### 4\.1Experimental Setup

#### Compressors and budgets\.

We instantiate FlexComp on three soft context compressors: ICAE\([Ge et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib1)\), 500xCompressor\([Li et al\., 2025](https://arxiv.org/html/2609.11192#bib.bib2)\), and SAC\([Liu et al\., 2026](https://arxiv.org/html/2609.11192#bib.bib4)\), keeping each method’s architecture, training objective, and hyperparameters unchanged; the only modification is budget sampling \(§[3\.2](https://arxiv.org/html/2609.11192#S3.SS2)\)\. All compressors use Llama\-3\.2\-1B333[https://huggingface\.co/meta\-llama/Llama\-3\.2\-1B](https://huggingface.co/meta-llama/Llama-3.2-1B)\([Grattafiori et al\., 2024](https://arxiv.org/html/2609.11192#bib.bib23)\)as both the encoder and decoder, with the encoder equipped with LoRA\([Hu et al\., 2022](https://arxiv.org/html/2609.11192#bib.bib25)\)adapters \(rr=128,α\\alpha=256\)\. We split the contexts into chunks with length 510, and we use budgets𝒦=\{1,10,34\}\\mathcal\{K\}=\\\{1,10,34\\\}, i\.e\., compression ratios of510×510\\times,51×51\\times, and15×15\\times\. During Matryoshka training,KKis sampled uniformly from𝒦\\mathcal\{K\}per instance\.

#### Tasks and metrics\.

We follow the evaluation protocol of existing methods and evaluate our models on MRQA\([Fisch et al\., 2019](https://arxiv.org/html/2609.11192#bib.bib6)\), including six in\-domain \(ID\) tasks \(SQuAD, NewsQA, TriviaQA, SearchQA, HotpotQA, NaturalQuestions\) and six out\-of\-domain \(OOD\) tasks \(BioASQ, DROP, DuoRC, RACE, RelationExtraction, TextbookQA\)\. The compressor is continually pretrained on the SlimPajama\-6B dataset\([Soboleva et al\., 2023](https://arxiv.org/html/2609.11192#bib.bib24)\), and finetuned on the MRQA training set\. We report token\-level F1 averaged within each group\.

#### Baselines\.

For each method, we compare the single Matryoshka\-trained model against three*fixed\-ratio specialists*: the same architecture trained conventionally at eachK∈𝒦K\\in\\mathcal\{K\}, following the original recipes\. All fixed\-ratio baselines are trained by us under identical data and compute budgets for a controlled comparison\.

#### Budget selection\.

For cascade routing, thresholds are calibrated once on held\-out data by sweeping the accuracy–average\-budget trade\-off;Kn=34K\_\{n\}\{=\}34always accepts, so each operating point is a pair\(τK=1,τK=10\)\(\\tau\_\{K=1\},\\tau\_\{K=10\}\)over the length\-normalized answer log\-probability\. We report four points of increasing permissiveness:*conservative*\(−0\.20,−0\.30\)\(\-0\.20,\-0\.30\),*balanced*\(−0\.20,−0\.40\)\(\-0\.20,\-0\.40\),*aggressive*\(−0\.30,−0\.40\)\(\-0\.30,\-0\.40\), and*high\-cr*\(−0\.40,−0\.50\)\(\-0\.40,\-0\.50\); a lower \(more negative\) threshold accepts lower\-confidence candidates earlier and thus yields a higher average compression ratio\. TheKKpredictor head adds 2\.1M parameters for Llama\-3\.2\-1B \(d=2048d\{=\}2048;0\.17%0\.17\\%of the encoder\)\.

#### Implementation Details\.

All training runs on 8 H800 GPUs with a per\-GPU batch size of 16\. Compressor pretraining and fine\-tuning are each conducted for 20,000 steps with AdamW \(lr5×10−45\{\\times\}10^\{\-4\}\)\. For theKKpredictor, labeling the MRQA training split \(Eq\. 5\) yields 183K samples \(60\.85%K=1K\{=\}1, 18\.00%K=10K\{=\}10, 21\.15%K=34K\{=\}34\); we downsample to a 1:1:1 balance \(∼\\sim99K\) to prevent the shortcut collapse analyzed in §[5\.2](https://arxiv.org/html/2609.11192#S5.SS2), and train for 2 epochs with the same optimizer, updating only the predictor head while the compressor stays frozen\. For pre\-training, we fixK=34K=34\(15×\\timescompression\)\.

### 4\.2One Model Matches Ratio\-Specific Models

Table[1](https://arxiv.org/html/2609.11192#S4.T1)compares each fixed\-ratio specialist with the single Matryoshka\-trained model evaluated at the same budget\. Across all three architectures and all three ratios, the gap is small\. Replacing three trained models with one costs at most about one F1 point, and in four of nine settings the single model is in fact better\. On OOD tasks, the picture tilts further in favor of Matryoshka training: seven of nine deltas are positive, and the only notable losses occur for ICAE at the extreme510×510\\timesratio\. The clearest win is 500xCompressor at510×510\\times, where the shared model exceeds its specialist by\+3\.72\+3\.72ID and\+3\.12\+3\.12OOD F1\. We conjecture that jointly training across budgets regularizes the extremeK=1K\{=\}1case, which a dedicated specialist must otherwise learn in isolation\. Overall, turning the budget into a free inference\-time variable costs essentially no accuracy, while cutting the number of trained and deployed models fromnnto one\.

Figure 4:Cascade routing results on ICAE, 500xCompressor, and SAC\.Top:average F1 \(ID: solid, OOD: dashed, F1 reported above each mark\) versus the average memory budgetK¯\\bar\{K\}, whereK¯\\bar\{K\}includes retry costs after escalation; the top axis reports the corresponding measured average compression ratio\. Each curve traces four cascade configuration thresholds, ordered from conservative \(cons\.\) to most aggressive \(high cr\), and stars mark the fixedK=34K\{=\}34baseline of the same Matryoshka model\.Bottom:realized routing distribution at each configuration\.
### 4\.3Cascade Routing

Figure[4](https://arxiv.org/html/2609.11192#S4.F4)shows what happens when the cascade chooses the budget at inference time\. The pattern is the same for all three methods: as the thresholds get more permissive, the average budget drops sharply while accuracy barely moves\. On ICAE, the most aggressive operating point uses an average of19\.819\.8tokens per input, an average compression ratio of235×235\\times, yet stays within0\.60\.6ID F1 of always running atK=34K\{=\}34, and OOD accuracy is slightly*above*the fixed baseline at every operating point\. The routing distributions \(bottom row\) explain why this works: even at conservative thresholds, over 20% of inputs are confidently answered atK=1K\{=\}1, matching the oracle picture in Figure[2](https://arxiv.org/html/2609.11192#S1.F2)\. The cascade thus turns the thresholds into a practical control knob: one deployed model, and a compression\-accuracy trade\-off that can be tuned without retraining\.

### 4\.4KKPredictor

Table 2:Per\-input budget selection with theKKpredictor\. Each pair compares the Matryoshka model run uniformly at its mildest budget \(K=34K\{=\}34,15×15\\times\) against the same model with the predictor choosingK∈\{1,10,34\}K\\in\\\{1,10,34\\\}per input before encoding\. ID/OOD: average F1 over in\-/out\-of\-domain tasks; Avg\. cr /K¯\\bar\{K\}: measured average compression ratio and memory budget; right block: distribution of predicted budgets\.*Random routing*assigns budgets with the same per\-budget proportions but ignores the input, matching the predictor’s average budget\.TheKKpredictor decides the budget for each input before compression and pays for a single compression\-decoding pass\. Table[2](https://arxiv.org/html/2609.11192#S4.T2)shows this cheaper strategy works well: relative to always running at the mildest budget, the predictor roughly halves the average budget and raises the compression ratio to 158–236×\\times, while ID and OOD accuracy both drop by at most 0\.7 F1\.

The random routing baseline isolates where this benefit comes from\. It assigns the same per\-budget proportions as the predictor but ignores the input, so it matches the predictor’s average budget exactly; the predictor still outperforms it by about 5 F1 on both ID and OOD\. The gain is therefore not an artifact of the budget mix being favorable on average, it comes from routing the*right*inputs to the smaller budgets, i\.e\., the predictor identifies which inputs tolerate aggressive compression rather than merely compressing more\.

### 4\.5Which Strategy to Deploy

Together, the two strategies serve complementary deployment needs\. When a corpus is compressed once and queried repeatedly, the cascade’s retry cost disappears while its advantage remains: it adapts to each question with iteratively decided ratio, thus offering a tunable, retraining\-free trade\-off curve for this scenario\. When each context is compressed on the fly for a single query, the predictor gives a single\-pass operating point cheap enough for latency\-sensitive serving\. Its uniform per\-request cost is also what makes the budget\-grouped batching of §[5\.4](https://arxiv.org/html/2609.11192#S5.SS4)possible\.

## 5Analysis

### 5\.1Matryoshka in Pretraining Hurts

Table 3:Applying budget sampling already during compressor pretraining degrades quality; FlexComp therefore applies it only in the SFT stage\.A natural question is why we restrict Matryoshka training to the fine\-tuning stage rather than incorporating it into pretraining\. We tried the latter: sampling the budget in both stages\. Table[3](https://arxiv.org/html/2609.11192#S5.T3)shows the result on SAC atK=34K\{=\}34: pretraining with mixed budgets loses2\.32\.3ID and2\.52\.5OOD F1 compared with sampling budgets only during SFT\. Our interpretation is that pretraining is where the compressor learns the basic skill of packing text into memory tokens, and randomizing the slot count during this phase forces the model to split capacity across objectives before that skill is stable; once the base ability exists, adapting it to multiple budgets is cheap\. Practically, this is good news: Matryoshka training drops in at the cheapest stage of the pipeline\.

### 5\.2Balanced Labels Prevent Predictor Collapse

Table 4:Per\-class accuracy of theKKpredictor\. Trained on the raw label distribution, the predictor collapses onto the majority class \(K=1K\{=\}1\); balanced resampling restores usable accuracy on all three classes\.Table[4](https://arxiv.org/html/2609.11192#S5.T4)looks inside theKKpredictor\. Trained on the raw minimal\-budget labels, whose distribution is skewed towardK=1K\{=\}1\(3\.38:1:1\.183\.38\{:\}1\{:\}1\.18\), the predictor takes the shortcut we warned about in §[3\.4](https://arxiv.org/html/2609.11192#S3.SS4): it gets90%90\\%of the majority class right but only1313–16%16\\%of theK=10K\{=\}10class, essentially defaulting to “compress everything”\. Resampling to1:1:11\{:\}1\{:\}1trades a few points on the majority class for points on the minority class, and a second epoch adds little either way\. We attribute this problem as the label distribution, not undertraining\.

### 5\.3Decoder Confidence Tracks Answer Quality

![Refer to caption](https://arxiv.org/html/2609.11192v1/figures/correlation.png)Figure 5:Spearman correlation between decoder confidence and answer F1, computed on the Matryoshka\-trained SAC model at eachKK\. Higher confidence consistently corresponds to higher answer quality\.The cascade rests on the premise that the decoder’s own confidence identifies which answers to trust\. Figure[5](https://arxiv.org/html/2609.11192#S5.F5)validates this: across all budgets, the length\-normalized answer log\-probability correlates with token\-level F1 at Spearman’sρ=0\.56\\rho=0\.56toρ=0\.58\\rho=0\.58, and the relationship holds at everyKK, includingK=1K\{=\}1, where the signal must separate genuinely solved inputs from confidently wrong ones\. This is what makes the calibrated thresholds of §[3\.3](https://arxiv.org/html/2609.11192#S3.SS3)meaningful control knobs rather than arbitrary cutoffs\.

### 5\.4From KV Memory to Serving Throughput

Table[5](https://arxiv.org/html/2609.11192#S5.T5)reports what compression buys at inference time on the Matryoshka\-trained SAC model, at a batch size of 96 with two context lengths\.

The memory story is direct: at both context lengths, moving from 15×\\timesto 510×\\timesshrinks the batch context KV cache by more than 96%\. Because batched decoding is bandwidth\-bound and model weights are shared across the batch, per\-sequence KV reads dominate the incremental memory traffic, so this reduction converts into aggregate decoding throughput\. The effect grows with context length, as the compressed context then accounts for a larger share of each sequence’s cache: TheKKpredictor inherits the benefit while holding accuracy, cutting memory by 50% and raising throughput by 47% at the longer context\. The gains thus accrue where compression is needed most\.

Table 5:Inference efficiency across compression ratios on the Matryoshka\-trained SAC model \(generation length 512, batch size 96, greedy decoding\)\.*KV Cache*is the total context KV memory over the batch under grouped\-query attention;*Throughput*is the aggregate decoding rate over the full batch\.
### 5\.5More Memory Tokens Are Not Always Better

Figure 6:Budget non\-monotonicity on solvable samples \(samples answered correctly \(F1\>\>0\) under at least one budget\)\.Left:fraction of samples where K=1 strictly outperforms K=34\. Larger budgets can actively hurt, and consistently more so on OOD, where the gist\-only representation avoids misleading surface details\.Right:fraction of samples strictly requiring the full budget \(answered correctly only at K=34\)\. Budget sensitivity grows with compressor strength \(ICAE<<500xCompressor<<SAC\)\.Fixed\-ratio evaluation reports averages, and averages hide a phenomenon that per\-sample analysis reveals: for a non\-trivial fraction of inputs, larger budgets actively*hurt*\. Throughout this section we restrict analysis to*solvable*samples \(F1\>\>0 under at least one budget\) and exclude the roughly 20% to 30% of samples that fail at everyKK\.

Figure[6](https://arxiv.org/html/2609.11192#S5.F6)\(left\) quantifies the effect at two levels of severity\. Across the three compressors,K=1K\{=\}1achieves strictly higher F1 thanK=34K\{=\}34on 11\.8–12\.8% of solvable in\-domain samples; within these, on 6\.8–7\.7% the model fails completely atK=34K\{=\}34yet answers correctly from a single memory token, not a degradation but a reversal\. Figure[6](https://arxiv.org/html/2609.11192#S5.F6)\(right\) adds a forward\-looking observation: the fraction of samples strictly requiring the full budget \(11\.0–26\.0%\) grows both with compressor strength \(ICAE<<500xCompressor<<SAC\)\. Additional memory tokens pay off only when the compressor is capable enough to exploit them\. Adaptive budget allocation thus becomes*more*, not less, important as compressors improve\.

\(a\) Context \(NaturalQuestions, ID\):“Michael Casimir ‘Mike’ Stivic is a fictional character on the 1970s American television sitcom All in the Family\. \[…\] Michael was the husband of Archie’s daughter Gloria \(played bySally Struthers\)\.Rob Reinerplayed the role of Michael Stivic throughout the series\.”Q:Who played Mike Stivic on All in the Family?Gold:Rob ReinerK=1 \(510×\\times\):Rob Reiner✓K=34 \(15×\\times\):Sally Struthers✗\(b\) Context \(NaturalQuestions, ID\):“Production was set to begin in first quarter of 2014\. Principal photography commenced on March 6, 2014 inMorocco\. Filming also took place in Hurghada in Egypt, as well as in Berlin and Düsseldorf in Germany\. Shooting wrapped in June 2014\.”Q:Where was A Hologram for the King filmed?Gold:Morocco / Egypt / GermanyK=1 \(510×\\times\):Morocco✓K=34 \(15×\\times\):Hollywood✗

\(c\) Context \(RACE, OOD, abridged\):“Psychologistsin Britain have said that the last full week of January is the most depressing time of year, and labelled next Monday ‘Blue Monday’\. \[…\] The bad weather in January can also contribute to people feeling fed up\. \[…\]”Q:What’s the best title of the passage? Gold:Blue MondayK=1 \(510×\\times\):Blue Monday✓K=34 \(15×\\times\):Psychologists✗\(d\) Context \(RelationExtraction, OOD\):“His Girl Friday is a 1940 American screwball comedy film directed by Howard Hawks, from an adaptation byCharles Lederer, Ben Hecht and Charles MacArthurof the playThe Front Pageby Hecht and MacArthur\.”Q:The His Girl Friday is based upon what? Gold:The Front PageK=1 \(510×\\times\):The Front Page✓K=34 \(15×\\times\):Charles MacArthur & Ben Hecht✗

Figure 7:Budget non\-monotonic cases \(K=1K\{=\}1correct,K=34K\{=\}34wrong\) from the Matryoshka\-trained SAC model, in domain \(a, b\) and out of domain \(c, d\); failure\-mode analysis is provided in Section[5\.5](https://arxiv.org/html/2609.11192#S5.SS5)\. Underlined: the in\-context source of theK=34K\{=\}34error; bold: the gold answer\.ConfigID F1OOD F1Avg\. crK¯\\bar\{K\}*Fixed\-ratio specialists \(3 models\)*SAC 15×\\times67\.3553\.3015×\\times34SAC 51×\\times61\.4446\.8951×\\times10SAC 510×\\times50\.6738\.01510×\\times1*Matryoshka \(1 model,ours\)*SAC 15×\\times68\.1153\.9915×\\times34SAC 51×\\times61\.9747\.3651×\\times10SAC 510×\\times51\.2938\.68510×\\times1*Adaptive budget selection \(ours\)*Cascade \(cons\.\)67\.9253\.96156×\\times25\.6Cascade \(bal\.\)67\.5253\.18164×\\times18\.1Cascade \(aggr\.\)67\.2353\.09203×\\times17\.1Cascade \(high cr\)66\.8152\.95241×\\times16\.1K predictor67\.6953\.27183×\\times14\.2

Table 6:Scaling to Llama\-3\.1\-8B \(SAC; token\-level F1, averaged over ID / OOD tasks\)\. The single Matryoshka model matches or exceeds its fixed\-ratio specialists at every budget, and adaptive selection substantially raises the average compression ratio\.K¯\\bar\{K\}includes retry costs for cascade routing\.We provide case studies in Figure[7](https://arxiv.org/html/2609.11192#S5.F7), which fall into three failure modes\. Panel \(a\) shows*relation confusion*: the parenthetical “Gloria \(played by Sally Struthers\)” sits directly beside the target relation, the 34\-token memory preserves both “played by” facts, and the decoder binds the question to the co\-occurring one\. Panel \(b\) is the most striking mode,*parametric\-prior fallback*: the wrong answer \(“Hollywood”\) appears nowhere in the context, faced with several competing filming locations preserved in the 34\-token memory, the decoder abandons the memory altogether and falls back on its prior for where films are made\. Panel \(c\) shows*salient\-entity anchoring*: the passage opens with “Psychologists,” and the 34\-token memory preserves this surface anchor, which the decoder promotes to a title\. Panel \(d\) is the out\-of\-domain counterpart of \(a\), with the confusion packed into a single sentence\. In every case the larger memory faithfully preserves surface details that create room for error, whereas the single\-token memory, forced to commit to the gist of the context, does not\. Extreme compression thus acts as an information bottleneck: less capacity, more selectivity\.

### 5\.6Scaling to Llama\-3\.1\-8B

To test whether the picture transfers beyond 1B, we repeat the core experiments with Llama\-3\.1\-8B444[https://huggingface\.co/meta\-llama/Llama\-3\.1\-8B](https://huggingface.co/meta-llama/Llama-3.1-8B)as encoder and decoder on the SAC method\. As shown in Table[6](https://arxiv.org/html/2609.11192#S5.T6), all three findings transfer, and the first strengthens: the single Matryoshka model now matches or exceeds its fixed\-ratio specialists at*every*budget, in and out of domain \(deltas of\+0\.47\+0\.47to\+0\.76\+0\.76F1 across all six cells\)\. Adaptive selection likewise carries over\. The cascade’s conservative point reaches 156×\\timesaverage compression at essentially no cost \(−0\.19\-0\.19ID,−0\.03\-0\.03OOD F1 against the Matryoshka 15×\\timesbaseline\), and its most aggressive point 241×\\timeswithin 1\.3 ID F1\. TheKKpredictor reaches 183×\\timesin a single compression\-decoding pass at−0\.42\-0\.42ID and−0\.72\-0\.72OOD F1 score, compared to the Matryoshka 15×\\timesbaseline\. With 183×\\timescompression it still matches the original fixed\-ratio specialist run at 15×\\times\(\+0\.34\+0\.34ID,−0\.03\-0\.03OOD\)\.

## 6Conclusions

FlexComp decouples the fixed compression ratio of soft context compressors from both training and deployment: Matryoshka training turns one model into an any\-ratio compressor that matches the accuracy of separately trained specialists, and per\-input budget selection \(cascade routing or a single\-passKKpredictor\) preserves the mildest ratio’s accuracy at 158\-266×\\timesaverage compression, converting at serving scale into 50% less context KV memory and 47% higher decoding throughput\. Our analysis reveals that larger budgets can sometimes hurt, as extreme compression sheds misleading surface details\. Taken together, these results suggest that the compression ratio need not be a design constant fixed once for all inputs, but a per\-input decision that a single model can both support and make\.

## References

- Chevalieret al\.\(2023\)A\. Chevalier, A\. Wettig, A\. Ajith, and D\. ChenAdapting language models to compress contexts\.InProceedings of the 2023 Conference on Empirical Methods in Natural Language Processing,H\. Bouamor, J\. Pino, and K\. Bali \(Eds\.\),Singapore,pp\. 3829–3846\.External Links:[Link](https://aclanthology.org/2023.emnlp-main.232),[Document](https://dx.doi.org/10.18653/v1/2023.emnlp-main.232)Cited by:[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px1.p1.1)\.
- Devvritet al\.\(2024\)F\. Devvrit, S\. Kudugunta, A\. Kusupati, T\. Dettmers, K\. Chen, I\. S\. Dhillon, Y\. Tsvetkov, H\. Hajishirzi, S\. M\. Kakade, A\. Farhadi, and P\. JainMatFormer: nested transformer for elastic inference\.InThe Thirty\-eighth Annual Conference on Neural Information Processing Systems,External Links:[Link](https://openreview.net/forum?id=fYa6ezMxD5)Cited by:[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px3.p1.1)\.
- Fischet al\.\(2019\)A\. Fisch, A\. Talmor, R\. Jia, M\. Seo, E\. Choi, and D\. ChenMRQA 2019 shared task: evaluating generalization in reading comprehension\.InProceedings of the 2nd Workshop on Machine Reading for Question Answering,A\. Fisch, A\. Talmor, R\. Jia, M\. Seo, E\. Choi, and D\. Chen \(Eds\.\),Hong Kong, China,pp\. 1–13\.External Links:[Link](https://aclanthology.org/D19-5801/),[Document](https://dx.doi.org/10.18653/v1/D19-5801)Cited by:[§1](https://arxiv.org/html/2609.11192#S1.p3.1),[§1](https://arxiv.org/html/2609.11192#S1.p5.1),[§4\.1](https://arxiv.org/html/2609.11192#S4.SS1.SSS0.Px2.p1.1)\.
- Geet al\.\(2024\)T\. Ge, H\. Jing, L\. Wang, X\. Wang, S\. Chen, and F\. WeiIn\-context autoencoder for context compression in a large language model\.InThe Twelfth International Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=uREj4ZuGJE)Cited by:[§1](https://arxiv.org/html/2609.11192#S1.p1.1),[§1](https://arxiv.org/html/2609.11192#S1.p4.1),[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px1.p1.1),[§3\.1](https://arxiv.org/html/2609.11192#S3.SS1.p1.1),[§4\.1](https://arxiv.org/html/2609.11192#S4.SS1.SSS0.Px1.p1.1)\.
- Grattafioriet al\.\(2024\)A\. Grattafiori, A\. Dubey, A\. Jauhri, A\. Pandey, and A\. K\. et al\.The llama 3 herd of models\.External Links:2407\.21783,[Link](https://arxiv.org/abs/2407.21783)Cited by:[§4\.1](https://arxiv.org/html/2609.11192#S4.SS1.SSS0.Px1.p1.1)\.
- Huet al\.\(2022\)E\. J\. Hu, yelong shen, P\. Wallis, Z\. Allen\-Zhu, Y\. Li, S\. Wang, L\. Wang, and W\. ChenLoRA: low\-rank adaptation of large language models\.InInternational Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=nZeVKeeFYf9)Cited by:[§4\.1](https://arxiv.org/html/2609.11192#S4.SS1.SSS0.Px1.p1.1)\.
- Jianget al\.\(2024\)H\. Jiang, Q\. Wu, X\. Luo, D\. Li, C\. Lin, Y\. Yang, and L\. QiuLongLLMLingua: accelerating and enhancing LLMs in long context scenarios via prompt compression\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),L\. Ku, A\. Martins, and V\. Srikumar \(Eds\.\),Bangkok, Thailand,pp\. 1658–1677\.External Links:[Link](https://aclanthology.org/2024.acl-long.91)Cited by:[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px2.p1.1)\.
- Kusupatiet al\.\(2022\)A\. Kusupati, G\. Bhatt, A\. Rege, M\. Wallingford, A\. Sinha, V\. Ramanujan, W\. Howard\-Snyder, K\. Chen, S\. Kakade, P\. Jain,et al\.Matryoshka representation learning\.Advances in Neural Information Processing Systems35,pp\. 30233–30249\.Cited by:[§1](https://arxiv.org/html/2609.11192#S1.p4.1),[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px3.p1.1),[§3\.2](https://arxiv.org/html/2609.11192#S3.SS2.p1.2)\.
- Lewiset al\.\(2020\)P\. Lewis, E\. Perez, A\. Piktus, F\. Petroni, V\. Karpukhin, N\. Goyal, H\. Küttler, M\. Lewis, W\. Yih, T\. Rocktäschel,et al\.Retrieval\-augmented generation for knowledge\-intensive nlp tasks\.Advances in neural information processing systems33,pp\. 9459–9474\.Cited by:[§1](https://arxiv.org/html/2609.11192#S1.p1.1)\.
- Liet al\.\(2023\)Y\. Li, B\. Dong, F\. Guerin, and C\. LinCompressing context to enhance inference efficiency of large language models\.InProceedings of the 2023 Conference on Empirical Methods in Natural Language Processing,H\. Bouamor, J\. Pino, and K\. Bali \(Eds\.\),Singapore,pp\. 6342–6353\.External Links:[Link](https://aclanthology.org/2023.emnlp-main.391/),[Document](https://dx.doi.org/10.18653/v1/2023.emnlp-main.391)Cited by:[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px2.p1.1)\.
- Liet al\.\(2024\)Y\. Li, Y\. Huang, B\. Yang, B\. Venkitesh, A\. Locatelli, H\. Ye, T\. Cai, P\. Lewis, and D\. ChenSnapKV: llm knows what you are looking for before generation\.InProceedings of the 38th International Conference on Neural Information Processing Systems,NIPS ’24,Red Hook, NY, USA\.External Links:ISBN 9798331314385Cited by:[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px4.p1.1)\.
- Liet al\.\(2025\)Z\. Li, Y\. Su, and N\. Collier500xCompressor: generalized prompt compression for large language models\.InProceedings of the 63rd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),W\. Che, J\. Nabende, E\. Shutova, and M\. T\. Pilehvar \(Eds\.\),Vienna, Austria,pp\. 25081–25091\.External Links:[Link](https://aclanthology.org/2025.acl-long.1219/),[Document](https://dx.doi.org/10.18653/v1/2025.acl-long.1219),ISBN 979\-8\-89176\-251\-0Cited by:[§1](https://arxiv.org/html/2609.11192#S1.p1.1),[§1](https://arxiv.org/html/2609.11192#S1.p4.1),[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px1.p1.1),[§3\.1](https://arxiv.org/html/2609.11192#S3.SS1.p1.1),[§4\.1](https://arxiv.org/html/2609.11192#S4.SS1.SSS0.Px1.p1.1)\.
- Liuet al\.\(2026\)X\. Liu, R\. Zhao, P\. Huang, X\. Liu, J\. Xiao, C\. Xiao, T\. Xiao, S\. Gao, Z\. Yu, and J\. ZhuAutoencoding\-free context compression for LLMs via contextual semantic anchors\.InThe Fourteenth International Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=8Pi6Du0n7F)Cited by:[§1](https://arxiv.org/html/2609.11192#S1.p1.1),[§1](https://arxiv.org/html/2609.11192#S1.p4.1),[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px1.p1.1),[§3\.1](https://arxiv.org/html/2609.11192#S3.SS1.p1.1),[§4\.1](https://arxiv.org/html/2609.11192#S4.SS1.SSS0.Px1.p1.1)\.
- Liuet al\.\(2025\)Y\. Liu, J\. Fu, S\. Liu, Y\. Zou, S\. Zhang, and J\. ZhouKV cache compression for inference efficiency in llms: a review\.InProceedings of the 4th International Conference on Artificial Intelligence and Intelligent Information Processing,pp\. 207–212\.Cited by:[§1](https://arxiv.org/html/2609.11192#S1.p1.1)\.
- Miaoet al\.\(2024\)R\. Miao, Y\. Yan, X\. Yao, and T\. YangAn efficient inference framework for early\-exit large language models\.External Links:2407\.20272,[Link](https://arxiv.org/abs/2407.20272)Cited by:[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px4.p1.1)\.
- Miaoet al\.\(2026\)Z\. Miao, Q\. Wu, and Y\. TsuruokaGRC: unifying reasoning\-driven generation, retrieval and compression\.External Links:2605\.09100,[Link](https://arxiv.org/abs/2605.09100)Cited by:[§1](https://arxiv.org/html/2609.11192#S1.p1.1)\.
- Muet al\.\(2023\)J\. Mu, X\. L\. Li, and N\. GoodmanLearning to compress prompts with gist tokens\.InThirty\-seventh Conference on Neural Information Processing Systems,External Links:[Link](https://openreview.net/forum?id=2DtxPCL3T5)Cited by:[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px1.p1.1)\.
- Panet al\.\(2024\)Z\. Pan, Q\. Wu, H\. Jiang, M\. Xia, X\. Luo, J\. Zhang, Q\. Lin, V\. Ruhle, Y\. Yang, C\. Lin, H\. V\. Zhao, L\. Qiu, and D\. ZhangLLMLingua\-2: data distillation for efficient and faithful task\-agnostic prompt compression\.InFindings of the Association for Computational Linguistics ACL 2024,L\. Ku, A\. Martins, and V\. Srikumar \(Eds\.\),Bangkok, Thailand and virtual meeting,pp\. 963–981\.External Links:[Link](https://aclanthology.org/2024.findings-acl.57)Cited by:[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px2.p1.1)\.
- Sobolevaet al\.\(2023\)D\. Soboleva, F\. Al\-Khateeb, R\. Myers, J\. R\. Steeves, J\. Hestness, and N\. DeySlimPajama: A 627B token cleaned and deduplicated version of RedPajama\.External Links:[Link](https://huggingface.co/datasets/cerebras/SlimPajama-627B)Cited by:[§4\.1](https://arxiv.org/html/2609.11192#S4.SS1.SSS0.Px2.p1.1)\.
- Stripeliset al\.\(2024\)D\. Stripelis, Z\. Xu, Z\. Hu, A\. D\. Shah, H\. Jin, Y\. Yao, J\. Zhang, T\. Zhang, S\. Avestimehr, and C\. HeTensorOpera router: a multi\-model router for efficient LLM inference\.InProceedings of the 2024 Conference on Empirical Methods in Natural Language Processing: Industry Track,F\. Dernoncourt, D\. Preoţiuc\-Pietro, and A\. Shimorina \(Eds\.\),Miami, Florida, US,pp\. 452–462\.External Links:[Link](https://aclanthology.org/2024.emnlp-industry.34/),[Document](https://dx.doi.org/10.18653/v1/2024.emnlp-industry.34)Cited by:[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px4.p1.1)\.
- Xuet al\.\(2024\)F\. Xu, W\. Shi, and E\. ChoiRECOMP: improving retrieval\-augmented LMs with context compression and selective augmentation\.InThe Twelfth International Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=mlJLVigNHp)Cited by:[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px2.p1.1)\.
- Yuanet al\.\(2025\)S\. Yuan, K\. Song, J\. Chen, X\. Tan, Y\. Shen, K\. Ren, D\. Li, and D\. YangEASYTOOL: enhancing LLM\-based agents with concise tool instruction\.InProceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies \(Volume 1: Long Papers\),L\. Chiruzzo, A\. Ritter, and L\. Wang \(Eds\.\),Albuquerque, New Mexico,pp\. 951–972\.External Links:[Link](https://aclanthology.org/2025.naacl-long.44/),[Document](https://dx.doi.org/10.18653/v1/2025.naacl-long.44),ISBN 979\-8\-89176\-189\-6Cited by:[§1](https://arxiv.org/html/2609.11192#S1.p1.1)\.
- Yueet al\.\(2024\)M\. Yue, J\. Zhao, M\. Zhang, L\. Du, and Z\. YaoLarge language model cascades with mixture of thought representations for cost\-efficient reasoning\.InThe Twelfth International Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=6okaSfANzh)Cited by:[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px4.p1.1)\.
- Zhanget al\.\(2023\)Z\. Zhang, Y\. Sheng, T\. Zhou, T\. Chen, L\. Zheng, R\. Cai, Z\. Song, Y\. Tian, C\. Ré, C\. Barrett, Z\. Wang, and B\. ChenH2\{\}\_\{2\}o: heavy\-hitter oracle for efficient generative inference of large language models\.External Links:2306\.14048,[Link](https://arxiv.org/abs/2306.14048)Cited by:[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px4.p1.1)\.
- Zhaoet al\.\(2026\)K\. Zhao, Z\. Meng, Z\. Xie, J\. Duan, Y\. Hu, Z\. Liu, and S\. CaoEComStage: stage\-wise and orientation\-specific benchmarking for large language models in e\-commerce\.External Links:2601\.02752,[Link](https://arxiv.org/abs/2601.02752)Cited by:[§1](https://arxiv.org/html/2609.11192#S1.p1.1)\.
- Zhaoet al\.\(2025\)R\. Zhao, X\. Liu, X\. Liu, P\. Huang, C\. Xiao, T\. Xiao, and J\. ZhuPosition IDs matter: an enhanced position layout for efficient context compression in large language models\.InFindings of the Association for Computational Linguistics: EMNLP 2025,C\. Christodoulopoulos, T\. Chakraborty, C\. Rose, and V\. Peng \(Eds\.\),Suzhou, China,pp\. 17715–17734\.External Links:[Link](https://aclanthology.org/2025.findings-emnlp.962/),[Document](https://dx.doi.org/10.18653/v1/2025.findings-emnlp.962),ISBN 979\-8\-89176\-335\-7Cited by:[§1](https://arxiv.org/html/2609.11192#S1.p1.1),[§2](https://arxiv.org/html/2609.11192#S2.SS0.SSS0.Px1.p1.1)\.

Similar Articles

Capability Scaling-Down Laws for LLM Compression

arXiv cs.LG

Nokia Applied Research and Florida State University researchers present capability scaling-down laws for LLM compression (pruning, quantization, distillation), showing that sharing density-response relations halves the measurements needed to fit pruning predictors while matching fully fitted regressions within 0.020 nats per token on Pythia and OLMo-2 models.

What should context compression keep? I looked at how six agents handle it[D]

Reddit r/MachineLearning

An analysis of how six AI coding agents (Claude Code, Codex CLI, OpenCode, Cline, Cursor, Amp) converge on layered progressive compression for long contexts, differing in what they protect (user messages, stateful tool outputs) and whether they inform the model of compression, with tradeoffs between cost and accuracy.

End-to-End Context Compression at Scale

Hugging Face Daily Papers

This paper presents Latent Context Language Models (LCLMs), a family of encoder-decoder compressors that efficiently handle long contexts through architectural search and large-scale pretraining, outperforming traditional KV cache methods in accuracy, speed, and memory usage.

LRCC: Generalizing Low-Rank Compression with Conditional Computation

arXiv cs.CL

LRCC proposes token-dependent compute allocation by training lightweight routers over nested low-rank paths in frozen pretrained LLMs, improving perplexity and downstream accuracy over static low-rank compression at matched active-parameter budgets and decoding latency on Llama and Qwen models.