Abstract
Retrieval-Augmented Generation (RAG) is essential for grounding Large Language Models (LLMs) in external knowledge, yet it suffers from significant computational overhead due to the length of retrieved contexts. Traditional context compression methods utilize fixed rates, often leading to information loss or unnecessary redundancy. This paper introduces ACC-RAG, a framework that employs adaptive context compression to dynamically adjust the amount of information processed based on query complexity. By combining a hierarchical compressor with a reinforcement learning-based adaptive selector, ACC-RAG achieves over a 4x speedup in inference while maintaining competitive accuracy across multiple benchmarks.
Introduction
Retrieval-Augmented Generation (RAG) has become the gold standard for providing LLMs with access to up-to-date, external knowledge. However, RAG systems face a significant "length problem." To ensure accuracy, these systems often retrieve thousands of tokens of context. Processing these long sequences is computationally expensive, increases latency, and can exceed the context window of the underlying LLM.
Existing solutions attempt to mitigate this through context compression, but most current methods rely on a fixed compression rate. This approach creates a "Goldilocks" dilemma: over-compression causes simple queries to lose essential details, while under-compression leaves complex queries with redundant data that wastes inference costs. ACC-RAG addresses this lack of adaptability by providing a system that delivers just enough information to answer a query—and no more.
The ACC-RAG Framework
ACC-RAG consists of two primary components designed to work in tandem to optimize the balance between brevity and detail:
- Hierarchical Compressor: Unlike standard compressors, this module is trained to organize information by importance. It encodes documents into "multi-granular" embeddings. Through a specific training objective, the model learns to place the most crucial information in the initial embeddings, with supplementary details following later.
- Adaptive Selector: This module acts as the system's decision-maker. During inference, it progressively feeds chunks of compressed embeddings to the LLM's decoder. After each chunk, the selector—a lightweight module trained via Reinforcement Learning—determines if the current information is sufficient to answer the question. If the information is sufficient, it stops (skimming); if not, it requests additional context.
Training Methodology
The system utilizes a two-stage training process to ensure information density and reasoning capability. The Pretraining stage uses auto-encoding and language modeling to preserve information within the compressed embeddings. The Fine-tuning stage employs self-distillation, where the compressed model learns to mimic the output distribution of a full-scale "teacher" RAG model. This approach was found to be superior to simple instruction-following for preserving the underlying reasoning capabilities of the decoder.
Experimental Setup
To ensure fair comparisons, the researchers utilized a unified benchmark and a standardized Wikipedia retrieval corpus containing 21 million documents. The framework was evaluated across five widely used QA benchmarks:
- Natural Questions (NQ)
- TriviaQA
- WebQuestions (WQ)
- CuratedTREC
- SQuAD v1.1
Additionally, the researchers conducted Out-of-Distribution (OOD) evaluations using HotpotQA and FEVER to ensure the model's ability to generalize to unseen domains.
Key Results and Insights
ACC-RAG demonstrates that much of the retrieved data in standard RAG systems is redundant. Key findings include:
- Significant Speedup: ACC-RAG achieved over a 4x faster inference time (measured by First Token Inference Time) compared to standard, non-compressed RAG systems.
- Maintained Accuracy: The model matched or exceeded standard RAG accuracy on four out of five datasets. For example, on the Natural Questions (NQ) dataset, it achieved a Match score of 41.11, compared to vanilla RAG's 44.49, but at a significantly lower computational cost.
- Context Efficiency: The model frequently reached peak accuracy using less than 60% of the available context embeddings, validating the "skimming" approach.
- Baseline Superiority: ACC-RAG consistently outperformed other state-of-the-art compression methods, such as ICAE and xRAG, in both effectiveness and efficiency.
Conclusion and Future Work
ACC-RAG successfully mimics human skimming behavior to optimize RAG efficiency, decoupling offline compression from online selection to allow for rapid, dynamic adjustments. While the current results are promising, the authors identify the Adaptive Selector as a potential bottleneck; if it stops too early, accuracy can suffer.
Future research will focus on joint end-to-end training of the compressor and selector to improve alignment. Additionally, while the framework was tested on 7B and 8B parameter models (Mistral and Llama 3), exploring its performance on frontier models and extremely long-form documents remains a priority for future exploration.
Summary updated