TL;DR
Prompt compression typically relies on training a Low-Rank Adaptation (LoRA) over the inference large language model (LLM) to act as an encoder, mirroring the LLM's full architecture. The Attention-Only Compressor (AOC) shows this architectural symmetry is unnecessary: removing all Multi-Layer Perceptron (MLP) layers cuts encoder parameters by roughly 67% while beating full-model LoRA baselines in prompt regeneration across compression ratios up to 480×.
What Problem Does This Paper Address?
As LLM prompts grow longer to accommodate detailed instructions and many-shot examples, computational costs and inference latency surge. Latent prompt compression addresses this by using an encoder to squeeze long prompts into a tiny set of learned memory tokens (or attention key-value caches) that a frozen decoder LLM can read.
However, state-of-the-art latent compressors (such as ICAE and 500xCompressor) typically adapt the original decoder LLM using LoRA to serve as the compression encoder. This assumes the encoder requires the full, heavy architecture of the decoder model. The authors ask a fundamental question: Does a prompt compression encoder actually need the same structure as the generative LLM it serves?
Methods
The authors introduce AOC (Attention-Only Compressor), which decouples encoder architecture from the decoder:
- MLP Stripping: In each Transformer block of the encoder, the multi-layer perceptron (MLP) is replaced by an identity mapping, leaving only layer normalizations and Multi-Head Attention (MHA). This eliminates roughly 67% of the encoder's parameters.
- Prompt Encoding into KV-Pairs: The prompt tokens $X_n$ are concatenated with $m$ learned memory tokens $Y_m$. The attention-only encoder outputs layer-wise key-value pairs $Z$ corresponding only to these memory tokens (following the 500xCompressor framework).
- Decoding & Training: The compressed latent representation $Z$ is prepended to a single
[BOS]token and fed into the original, completely frozen decoder LLM (Llama 3.2 1B Instruct) to reconstruct the original text. The encoder is trained end-to-end via standard cross-entropy loss. - Full Training vs. LoRA: Instead of applying LoRA to the trimmed encoder, the authors fully train the remaining attention-only weights. (They also test an ablated version, LoRA-AOC, where LoRA is applied to the attention-only backbone).
Datasets
- arXiv Abstracts Dataset: Models were trained on 300,000 arXiv paper abstracts submitted before July 1, 2023.
- Validation and Testing: Evaluated on 3,000 validation abstracts and 3,000 held-out test abstracts submitted after January 4, 2024 (strictly after Llama 3.2's December 2023 training cutoff).
- No new benchmark was created; evaluations strictly follow splits and regeneration tasks from prior work (500xCompressor, ICAE).
Key Insights and Ideas
- Attention Is (Actually) All You Need for Compression: MLPs in LLMs are heavily responsible for parametric factual knowledge and feed-forward transformation. Prompt compression, however, is largely an information routing and aggregation task—a role naturally suited to attention mechanisms alone.
- LoRA Needs MLPs to Function Well: Applying LoRA to the attention-only encoder (LoRA-AOC) caused severe performance drops. This suggests that parameter-efficient fine-tuning relies heavily on the frozen expressiveness of underlying MLPs, whereas fully training the attention-only layers yields a far superior compressor.
- Continuous Latent Semantics: Linearly interpolating between the latent KV caches of two distinct compressed prompts produces coherent, intermediate blended generations without any classifier guidance (e.g., transitioning smoothly from "awesome new idea" to "amazing new planet" to "many moons").
Key Results
Across prompt lengths $n \in \{96, 192, 288, 384, 480\}$ and memory tokens $m \in \{1, 4, 16\}$, AOC was compared against 500xCompressor and LoRA-AOC using BLEU, Exact Match prefix proportion (EM), and ROUGE-L:
- 16 Memory Tokens ($m=16$): At prompt length $n=480$ (30× compression), AOC significantly outperformed 500xCompressor:
- BLEU: 0.823 vs. 0.588
- EM: 0.483 vs. 0.082 (nearly a $6\times$ improvement in exact prefix recovery)
- ROUGE-L: 0.893 vs. 0.746
- 4 Memory Tokens ($m=4$): At $n=480$ (120× compression), AOC scored 0.343 BLEU / 0.587 ROUGE-L compared to 500xCompressor’s 0.241 BLEU / 0.508 ROUGE-L.
- Extreme Compression ($m=1$): At 480× compression, both models performed comparably but degraded significantly (BLEU ~0.09-0.10), which the authors attribute to under-training under tight computational limits.
Limitations and Future Work
- Memory Footprint Trade-off: Because AOC fully trains the encoder rather than sharing frozen weights with LoRA adapters, both the frozen decoder and the separate attention-only encoder must reside in memory.
- Compute and Scope Constraints: Experiments were limited to a single 1B model (Llama 3.2 1B Instruct) trained on an arXiv text reconstruction task using a single NVIDIA A6000 GPU.
- Downstream Task Evaluation: The paper evaluated text regeneration rather than downstream task completion (e.g., question answering or summarization from compressed context).
- Future Directions: The authors advocate exploring more radical, custom encoder architectures for prompt compression, scaling to larger models and diverse datasets, and exploiting the latent space for semantic prompt merging.
Summary updated