Skip to main content
QUICK REVIEW

[Paper Review] xRAG: Extreme Context Compression for Retrieval-augmented Generation with One Token

Xin Cheng, Xun Wang|arXiv (Cornell University)|May 22, 2024
Advanced Image and Video Retrieval TechniquesComputer Science3 citations
TL;DR

xRAG proposes a novel retrieval-augmented generation framework that compresses document context to a single token by fusing dense retrieval embeddings directly into the language model's representation space via a modality bridge, achieving over 10% average improvement across six knowledge-intensive tasks while reducing FLOPs by 3.53× and matching uncompressed model performance on several benchmarks, with only the modality bridge as a trainable component.

ABSTRACT

This paper introduces xRAG, an innovative context compression method tailored for retrieval-augmented generation. xRAG reinterprets document embeddings in dense retrieval--traditionally used solely for retrieval--as features from the retrieval modality. By employing a modality fusion methodology, xRAG seamlessly integrates these embeddings into the language model representation space, effectively eliminating the need for their textual counterparts and achieving an extreme compression rate. In xRAG, the only trainable component is the modality bridge, while both the retriever and the language model remain frozen. This design choice allows for the reuse of offline-constructed document embeddings and preserves the plug-and-play nature of retrieval augmentation. Experimental results demonstrate that xRAG achieves an average improvement of over 10% across six knowledge-intensive tasks, adaptable to various language model backbones, ranging from a dense 7B model to an 8x7B Mixture of Experts configuration. xRAG not only significantly outperforms previous context compression methods but also matches the performance of uncompressed models on several datasets, while reducing overall FLOPs by a factor of 3.53. Our work pioneers new directions in retrieval-augmented generation from the perspective of multimodality fusion, and we hope it lays the foundation for future efficient and scalable retrieval-augmented systems

Motivation & Objective

  • To address the high inference cost and context length limitations in retrieval-augmented generation (RAG) caused by full document retrieval.
  • To explore a new paradigm in RAG by reinterpreting dense retrieval embeddings as a modality input, akin to vision-language fusion.
  • To achieve extreme context compression without sacrificing performance, enabling efficient, scalable, and plug-and-play RAG systems.
  • To preserve the plug-and-play nature of RAG by keeping both the retriever and language model frozen, relying only on a trainable modality bridge.

Proposed method

  • xRAG reinterprets dense retrieval embeddings as a modality signal, treating them analogously to vision features in multimodal models.
  • It introduces a modality bridge that fuses document embeddings into the language model’s hidden space, enabling the model to attend to retrieval signals without seeing the raw text.
  • The method eliminates the need for textual document context in prompts, compressing all retrieval information into a single [X] token.
  • Only the modality bridge is fine-tuned; the retriever and LLM remain frozen, enabling reuse of precomputed embeddings and preserving plug-and-play compatibility.
  • Training involves instruction tuning with multiple data types—reading comprehension, open-domain QA, and summarization—alongside self-distillation and language modeling objectives.
  • The framework supports various LLM backbones, including dense 7B and 8x7B Mixture-of-Experts models, with consistent performance gains.
Figure 1 : xRAG enables efficient retrieval augmentation by adding one document token [X] .
Figure 1 : xRAG enables efficient retrieval augmentation by adding one document token [X] .

Experimental results

Research questions

  • RQ1Can dense retrieval embeddings be treated as a modality input to enable extreme context compression in RAG?
  • RQ2How does modality fusion between embeddings and language models affect performance and efficiency in knowledge-intensive tasks?
  • RQ3Can a frozen LLM and retriever maintain high performance when only a modality bridge is fine-tuned?
  • RQ4What training strategies and data blends maximize robustness and performance in the compressed RAG setting?
  • RQ5How does xRAG handle retrieval failures compared to standard RAG, especially when documents are misleading?

Key findings

  • xRAG achieves an average performance improvement of over 10% across six knowledge-intensive tasks, including NQ, TriviaQA, and HotpotQA.
  • On the Mistral-7b model, xRAG reaches 44.58% average score, with 82.3% resilience to retrieval failures, outperforming standard RAG in robustness.
  • For Mixtral-8x7b, xRAG achieves 51.45% average score, matching the performance of uncompressed models on several datasets.
  • The method reduces total FLOPs by a factor of 3.53 compared to standard RAG, significantly improving inference efficiency.
  • Self-distillation during fine-tuning is more critical than language modeling loss, enhancing system resilience to retrieval errors.
  • Even when trained only on summarization data, xRAG generalizes well to QA tasks, indicating that performance gains stem from improved context utilization rather than task-specific knowledge.
Figure 2 : Overview of xRAG (a) and RAG (b). For a given query, RAG typically concatenates the retrieved document with the query, significantly extending the context length. In contrast, xRAG addresses this issue through modality fusion by directly projecting the document embedding into the LLM’s re
Figure 2 : Overview of xRAG (a) and RAG (b). For a given query, RAG typically concatenates the retrieved document with the query, significantly extending the context length. In contrast, xRAG addresses this issue through modality fusion by directly projecting the document embedding into the LLM’s re

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.