While large language models (LLMs) are increasingly deployed in long-context scenarios, lengthy prompts can increase inference costs and latency and exacerbate the ``lost-in-the-middle'' phenomenon. Selective prompt compression offers a model-agnostic approach to alleviating these issues. However, methods based on fixed token- or sentence-level importance scores may overlook how content contributions change with the selected subset, limiting their ability to account for inter-sentence redundancy. Compression procedures that rely on autoregressive LLM scoring can also introduce substantial overhead. We propose PC-SubMax, a theoretically grounded framework that formulates selective prompt compression as regularized monotone submodular maximization under a knapsack constraint. The objective is U(S)−ℓ(S), where the monotone submodular utility U combines information coverage, query relevance, and log-determinant diversity, and the non-negative modular penalty ℓ captures token cost. Through diminishing marginal returns, the objective evaluates each sentence's contribution relative to the selected content. To optimize this objective, we develop the Regularized Greedy+Max (RGM) algorithm, which deterministically returns a feasible set Q satisfying U(Q)−ℓ(Q)≥21U(O)−ℓ(O), where O is an optimal feasible solution to the regularized problem. RGM uses O(nκ) value-oracle queries, where n is the number of candidate sentences and κ is the maximum feasible subset size. PC-SubMax uses encoder representations and avoids autoregressive LLM scoring during compression. Experiments across seven diverse benchmarks demonstrate competitive downstream performance with low compression overhead.
Figures & tables
Figure 1: Overview of PC-SubMax.
Method
CR
CodeNet
GSM8K
1/τ
Tokens
BLEU
R-1
R-2
R-L
BS-F1
EM
1/τ
Tokens
Selective-Context
0.2
4.53
335.10
3.21
25.42
7.04
18.93
83.34
87.06
4.28
114
0.3
3.27
464.22
5.53
32.00
8.26
17.90
82.93
92.16
2.84
172
0.5
1.89
803.17
11.46
41.72
14.63
23.99
84.67
90.20
1.60
305
LLMLingua
0.2
5.02
302.39
4.96
31.50
8.10
17.47
82.24
86.87
6.18
79
0.3
3.41
445.16
6.72
34.23
10.03
20.06
83.38
85.22
3.87
126
Table 1: Comprehensive results on CodeNet and GSM8K at different compression ratios. Best results are shown in bold .
Figure 2: Performance comparison on Truncated ArXiv across different compression ratios.
Method
Truncated ArXiv
HotpotQA
CodeNet
People Daily
LongBench
RULER
Selective-Context
3046
9173
485
635
–
–
LLMLingua
2235
5546
1033
1901
–
–
LongLLMLingua
2268
5532
1042
1912
–
–
LLMLingua-2
387
1045
181
134
367
321
PartPrompt
3101
1304
2138
1267
14024
71491
PC-SubMax (Ours)
154
897
82
85
627
576
Table 2: Wall-clock compression time in seconds for the evaluated workloads.
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
Datasets
LongBench Tasks
Task
λcov
λdiv
λrel
λtok
Task Type
λcov
λdiv
λrel
λtok
Truncated ArXiv
0.50
0.50
0.00
0.10
QA
0.25
0.10
0.60
0.05
People Daily
0.50
0.50
0.00
0.05
Summary
0.55
0.45
0.00
0.10
CodeNet
0.50
0.50
0.00
0.05
Retrieval
0.35
0.25
0.40
0.10
HotpotQA
0.25
0.10
0.65
0.05
Code
0.60
0.25
0.15
0.05
GSM8K
0.50
0.35
0.15
0.05
Classification
0.35
0.15
0.50
0.10
Appendix
Table 3: Task-specific coefficients of the regularized objective.
Method
CR
1/τ
Tokens
BLEU
R-1
R-2
R-L
BS-F1
Selective-Context
0.2
4.75
631.03
6.39
27.33
7.68
17.93
84.69
0.3
2.99
1001.74
15.51
39.79
13.85
29.62
87.74
0.5
1.63
1844.51
18.43
52.13
24.60
33.53
89.67
LLMLingua
0.2
5.11
587.35
3.36
26.01
5.53
13.40
83.22
0.3
3.42
875.64
7.76
40.04
11.46
20.42
86.31
0.5
2.04
1467.58
11.47
49.28
17.90
27.09
87.85
Appendix
Table 4: Results on Truncated ArXiv at different compression ratios. Best results are shown in bold .
Method
CR
1/τ
Tokens
BLEU
R-1
R-2
R-L
BS-F1
Selective-Context
0.2
4.96
474.80
8.33
29.34
12.13
28.63
66.52
0.3
3.25
724.62
8.60
30.71
11.98
28.64
67.92
0.5
1.95
1207.69
12.94
31.77
16.59
32.26
71.20
LLMLingua
0.2
5.14
458.17
2.71
23.57
7.43
23.80
62.02
0.3
3.42
688.60
8.31
28.94
10.88
29.42
68.34
0.5
2.05
1148.78
11.04
30.66
14.67
29.92
68.43
Appendix
Table 5: Results on People Daily at different compression ratios. Best results are shown in bold .
Method
CR
1/τ
Tokens
BLEU
R-1
R-2
R-L
BS-F1
P
R
F1
Selective-Context
0.2
4.87
318.70
35.41
38.81
17.82
38.74
89.12
43.01
43.21
40.60
0.3
3.22
481.65
39.36
43.27
21.48
43.17
89.81
47.62
48.02
45.18
0.5
1.99
780.84
48.68
53.34
27.75
53.20
91.53
58.39
59.12
55.77
LLMLingua
0.2
5.03
308.81
33.94
37.29
16.75
37.21
89.19
40.87
41.35
38.82
0.3
3.11
499.28
35.00
38.48
17.35
38.39
89.43
41.99
42.13
39.96
0.5
1.98
786.18
38.57
42.39
19.51
42.28
90.04
46.61
46.49
44.19
Appendix
Table 6: Results on HotpotQA at different compression ratios. Best results are shown in bold . R-1/2/L denotes ROUGE-1/2/L; P/R/F1 denotes precision/recall/F1.
Method
RULER
LongBench
LLMLingua-2
70.4
25.93
PartPrompt
96
28.05
PC-SubMax (Ours)
97.2
40.86
Appendix
Table 7: Results on LongBench and RULER at a target token-retention ratio of 0.2.
Method
Qwen3-VL-32B-Instruct
Llama-3-8B-Instruct
BLEU
R-1
R-2
R-L
BS-F1
BLEU
R-1
R-2
R-L
BS-F1
20% token constraint
Selective-Context
6.39
27.33
7.68
17.93
84.69
12.16
46.40
19.31
28.06
88.32
LLMLingua
3.36
26.01
5.53
13.40
83.22
8.92
42.15
14.91
25.29
87.29
LongLLMLingua
5.19
35.03
8.61
17.57
84.51
6.54
37.86
11.41
22.26
86.12
LLMLingua-2
11.82
46.13
16.62
25.44
87.96
13.92
46.95
20.83
28.63
88.73
Appendix
Table 8: Performance of selective prompt compression methods on the Truncated ArXiv dataset when feeding compressed prompts to different LLMs.
Weights
CR
BLEU
R-1
R-2
R-L
BS-F1
P
R
F1
(0.25, 0.1, 0.65)
0.2
51.18
55.00
29.27
54.84
92.17
59.00
57.41
56.43
0.3
62.25
65.57
34.01
65.57
94.25
69.26
66.32
67.29
0.5
67.12
71.82
39.56
71.82
94.77
75.18
74.19
73.24
(0.0, 0.1, 0.65)
0.2
51.07
54.53
26.67
54.53
92.09
55.84
55.77
54.55
0.3
56.01
60.10
33.38
60.10
93.20
62.02
63.23
61.20
0.5
66.73
70.81
36.78
70.81
94.68
72.74
72.88
71.74
Appendix
Table 9: Ablation study on HotpotQA: impact of semantic-utility components. Weights are shown as (λcov,λdiv,λrel) , with λtok=0.05 fixed.