While context compression can mitigate the growing inference costs of Large Language Models (LLMs) by shortening contexts, existing methods that specify a target compression ratio or length suffer from unpredictable performance degradation, hindering their reliable deployment. We introduce a paradigm shift to Performance-oriented Context Compression (PoC), where developers specify an acceptable performance floor instead of a compression ratio. PoC employs a lightweight performance predictor to automatically find the most aggressive compression ratio that satisfies this constraint before steering an off-the-shelf compressor. We design and compare two predictor variants: a simple context-agnostic predictor and a more sophisticated context-aware one that considers the input's inherent compressibility. On both question-answering and summarization benchmarks, the context-aware predictor consistently achieves lower performance prediction error than the context-agnostic predictor, while the resulting context-aware PoC attains a superior overall performance. Our work paves the way for a more reliable, efficient, and performance-aware deployment of context compression for LLMs.
Figures & tables
Figure 1: Overview of Performance-oriented Context Compression (PoC) . PoC is a novel context compression paradigm that moves away from budget-driven compression toward performance-driven compression. Unlike Budget-oriented Context Compression (BoC), PoC compresses context to the minimum length required to meet a given performance constraint. This approach mitigates the unpredictable performance degradation inherent in BoC, thus enhancing the reliability and applicability of context compression.
Figure 2: Overview of the PoC pipeline: (1) A performance predictor first estimates the performance-compression curve for the input context. (2) Given a target performance retention, PoC then searches for the minimum compression ratio that meets the constraint. (3) Finally, an off-the-shelf compressor compresses the context using the selected ratio.
Figure 3: Context-aware predictor. It takes the context and multiple compression ratios as input to simultaneously predict multiple performance retentions. This parallel prediction approach enables the prediction of multiple performance retentions in a single forward pass, significantly accelerating the prediction speed.
Method
SearchQA
TriviaQA
Natural Questions
HotpotQA
SQuAD
PPE ↓
F1@R ↑
EM@R ↑
PPE ↓
F1@R ↑
EM@R ↑
PPE ↓
F1@R ↑
EM@R ↑
PPE ↓
F1@R ↑
EM@R ↑
PPE ↓
F1@R ↑
EM@R ↑
context-agnostic
0.156
62.3
47.4
0.122
49.2
32.0
0.168
61.9
42.0
0.162
66.3
47.0
0.148
62.8
41.8
context-aware
0.136 ( ↓12.8% )
64.7
50.4
0.113 ( ↓7.4% )
67.5
53.1
0.156 ( ↓7.1% )
62.2
42.3
0.159 ( ↓1.9% )
67.0
47.5
0.144 ( ↓2.7% )
63.0
42.4
Table 1: Performance on Question Answering benchmarks. We report the Performance Prediction Error (PPE, lower is better) and Performance at Ratio (P@R) for F1 and EM scores (higher is better). The percentage in parentheses indicates the relative reduction in PPE compared to the context-agnostic baseline.
Method
GovReport
SummScreenFD
PPE ↓
R1@R ↑
R2@R ↑
RL@R ↑
PPE ↓
R1@R ↑
R2@R ↑
RL@R ↑
context-agnostic
0.023
34.0
13.2
18.1
0.059
29.5
5.8
16.2
context-aware
0.018 ( ↓21.7% )
34.0
13.2
18.1
0.039 ( ↓33.9% )
30.3
5.8
16.5
Table 2: Performance on Summarization benchmarks. We report the Performance Prediction Error (PPE) and Performance at Ratio (P@R) for ROUGE-1/2/L scores. The percentage in parentheses shows the relative reduction in PPE for our context-aware model compared to the baseline.
Figure 4: The performance-compression curve interpolated by the context-agnostic predictor. To illustrate the sample-specific variability, we randomly plot the performance-compression curves of 3 samples. (a)–(f) present the performance-compression curves for the QA and summarization tasks, while (h) shows the unnormalized performance-compression curve (where the y-axis represents the F1 score) on TriviaQA. The unnormalized performance-compression curves for the other datasets are provided in Appendix A .
Component
Ratio
Latency (ms)
Std. Dev. (ms)
Predictor
-
1.53
0.03
Compressor
0.02
27.41
0.36
0.10
27.51
0.69
0.20
27.60
0.42
0.50
27.68
0.62
0.80
27.72
0.48
Table 3: Latency evaluation of the framework components. The predictor and compressor latencies represent the overhead, measured on 512-token chunks. The Reader latency demonstrates the inference speedup on a 32,768-token context compressed at different ratios.
Figure 5: The unnormalized performance-compression curves interpolated by the context-agnostic predictor. In subfigures (a)–(e), the y-axis represents the F1 score, while in (f) and (g), the y-axis represents the geometric mean of ROUGE-1, ROUGE-2, and ROUGE-L.
Context compression aims to shorten long context inputs with minimal information loss for LLM inference acceleration. While existing methods have shown promise, they typically rely on complex compression modules or compression-specific training, leaving the intrinsic capabilities of LLMs underexplored. In contrast, this work reveals that a thinking model itself can naturally compress long contexts by organizing task-relevant information. We thus derive Thinking as Compression (TaC), a new compression paradigm that treats thinking itself as compressed context. Without relying on specific dedicated compressor, TaC directly prompts the thinking model to generate thinking traces as the shortened context, already outperforming most representative compression methods. Further, given that raw thinking output may struggle with budget control and shortcut behaviors, we introduce Thinking as Compression Constrained (TaC-C), leveraging a simple reward-driven optimization framework to elicit intrinsic thinking as compact and controllable compressed context. Experiments across four long-context QA benchmarks demonstrate that TaC-C consistently outperforms existing baselines. At 4x and 8x compression ratios, it surpasses the strongest competitor by 17.4% and 23.4% in average F1, and by 15.7% and 21.7% in average Exact Match Score (EM), respectively.
Guoxin Ma, Yibing Liu, Chengzhengxu Li +7
Baidu Inc., Beijing, China · Xi’an Jiaotong University · City University of Hong Kong +1
The exponential expansion of context windows in LLMs has unlocked capabilities for long-document understanding but introduced severe bottlenecks in inference latency and information utilization. Existing compression methods often suffer from high training costs or semantic fragmentation due to aggressive token pruning. In this paper, we propose BEAVER, a novel training-free framework that shifts compression from linear token removal to structure-aware hierarchical selection. BEAVER maximizes hardware parallelism by mapping variable-length contexts into dense page-level tensors via dual-path pooling, and preserves discourse integrity through a hybrid planner combining semantic and lexical dual-branch selection with sentence smoothing. Extensive evaluations on four long-context benchmarks demonstrate that BEAVER achieves comparable performance to state-of-the-art (SOTA) methods like LongLLMLingua. Notably, on the RULER benchmark, BEAVER maintains high fidelity in multi-needle retrieval where baselines deteriorate. Regarding efficiency, BEAVER reduces latency by 26.4x on 128k contexts, offering a scalable solution for high-throughput applications. Our code is available at https://cslikai.cn/BEAVER/.
Zhengpei Hu, Kai Li, Dapeng Fu +4
School of Computer Technology and Application, Qinghai University · Tsinghua University · Ant Group Security and Intelligence Laboratory (SIL)
Large language models (LLMs) increasingly rely on long-context processing, but expanding context windows introduces substantial computational and financial costs. Existing context reduction approaches, including retrieval and memory compression methods, are typically evaluated using performance and efficiency metrics independently, limiting systematic comparison and deployment-aware decision-making. This paper introduces The Efficiency Frontier, a unified framework for cost--performance optimization in LLM context management. The framework models context strategy selection as a deployment-aware optimization problem that jointly accounts for task performance, token cost, and preprocessing reuse through amortized cost modeling. Unlike existing evaluations that compare methods in isolation, the proposed framework enables decision-oriented analysis. It identifies when different context management strategies become preferable under varying operational conditions. Experiments on HotpotQA reveal distinct operational regimes and transition boundaries between retrieval-based and preprocessing-based strategies. Results show that deployment-aware optimization reduces effective token usage by approximately 25% at comparable performance, enabling more cost-efficient deployment of large language model systems, while amortized memory compression achieves over 50% lower token cost relative to full-context prompting in higher-performance settings. Overall, the proposed framework provides a principled and practical foundation for evaluating and deploying scalable, efficient, and sustainable LLM systems across enterprise, scientific, and public-sector applications.
Binqi Shen, Lier Jin, Hanyu Cai +2
Department of Industrial Engineering and Management Sciences Northwestern University Evanston, USA · Fuqua School of Business Duke University Durham, USA · Department of Engineering Carnegie Mellon University Pittsburgh, USA +1