Abstract
Retrieval-Augmented Generation (RAG) has become the standard for grounding Large Language Models (LLMs) in external, up-to-date knowledge. However, the computational cost of processing long retrieved contexts grows quadratically, creating a significant "RAG tax" in terms of latency and inference cost. We present PISCO (Pretty Simple COmpression), a "soft" compression method that achieves a 16x reduction in context size with a negligible accuracy loss of 0–3%. Unlike existing methods that require extensive pretraining, PISCO utilizes a streamlined distillation process, enabling the fine-tuning of 7-10B parameter models in under 48 hours on a single A100 GPU.
Introduction
While RAG improves model accuracy by providing domain-specific data, it is constrained by the finite context windows of LLMs and the high cost of processing numerous tokens. Existing compression techniques generally fall into two categories: hard compression, which involves deleting words or summarizing text (typically limited to 2x–5x reduction), and soft compression, which transforms text into dense vector "summary" tokens.
Soft compression offers higher potential reduction rates but has historically suffered from significant accuracy drops (often >8%) and complex, multi-stage pretraining requirements. PISCO addresses these challenges by simplifying the soft compression pipeline, removing the need for pretraining while maintaining high fidelity to the original text.
The PISCO Architecture
PISCO’s architecture is designed for efficiency and ease of implementation, consisting of two primary components:
- The Compressor: Utilizing a backbone language model (such as Mistral-7B) equipped with LoRA adapters and specialized "memory tokens." The compressor processes 128-token document chunks and condenses them into a small set of embeddings—for example, 8 vectors for a 16x compression rate.
- The Decoder: The LLM responsible for generating the final answer. A key innovation in PISCO is that the decoder’s LoRA adapters are fine-tuned alongside the compressor. This joint training allows the decoder to learn how to interpret the new, dense compressed representations effectively.
Sequence-level Knowledge Distillation (SKD)
The core of PISCO’s training efficiency is Sequence-level Knowledge Distillation. Rather than training the model on standard next-token prediction or auto-encoding tasks, PISCO employs a "Teacher" LLM. The teacher generates answers based on the full, uncompressed documents. The "Student" (PISCO) is then trained to replicate these answers using only the compressed embeddings. This ensures that the compression is optimized specifically for the downstream task of question answering.
Experimental Evaluation
The authors evaluated PISCO across a diverse set of benchmarks to ensure robustness and versatility:
- General QA: Natural Questions (NQ), TriviaQA, HotpotQA, ASQA, and PopQA.
- Robustness (Out-of-Domain): Bio-QA, Covid-QA, ParaphraseRC, and LoTTE subsets (Lifestyle, Writing, Science, etc.).
- Multilingual Capabilities: MKQA (French, Russian, and Korean).
- Training Data: 453k questions derived from Wikipedia-KILT.
Key Insights
The Role of Pretraining and Decoder Tuning
A significant finding of the study is that standard pretraining tasks, such as text continuation, provide minimal benefit to final QA performance in a compression context. Direct distillation proved both more efficient and more effective. Furthermore, the study highlights that freezing the decoder—a common practice in previous work to maintain "plug-and-play" compatibility—is detrimental. Fine-tuning the decoder is essential for it to accurately "read" the compressed memory tokens.
Spatial Specialization
Through "logit lens" analysis, the researchers discovered that memory tokens naturally specialize. Each token learns to focus on a specific spatial segment of the original document (e.g., Token 1 focuses on the beginning, while Token 8 focuses on the end). This emergent behavior effectively partitions the information, allowing for high-density storage without significant data loss.
Results
PISCO demonstrates state-of-the-art performance across several metrics:
- Accuracy: PISCO outperforms previous state-of-the-art methods like COCOM by an average of 8% in absolute accuracy. At 16x compression, it maintains performance within 0–3% of the uncompressed backbone model.
- Efficiency: The method provides a 5.7x inference speedup compared to standard Mistral-7B and supports a 4x larger maximum batch size due to the reduced KV cache requirements.
- Scalability: The framework is backbone-agnostic, showing consistent results across Mistral-7B, Llama-3.1-8B, and Solar-10.7B.
Limitations and Future Work
Despite its strengths, PISCO faces challenges in specific reasoning tasks like ParaphraseRC, where performance drops reached 10%. Additionally, while the model generalizes to multiple languages, the performance gap is wider than in English, likely due to the English-centric nature of the underlying backbones. Future research will explore "elastic" compression, allowing the model to dynamically adjust the number of memory tokens based on the complexity of the input document.
Conclusion
PISCO provides a practical, high-performance solution for reducing the overhead of RAG systems. By eliminating the need for massive pretraining and focusing on joint distillation, it offers a "drop-in" replacement that significantly cuts latency and costs while preserving the reasoning capabilities of modern LLMs.
Summary updated