Abstract
Context window limitations and the quadratic complexity of attention mechanisms remain significant hurdles for Large Language Models (LLMs). We present ARC-Encoder, a "plug-and-play" context compressor that reduces long text into 4x to 8x fewer continuous representations. Crucially, ARC-Encoder operates with frozen LLMs, maintaining their general reasoning capabilities while reducing inference costs and extending effective context. Our results show that ARC-Encoder achieves near-lossless compression and outperforms existing soft-compression techniques across various benchmarks.
Introduction
The demand for LLMs to process extensive documents—for Retrieval-Augmented Generation (RAG) or multi-step reasoning—is constrained by the computational cost of Transformer attention. Existing compression methods often force a trade-off between semantic fidelity (hard compression) and model integrity (soft compression requiring fine-tuning). ARC-Encoder bridges this gap by providing a high-fidelity soft compressor that is natively interpretable by unmodified, frozen LLMs.
Methodology
ARC-Encoder consists of a text encoder based on a truncated Llama 3.2 3B architecture and a lightweight MLP projector. The system's performance is driven by three key design choices.
Query Pooling
To achieve compression without losing context, ARC-Encoder employs query pooling within the final self-attention module. By averaging consecutive queries while preserving the original keys and values, the model produces a condensed set of output tokens that retain full attention over the input context.
Training Strategy
The model is trained using a two-stage approach: Reconstruction, which ensures the encoder captures comprehensive textual details, and Continuation, which aligns the encoder's output with the decoder's requirements for next-token prediction.
Cross-Model Adaptation
A notable feature of ARC-Encoder is its portability. A single encoder can be utilized across different LLM architectures (e.g., Mistral, Llama 3.1) by training a minimal MLP projector, which accounts for less than 1% of the total parameters.
Evaluation and Results
ARC-Encoder was evaluated using a diverse data stack, including 2.6 billion pretraining tokens from Common Crawl and fine-tuning on benchmarks such as HotpotQA, SQuAD, and CNN-DailyMail.
At a 4x pooling factor, ARC-Encoder maintains performance levels comparable to uncompressed baselines. As shown in the results table below, it consistently exceeds the performance of state-of-the-art soft-compression methods like ICAE and xRAG, particularly in fact-intensive tasks.
Furthermore, the encoder enables significant context extension. For instance, a Llama 2 7B model equipped with ARC-Encoder could process up to 8x its native input limit, resulting in marked improvements in long-form question answering.
Discussion
While ARC-Encoder offers substantial inference speedups (1.8x in prefilling), it introduces a storage trade-off; compressed vectors currently require more disk space than raw text (e.g., 80 GiB for Wikipedia vs. 24 GiB raw text). Future work will explore higher compression ratios and the development of universal representations that eliminate the need for model-specific MLP adaptation.
Summary updated