atlas

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

Leveraging Attention to Effectively Compress Prompts for Long-Context LLMs

AAAI 2025 · Large language models › Language, safety and interpretability · approach: LLM pruning and scaling data · 2 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 AttnComp, a training-free prompt compression method that scores tokens with query-guided cross-attention from retrieval heads of a small causal LM and groups tokens into semantic units via a maximum spanning tree plus Louvain community detection.

Problem

Prompt compression for long-context LLMs relies on information entropy (PPL) and treats tokens independently, which is suboptimal for deciding which parts of a lengthy prompt to remove.

Approach

Use causal cross-attention from the query to the context (aggregated by max over retrieval heads) as the token importance metric, and use self-attention to cluster tokens into semantic units via a maximum spanning tree and Louvain community detection so units are filtered jointly rather than independently.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use AttnComp instead of LongLLMLingua†GPT-3.5-Turbo-0613 · NQ (1st position)accuracy: 75.0 -> 76.6Helped
Use AttnComp instead of LongLLMLingua†LongChat-13B-16k · NQ (1st position)accuracy: 68.7 -> 70.1Helped
Use AttnComp instead of LongLLMLinguaLongChat-v1.5-7B-32k · LongBench AVGscore: 25.5 -> 29.6Helped
Use AttnComp instead of LongLLMLinguaGPT-3.5-Turbo-16k · LongBench AVGscore: 38.5 -> 41.1Helped
Add semantic-unit grouping (ablation)AttnComp · NQ (LongChat-13B)accuracy: 67.1 -> 68.6Helped
Use semantic units instead of phrase units (ablation)AttnComp · NQ (LongChat-13B)accuracy: 67.4 -> 68.6Helped
Use retrieval heads instead of all attention heads (ablation)AttnComp · NQ (LongChat-13B)accuracy: 68.2 -> 68.6Helped
Use cross-attention instead of PPL as the compression metric (ablation)AttnComp · NQ (LongChat-13B)accuracy: 61.5 -> 68.6Helped
Use non-iterative compression instead of iterative token-level compression (ablation)AttnComp · NQ (LongChat-13B)accuracy: 67.5 -> 68.6Helped
Use Mistral-7B-v0.2 instead of Llama-2-7B for fine-grained compression (ablation)AttnComp · NQ (LongChat-13B)accuracy: 68.6 -> 68.8Helped

Surprising findings

Limitations

Experimental setup

Datasets: Natural Questions (retrieval-augmented setup from Liu et al. 2024) LongBench

Benchmarks: Natural Questions LongBench (Qasper, MultiFieldQA, NarrativeQA, MuSiQue, HotpotQA, 2WikiMultihopQA)

Metrics: accuracy F1 (LongBench metrics) latency compression ratio

Baselines: SBERT OpenAI embedding Cond.PPL Selective-Context LLMLingua LLMLingua-2 LongLLMLingua

Builds on: LLMLingua LongLLMLingua Retrieval heads (Wu et al. 2024) Selective-Context

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