atlas

Research map / Large language models / Language, safety and interpretability

Prompt Compression with Context-Aware Sentence Encoding for Fast and Improved LLM Inference

AAAI 2025 · Large language models › Language, safety and interpretability · approach: Pruning and circuits in LLMs · 10 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes CPC, a sentence-level prompt compressor that ranks context sentences by a contrastively trained context-aware sentence encoder (Mistral-7B with LoRA), trained on a newly generated CQR dataset, and reports better accuracy and up to 10.93x faster inference than LongLLMLingua.

Problem

Long prompts raise LLM inference cost, but token-level prompt compression can break sentence coherence and semantics at high compression ratios and is computationally expensive.

Approach

Compress prompts at the sentence level by scoring each sentence's relevance to the question with a context-aware sentence encoder (token embeddings pooled over the sentence span within its full context), trained contrastively on questions with positive and negative context sentences generated and filtered with LLMs.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use CPC instead of LongLLMLinguaprompt compression · LongBench, 3,000 tokensAVG: 48.8 -> 50.0Helped
use CPC instead of LongLLMLinguaprompt compression · ZeroSCROLLS, 3,000 tokensAVG: 32.8 -> 34.9Helped
use CPC instead of LongLLMLinguaprompt compression · LongBench, 2,000 tokensAVG: 48.0 -> 49.5Helped
use CPC instead of LongLLMLinguaprompt compression · ZeroSCROLLS, 2,000 tokensAVG: 32.5 -> 33.8Helped
use CPC instead of LongLLMLinguaprompt compression · LongBenchaverage relative latency: 27.5×Helped
add L_MNTP to the training loss (ablation)CPC context-aware sentence encoder · LongBench, SingleDoc, 2,000 tokensaccuracy: 35.46 -> 42.38Helped
add L_SC to the training loss (ablation)CPC context-aware sentence encoder · LongBench, SingleDoc, 2,000 tokensaccuracy: 41.17 -> 42.38Helped
add question verification during dataset collection (ablation)CPC · LongBench, SingleDoc, 2,000 tokensaccuracy: 41.51 -> 42.38Helped
add similarity-based negative filtering (ablation)CPC · LongBench, SingleDoc, 2,000 tokensaccuracy: 41.34 -> 42.38Helped
add KL-based negative filtering (ablation)CPC · LongBench, SingleDoc, 2,000 tokensaccuracy: 40.71 -> 42.38Helped
use 4 negatives per positive instead of 2 (ablation)CPC context-aware sentence encoder · LongBench, SingleDoc, 2,000 tokensaccuracy: 42.38 -> 41.52Hurt
use 8 negatives per positive instead of 2 (ablation)CPC context-aware sentence encoder · LongBench, SingleDoc, 2,000 tokensaccuracy: 42.38 -> 41.06Hurt

Surprising findings

Limitations

Experimental setup

Datasets: WikiText CQR dataset LongBench ZeroSCROLLS PubMed Krapivin-2009 MeetingBank SummScreen

Benchmarks: LongBench ZeroSCROLLS PubMed Krapivin-2009 MeetingBank SummScreen

Metrics: F1 ROUGE Levenshtein similarity keyword recall latency

Baselines: LLMLingua LLMLingua-2 LongLLMLingua Selective-Context BM25 SBERT OpenAI embeddings MpNet-v2 LLM2Vec

Builds on: LLMLingua LongLLMLingua LLMLingua-2 Sentence-BERT LLM2Vec

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy