TL;DR
EnComp is a lightweight, encoder-only framework that slashes the computational cost of Retrieval-Augmented Generation (RAG) by aggressively pruning irrelevant sentences from retrieved contexts. By using "marginal contribution scoring"—measuring how much a specific sentence actually helps answer a query—it achieves state-of-the-art accuracy while using 3.7x less memory and 3x lower latency than the leading LLM-based compressors.
What Problem Does This Paper Address?
Retrieval-Augmented Generation (RAG) is the industry standard for reducing hallucinations in Large Language Models (LLMs). However, it faces a "Goldilocks" problem: retrieve too little information, and you miss the answer; retrieve too much, and you hit three major walls:
- Latency: Processing thousands of tokens takes time.
- Memory: Long contexts require massive VRAM, often pricing out "edge" or consumer-grade hardware.
- Distraction: LLMs can suffer from the "lost in the middle" phenomenon, where extraneous noise in the prompt degrades the quality of the final answer.
Existing context compressors are often "decoder-heavy," meaning they use another expensive LLM just to decide what to delete. This creates a paradox where the "compression" step is almost as slow and resource-hungry as the generation step itself.
Methods
The authors introduce EnComp, which shifts the workload from heavy decoder models to a lightweight encoder-only architecture (specifically, ModernBERT).
The secret sauce is Amortized Marginal Contribution Scoring:
- The Concept: Instead of asking "Is this sentence relevant?" (a binary choice), the model asks "How much would the passage's 'answerability' drop if I removed this specific sentence?"
- Counterfactual Training: During training, the model looks at a passage and then looks at a "counterfactual" version where a sentence is redacted. The difference in the model's confidence (the "answerability logit") becomes the training signal.
- Contrastive Ranking: The model is optimized to ensure that "answer-critical" evidence always outranks "distractor" sentences within the same context.
- Single-Pass Inference: Unlike methods that re-encode text multiple times, EnComp scores every sentence in a document in one single forward pass, making it incredibly fast.
Datasets
The researchers trained EnComp on a subset of HotpotQA (HQA), utilizing its manual sentence-level annotations. To prove the model's ability to generalize, they evaluated it across five diverse benchmarks:
- Multi-hop QA: HotpotQA, 2WikiMultihopQA, and Musique (requiring reasoning across multiple documents).
- Single-hop QA: Natural Questions (NQ) and TriviaQA (TQA).
They tested these against various "reader" models, including Llama-3.1-8B, Llama-3.3-70B, and proprietary models like Gemini-3-flash.
Key Insights and Ideas
- Encoders are Underrated: While the industry is obsessed with generative (decoder) models, this paper proves that bidirectional encoders are superior for understanding and ranking tasks. They provide better context awareness for sentence selection at a fraction of the size.
- Contextual Importance is Relative: A sentence isn't just "useful" or "useless" in a vacuum. Its value depends on the other sentences around it. By training on the drop in answerability, EnComp captures the synergy between different pieces of evidence.
- The "Two-Stage" Filter: EnComp first acts as a "gatekeeper" for entire chunks (discarding those with low evidence) and then performs "surgery" within the remaining chunks to keep only the vital sentences.
Key Results
EnComp demonstrates that you don't have to trade accuracy for speed:
- Efficiency: It requires only 1.86 GB of VRAM, compared to the ~7 GB or more required by competitors like AttnComp.
- Speed: Compression latency is roughly 45ms, nearly 3x faster than the strongest baselines and orders of magnitude faster than generative summarization methods.
- Accuracy: On the Llama-3.3-70B reader, EnComp achieved an Exact Match (EM) score of 36.98, outperforming or matching much larger models while retaining only ~16% of the original tokens.
- Robustness: As the number of retrieved documents ($k$) increases, EnComp’s performance remains stable, whereas other compressors often see their accuracy degrade as the "noise" increases.
Limitations and Future Work
The authors identify two main areas for improvement:
- Granularity: Currently, EnComp prunes at the sentence level. If a single sentence is very long and contains both a "clue" and "noise," the model has to keep the whole thing. Future versions might move toward phrase-level or clause-level pruning.
- Label Dependency: The training relies on high-quality, sentence-level annotations. While they used HotpotQA, generating these labels for new domains might require expensive "LLM-as-a-judge" pipelines, which could introduce their own biases.
In summary, EnComp provides a blueprint for making RAG systems "lean and mean," proving that smart, encoder-based pruning is the key to deploying high-performance AI on modest hardware.
Summary updated