Abstract
Large Language Models (LLMs) often struggle with the "lost in the middle" phenomenon and high computational costs when processing long contexts. ATACompressor (Adaptive Task-Aware Compressor) addresses these challenges by dynamically identifying task-relevant information and adjusting compression rates on the fly. By combining a query-aware selective encoder with an adaptive controller, the framework achieves state-of-the-art performance on long-context QA tasks while maintaining significantly higher compression ratios than fixed-rate alternatives.
Introduction: The Challenge of Long Contexts
As LLMs are increasingly deployed in Retrieval-Augmented Generation (RAG) systems, they must handle massive contexts. However, processing thousands of tokens introduces significant overhead and often leads to performance degradation when critical information is buried.
Existing compression methods generally fall into two categories: Hard Prompt Compression, which deletes tokens but loses semantic nuance, and Soft Prompt Compression, which squashes text into summary vectors. Traditional soft compression is typically static, applying the same compression rate regardless of information density. This leads to either "information dilution" (wasted space) or "suffocation" (loss of complex details).
Methodology: Adaptive Task-Aware Compression
ATACompressor introduces a dynamic approach to resource allocation through two primary components:
- Selective Encoder: This component is "task-aware," using the user's query to extract and compress only the context necessary for the specific question. It utilizes a frozen LLM backbone enhanced with trainable LoRA (Low-Rank Adaptation) parameters for efficient training.
- Adaptive Allocation Controller (AAC): Acting as the system's "brain," the AAC uses a lightweight probe to analyze the encoder’s hidden states. It estimates the length of relevant content and employs a Policy Function to determine the optimal number of compressed tokens ($k$) to output.
The system follows a two-stage training process. In Pretraining, the encoder is optimized to reconstruct relevant text while the probe learns to predict length. In Finetuning, the model is optimized for downstream tasks like Question Answering (QA).
Experimental Evaluation
The model was evaluated using LLaMA-2-7B and Qwen-2-7B backbones across several benchmarks:
- HotpotQA: Document-level aggregation.
- MSMARCO: Passage-level synthesis.
- SQuAD: Sentence-level pinpointing.
- LongBench: Cross-task generalization.
Key Results
- Superior Accuracy: On HotpotQA, ATACompressor achieved an Exact Match (EM) score of 65.49, significantly outperforming the next best compressor (51.50) and the uncompressed baseline (39.73).
- High Efficiency: The framework achieved compression ratios (CR) of up to 27x while maintaining high throughput.
- Robustness: Ablation studies showed that as the token budget decreases, ATACompressor's performance degrades much more slowly than competitors like ICAE or 500Compressor.
Insights and Discussion
The core innovation of ATACompressor is the recognition that information density is non-uniform. By allowing the model to decide its own memory allocation based on complexity, it avoids the pitfalls of fixed-rate compression. Furthermore, the research demonstrates that an LLM's internal hidden states contain sufficient signals to accurately estimate the volume of useful information processed.
However, some limitations remain. The system's effectiveness is tied to the initial chunking strategy, and performance on very short texts can occasionally suffer if the policy allocates too few tokens. Future work may explore making the initial chunking process dynamic or learnable.
Conclusion
ATACompressor represents a significant step toward efficient long-context processing. By making compression adaptive and task-aware, it allows LLMs to remain accurate even at high compression ratios, making them more viable for real-time, large-scale applications.
Summary updated