Abstract
Retrieval-Augmented Generation (RAG) helps Large Language Models (LLMs) stay factually grounded but often introduces excessive noise when many documents are retrieved. We propose CompAct (Compressing Retrieved Documents Actively), a framework that uses an iterative, active strategy to condense long retrieved contexts. By processing documents in segments and deciding when enough information has been gathered to stop, CompAct achieves massive compression rates (up to 51x) while significantly boosting performance on complex multi-hop question-answering tasks.
Introduction
While RAG systems improve accuracy, they suffer from the "lost in the middle" phenomenon, where LLMs struggle to find key information buried in long, noisy contexts. Existing context compressors typically operate in a single step, which often fails in multi-hop scenarios where an answer must be synthesized from information scattered across multiple documents. CompAct addresses this by treating compression as an active, iterative reasoning process rather than a static filter.
Methods
The core innovation of CompAct is its Active Compression and Early Termination strategy. Instead of compressing all retrieved documents at once, it follows a sequential workflow:
- Segmentation: Retrieved documents are split into small segments (e.g., 5 documents at a time).
- Iterative Compression: The model processes the first segment to generate a summary. For subsequent segments, it takes the question, the new documents, and the previous summary as inputs. This allows the model to "remember" previous findings and actively look for missing evidence.
- Self-Evaluation & Early Termination: At each step, the model generates a rationale and a token—either
[COMPLETE]or[INCOMPLETE]. If the model determines it has sufficient information, it terminates early, saving computation and preventing further noise.
The authors fine-tuned a Mistral-7B model using a synthetic dataset of 28k instances generated by GPT-4o. CompAct acts as a "plug-in" module between any retriever and reader LLM.
Results
CompAct demonstrated superior performance across challenging benchmarks, including HotpotQA, MuSiQue, and 2WikiMultiHopQA.
Scaling with Retrieval Depth
As shown in the performance analysis, while retrieving more documents (higher top-k) increases the chance of finding the answer, the performance of raw LLMs often plateaus or declines due to added noise. In contrast, CompAct continues to improve as top-k increases, mimicking the performance trend of "gold" (perfect) documents.
Compression and Efficiency
CompAct achieved extreme compression rates of 37x to 51x across different datasets. For example, it can condense ~3,000 tokens of retrieved text into fewer than 200 tokens without losing accuracy. This efficiency translates to significant cost reductions; in one experiment, API costs for 500 samples were reduced from $10.75 to just $0.28, while simultaneously improving the F1 score. On HotpotQA, CompAct achieved a 7.0 F1 improvement over existing compressors like RECOMP.
Conclusion
CompAct provides a robust solution for managing context noise in RAG systems. By employing an active, iterative approach to compression, it enables LLMs to handle larger retrieval sets more effectively and efficiently. Future work will investigate the performance of smaller base models and address potential biases in synthetic training data.
Summary updated