ATACompressor: Adaptive Task-Aware Compression for Efficient Long-Context Processing in LLMs
Xuancheng Li, Haitao Li, Yujia Zhou, Qingyao Ai, Yiqun Liu
TL;DR
ATACompressor tackles long-context processing in LLMs by jointly learning a selective encoder and an adaptive allocation controller to compress only task-relevant content. The method integrates a frozen LLM with LoRA within a trainable selective encoder and uses a lightweight probe to estimate the length of relevant content, dynamically allocating compression tokens via a policy. Empirical results on HotpotQA, MSMARCO, and SQUAD show superior QA performance, higher compression ratios, and competitive throughput compared to strong baselines, with ablations confirming the importance of both selective encoding and adaptive allocation. The approach offers a scalable, efficient solution for dynamic long-context handling in retrieval-augmented and other Long-Context scenarios, enabling better resource utilization in real-world applications.
Abstract
Long-context inputs in large language models (LLMs) often suffer from the "lost in the middle" problem, where critical information becomes diluted or ignored due to excessive length. Context compression methods aim to address this by reducing input size, but existing approaches struggle with balancing information preservation and compression efficiency. We propose Adaptive Task-Aware Compressor (ATACompressor), which dynamically adjusts compression based on the specific requirements of the task. ATACompressor employs a selective encoder that compresses only the task-relevant portions of long contexts, ensuring that essential information is preserved while reducing unnecessary content. Its adaptive allocation controller perceives the length of relevant content and adjusts the compression rate accordingly, optimizing resource utilization. We evaluate ATACompressor on three QA datasets: HotpotQA, MSMARCO, and SQUAD-showing that it outperforms existing methods in terms of both compression efficiency and task performance. Our approach provides a scalable solution for long-context processing in LLMs. Furthermore, we perform a range of ablation studies and analysis experiments to gain deeper insights into the key components of ATACompressor.
