OSCAR: Online Soft Compression for RAG

Maxime Louis, Thibault Formal, Hervé Déjean, Stéphane ClinchantICLR 2026

TL;DR

OSCAR (Online Soft Compression for RAG) is a new method that speeds up Retrieval-Augmented Generation (RAG) by 2–5x with virtually no loss in accuracy. It achieves this by using a small "compressor" model to turn long retrieved documents into a few dense "soft" embeddings on-the-fly, tailored specifically to the user's query.

What Problem Does This Paper Address?

Retrieval-Augmented Generation (RAG) is the gold standard for giving Large Language Models (LLMs) up-to-date knowledge. However, RAG has a "context tax": the more documents you retrieve to ensure accuracy, the slower and more expensive the inference becomes because the LLM has to process thousands of extra tokens.

Current solutions fall into two camps, both with flaws:

  1. Hard Compression: These methods prune or summarize text (e.g., deleting "unimportant" sentences). They are fast and query-aware but offer limited compression (usually only ~2x).
  2. Soft Compression: These map text into mathematical embeddings (vectors). They offer high compression (~16x) but are usually "offline"—meaning they compress documents without knowing the user's query. This often leads to losing the specific information needed to answer a particular question.

The authors of OSCAR wanted to bridge this gap: a method that is soft (high compression), online (query-dependent), and fast enough to run in real-time.

Methods

OSCAR introduces a dual-model architecture consisting of a Compressor and a Generator.

OSCAR Architecture
  • The Compression Step: When a query comes in, the system retrieves relevant documents. Instead of feeding the full text to the main LLM, a smaller "Compressor" model takes the query and the document together. It outputs a small set of learnable "memory tokens" (e.g., turning 128 text tokens into just 8 embeddings).
  • Query-Dependence: Crucially, the compression is conditioned on the query. The compressor identifies what parts of the document are relevant right now and encodes that into the soft embeddings.
  • Architectures: The authors tested two versions:
  • OSCAR-N-Layers: Using just the first few layers (e.g., the first 5 or 8) of the main LLM as the compressor.
  • OSCAR-llama: Using a separate, tiny LLM (like Llama-3.2-1B) as a dedicated compressor.
  • Simultaneous Reranking: They added a special "Reranking Token" to the compressor. This allows the model to rank the documents' relevance at the same time it compresses them, making reranking essentially "free" in terms of computational cost.

Datasets

The models were trained using sequence-level distillation, where a large "Teacher" model (Mistral-7B) provided the target labels.

  • Training: 893k queries from MS MARCO and Wikipedia-KILT.
  • Evaluation: A wide battery of open-domain QA benchmarks including Natural Questions (NQ), TriviaQA, HotpotQA, ASQA, PopQA, and BIOASQ-12B.
  • Generalization: The BEIR benchmark (13 different datasets) was used to test how well the reranking and compression held up on unseen data.

Key Insights and Ideas

  • Soft is Better than Hard: Soft embeddings can capture more nuance than simply deleting words. OSCAR matches the accuracy of "no compression" models while using a fraction of the tokens.
  • The Query is Key: The "aha moment" here is that query-independent compression (compressing a document before you know the question) loses about 6% in accuracy. By making the compression query-dependent, OSCAR recovers that lost performance.
  • Efficiency Scales with Size: The larger the main LLM, the more you save. For a 24B parameter model, OSCAR achieved a nearly 5x speedup because the cost of the tiny compressor is negligible compared to the massive savings in the generator's attention mechanism.
  • Free Reranking: Because the compressor already has to "understand" the document-query relationship to compress it, adding a reranking head is a natural and highly efficient extension.

Key Results

Performance vs Efficiency
  • Speed: 2.2x to 4.8x end-to-end inference speedup across various model sizes (1B to 24B parameters).
  • Accuracy: On the Mistral-7B backbone, OSCAR achieved an average accuracy identical to the "no compression" baseline while being significantly faster than competing hard-compression methods like RECOMP or Provence. As seen in the performance chart, OSCAR models cluster in the top-left quadrant (faster and better) compared to the Mistral-7B baseline.
  • Memory: Reduced peak GPU memory usage by 50-75%, allowing for larger batch sizes or longer effective contexts on the same hardware.
  • Robustness: Even when the number of retrieved documents increased to 50 (roughly 7,000 tokens), OSCAR remained robust and efficient, whereas standard RAG models slowed down quadratically.

Limitations and Future Work

  • Backbone Specificity: Currently, an OSCAR compressor needs to be trained/tuned for a specific generator LLM. It isn't a "universal" plug-and-play compressor yet.
  • Interpretability: Because the output is "soft" (vectors), humans cannot read the compressed representation to see what information was kept or discarded, unlike text-based summarization.
  • Training Overhead: While inference is much faster, there is an initial cost to train the compressor via distillation (though the authors note this only takes 1–5 GPU days).

Future work could involve exploring even smaller compressor architectures or developing "universal" soft compressors that work across different families of LLMs.

Summary updated

BibTeX
@inproceedings{louis2026oscar,
  author = {Maxime Louis and Thibault Formal and Hervé Déjean and Stéphane Clinchant},
  title = {{OSCAR: Online Soft Compression for RAG}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=ideKAUWvFE},
}
Figure