TL;DR
Current document question-answering systems force a false dichotomy: treat pages as plain text and miss visual figures, or treat pages as pure images and miss dense textual nuances. CMRAG (Co-Modality–based Retrieval-Augmented Generation) bridges this divide by embedding queries, parsed text, and page images into a single shared vector space and statistically calibrating cross-modal similarity scores for joint retrieval and generation.
What Problem Does This Paper Address?
Real-world documents—such as financial filings, research papers, and slide decks—are intrinsically multimodal, containing mixtures of running text, tabular data, diagrams, and formatting layouts.
Existing Retrieval-Augmented Generation (RAG) approaches typically fall into one of two polarized paradigms:
- Text-based RAG: Uses layout engines and OCR to extract text, which an LLM reasons over. This approach struggles with infographics, charts, and spatial relationships.
- Vision-based RAG: Treats entire pages as images and passes them to Vision-Language Models (VLMs). While this preserves layout and diagrams, visual encoders often fail to resolve fine-grained numerical details or dense, small-font text.
CMRAG addresses this gap by simultaneously exploiting both text and image modalities during both retrieval and answer generation.
Methods
CMRAG introduces a cohesive pipeline that parses documents offline and executes online retrieval with minimal added overhead:
Document Page ──► VLM Parser ──► Page Image (I) + Structured HTML (T)
│ │
[Frozen E^I] [Trained E^T]
▼ ▼
Query (q) ─────► [Frozen E^q] ──► Inner Product z^I Inner Product z^T
│ │
▼ ▼
Sigmoid + Z-Score Sigmoid + Z-Score
└──────────┬───────────┘
▼
Fused Score: s̃_i
- Unified Encoding Model (UEM): Built on the SigLIP architecture, UEM aligns three representations in a shared $d=1152$ latent space: a query embedding $\mathbf{q} = \mathcal{E}^q(q)$, an image embedding $\mathbf{I} = \mathcal{E}^I(I)$, and a document text embedding $\mathbf{T} = \mathcal{E}^T(T)$. To retain pre-trained multimodal alignment, $\mathcal{E}^q$ and $\mathcal{E}^I$ remain frozen, while $\mathcal{E}^T$ is initialized from $\mathcal{E}^q$, sequence-extended to 768 tokens, and trained using a Dual-Sigmoid Alignment (DSA) loss across query–text and query–image pairs.
-
Unified Co-Modality–Informed Retrieval (UCMR): Raw inner products across different modalities cannot simply be summed, as their underlying scales and variances differ. UCMR first maps scores to $[0, 1]$ via a sigmoid function, applies Z-score standardization across the corpus to force both modalities into comparable Gaussian distributions, and fuses them: $$\tilde{s}_i = \beta \tilde{z}_i^T + (1 - \beta) \tilde{z}_i^I$$ Setting $\beta = 0.1$ treats the complete page image as the primary context while using textual semantics for fine-grained disambiguation.
-
Co-Modality Generation: The top-$k$ retrieved page images and corresponding structured texts are packed alongside the user prompt and passed to a generative VLM (
Qwen2.5-VL-7B-Instruct). - Negligible Online Latency: Documents are parsed and indexed offline. At inference time, the query is encoded only once by $\mathcal{E}^q$, meaning the online computational cost remains dominated by a single forward pass.
Datasets
- Training Data: Synthesized from VisRAG's corpus of college textbooks, ICML/NeurIPS papers, and product manuals. The authors re-parsed approximately 40,000 pages using
Qwen2.5-VL-7Binto structured HTML and sub-images, creating an aligned dataset of 239,358 (query, text, image) triplets. - Evaluation Benchmarks: Evaluated across diverse real-world distributions:
- MMLongBench-Doc (1,082 queries over multi-page documents).
- REAL-MM-RAG across four distinct domains: FinReport, FinSlides, TechReport, and TechSlides.
- LongDocURL (sampled subset of 770 queries over 134 long multi-page documents).
Key Insights and Ideas
- Modality Strengths are Domain-Dependent: Pure text retrievers (
BGE) perform strongly on dense, report-style documents (e.g., 49.62% MRR@10 on FinReport), whereas visual retrievers (SigLIP) dominate visually rich layouts like presentations (71.88% MRR@10 on TechSlides). Combining both eliminates either approach's blind spots. - Score Fusion Requires Statistical Normalization: Unnormalized linear combinations fail because raw dot products inhabit incompatible distributions. Applying sigmoid plus Z-score normalization reduced the Kullback–Leibler divergence between query–image and query–text score distributions to near zero ($D_{\text{KL}} \le 0.132$), preventing one modality from skewing the rankings.
- Bigger Pre-training Doesn't Guarantee Retrieval Transfer: Surprisingly,
SigLIP2collapsed across document retrieval tasks ($<7\%$ MRR@10 on most benchmarks). Its pretraining focus on dense localization and multilingual web-captioning made its representations less suitable for structured document ranking than original SigLIP. - Context Overload is Real: Oracle experiments revealed that feeding both ground-truth text and images occasionally harmed performance on unanswerable questions (e.g., in MMLongBench) by prompting the generator to hallucinate answers rather than abstaining.
Key Results
- Retrieval (MRR@10): CMRAG-R outperformed both text-only (
BGE) and vision-only (SigLIP,CLIP) models across all six benchmarks: - FinSlides: 67.97% (vs. 62.45% for SigLIP; 32.55% for BGE).
- TechSlides: 78.10% (vs. 71.88% for SigLIP; 65.01% for BGE).
- TechReport: 47.22% (vs. 45.37% for SigLIP).
- LongDocURL: 58.30% (vs. 57.74% for SigLIP; 11.69% for BGE).
- Ablation on Normalization: Removing the Z-score normalization in UCMR led to sharp drops in retrieval performance across all datasets (e.g., dropping from 41.85% to 29.67% on FinReport and 47.22% to 31.12% on TechReport).
- Downstream QA Generation: Using top-3 retrieved items, CMRAG surpassed visual baselines across tasks (e.g., 60.46% vs. 55.99% on FinSlides; 45.60% vs. 41.65% on TechReport).
Limitations and Future Work
- Training Scale: UEM was trained on a synthetic dataset of ~240k pairs. A two-encoder ensemble baseline (
SigLIP + BGE) yielded even higher retrieval accuracy, indicating that UEM's shared representation has not yet saturated and will benefit from larger-scale pretraining. - Static Fusion Weights: The textual weighting factor ($\beta = 0.1$) is fixed across all document formats, even though reports lean heavily textual and slide decks lean visual.
- Dynamic Modality Gating: Because providing too much textual context can degrade performance on unanswerable queries, the authors highlight adaptive, query-dependent context control as an essential area for future research.
Summary updated