Abstract
UniversalRAG is a novel framework designed to extend Retrieval-Augmented Generation (RAG) across diverse modalities—including text, images, videos, and tables—and multiple levels of granularity. By employing a "modality-aware router," the system overcomes the "modality gap" inherent in unified embedding spaces, ensuring that queries are matched with the most relevant knowledge sources regardless of their format.
Introduction
Retrieval-Augmented Generation (RAG) has significantly enhanced the capabilities of Large Language Models (LLMs) by providing access to external knowledge. However, current RAG systems are often "siloed," typically restricted to single-modality (usually text) or single-granularity corpora. Attempts to create multimodal RAG systems by forcing different data types into a unified embedding space face two primary challenges: the modality gap and granularity mismatch.
The modality gap refers to the tendency of models to cluster items by format rather than semantic meaning in unified vector spaces. Consequently, a text query might disproportionately retrieve text results even when an image or video contains the correct answer. Granularity mismatch occurs because different queries require different "zoom levels"—ranging from a single paragraph to a full-length document or video.
The Modality Gap Problem
Visualizations using t-SNE and PCA confirm that even state-of-the-art unified encoders struggle to merge modalities effectively. As shown in Figure 2, queries tend to be pulled toward their own modality, creating a statistical bias that hinders cross-modal retrieval.
Methodology: The UniversalRAG Framework
UniversalRAG addresses these issues through a two-stage "Route-then-Retrieve" workflow:
- Modality-Aware Routing: A router module analyzes the query to predict the necessary modalities (Text, Image, Video, Table) and granularities. This router can be a specialized small model (e.g., a 1B-parameter InternVL) or a prompted frontier model like GPT-4o.
- Targeted Retrieval: Based on the router's decision, the system searches within modality-specific indices. This approach bypasses the modality gap by maintaining separate, specialized embedding spaces.
- Multi-Granularity Organization: Data is indexed at multiple levels, such as paragraphs and full documents for text, or short clips and full-length files for video.
- Ensemble Strategy: To ensure robustness, the framework can ensemble trained routers with training-free prompted models.
Experimental Setup
The framework was evaluated across 10 benchmarks covering various modalities:
- Text: Natural Questions (NQ), HotpotQA.
- Table + Text: HybridQA.
- Image: MRAG-Bench.
- Image + Text: WebQA, InfoSeek.
- Video: LVBench, VideoRAG-Wiki, VideoRAG-Synth.
- General Knowledge: MMLU.
Out-of-Domain (OOD) performance was also tested using datasets like TruthfulQA and CinePile to verify the router's generalization capabilities.
Key Results
UniversalRAG demonstrates significant improvements over existing baselines:
- Superior Accuracy: It achieved an average score of 42.40, outperforming the best unified baseline, MultiRAG (34.07).
- Routing Precision: The router achieved over 95% accuracy in modality selection.
- Efficiency: Theoretical analysis indicates that as corpus size grows beyond 10 million entries, UniversalRAG's targeted search becomes faster than unified embedding methods due to its constrained search space.
- Cross-Modal Synergy: The system effectively synthesized information from multiple sources, such as combining tables and text in HybridQA.
Conclusion and Future Work
UniversalRAG provides a scalable and effective solution for multimodal RAG. While highly successful, the system's performance is tied to the router's initial decision. Future work will explore more granular hierarchies (e.g., sentences vs. chapters) and iterative routing mechanisms to handle potential initial misclassifications.
Summary updated