Abstract
As Document Visual Question Answering (DocVQA) transitions from single-page analysis to multi-page document understanding, computational efficiency and noise reduction have become critical challenges. This paper explores the application of Retrieval-Augmented Generation (RAG) to multi-page DocVQA. By retrieving only the most relevant document segments before generation, the proposed methods achieve performance gains of up to +22.5 ANLS over standard baselines. We evaluate two distinct pipelines—Textual RAG and Visual (OCR-free) RAG—demonstrating that retrieval-based strategies significantly mitigate memory overhead while improving accuracy across diverse benchmarks including MP-DocVQA, DUDE, and InfographicVQA.
Introduction
Early research in Document Visual Question Answering (DocVQA) primarily focused on single-page documents. However, real-world applications—such as legal contracts, technical manuals, and scientific papers—frequently involve documents spanning dozens or even hundreds of pages. Processing these multi-page documents presents a significant challenge for existing Vision-Language Models (VLMs).
Currently, state-of-the-art systems often employ a "brute force" approach, either concatenating OCR text from all pages or utilizing massive context windows. These methods are computationally expensive and memory-intensive. Furthermore, as document length increases, models often suffer from "distraction" by irrelevant content, leading to a decrease in performance. This study investigates whether RAG, a successful paradigm in text-only NLP, can be adapted to the multimodal document domain to solve these efficiency and accuracy bottlenecks.
Methodology
The authors propose two primary RAG architectures tailored for document understanding: Textual RAG and Visual RAG.
1. Textual RAG
This pipeline leverages OCR-extracted text and follows a traditional retrieval-then-generation flow:
- Indexing: Documents are segmented into textual chunks using a sliding window approach to preserve local context.
- Retrieval: A two-stage retrieval process is employed. First, a Bi-Encoder (bge-en-small-v1.5) performs a rapid search to identify candidate chunks. Second, a Cross-Encoder reranker refines these candidates to select the top k most relevant segments.
- Generation: The selected text segments and their corresponding image crops are passed to a generator model, such as the encoder-decoder VT5 or the larger Qwen2.5-VL-7B.
2. Visual RAG (OCR-free)
To address scenarios where high-quality OCR is unavailable or too costly, the authors developed a visual-only variant:
- Indexing: Document images are partitioned into horizontal patches.
- Retrieval: This stage utilizes a Pix2Struct vision transformer encoder. The text query is rendered as an image, and retrieval is performed via a ColBERT-style late interaction mechanism, matching query tokens to visual patch embeddings.
- Generation: The top-ranked image patches are concatenated and processed by a Pix2Struct generator.
Experimental Evaluation
The proposed methods were evaluated on three major multi-page benchmarks:
- MP-DocVQA: A multi-page extension of the standard DocVQA dataset, with sequences up to 20 pages.
- DUDE (Document Understanding Dataset and Evaluation): A dataset requiring multi-step reasoning and abstractive answering across diverse domains.
- InfographicVQA: A benchmark focused on visually rich infographics requiring reasoning over complex layouts and design elements.
Key Insights and Discussion
The Role of Reranking
Ablation studies highlight that the cross-encoder reranker is a critical component of the pipeline. By narrowing the context to only the most relevant information, the reranker significantly reduces the noise the generator must process, leading to substantial performance gains.
Chunking Strategies
Interestingly, the study found that layout-guided chunking (using Document Image Transformers to identify tables or paragraphs) performed worse than simple sliding windows. The authors suggest that layout-guided methods often lead to "over-segmentation," where complex structures are broken into pieces too small for the model to maintain necessary semantic context.
Viability of OCR-free RAG
While Textual RAG generally outperformed Visual RAG, the visual-only approach still yielded a +5.0 ANLS improvement on MP-DocVQA. This demonstrates that RAG is a viable strategy even in pixels-only scenarios, providing a path forward for documents with complex layouts where OCR might fail.
Results
The RAG-enhanced models demonstrated significant improvements across the board:
- State-of-the-Art Gains: On MP-DocVQA, the RAG-enhanced Qwen2.5-VL model improved the baseline by +22.5 ANLS, achieving a final score of 73.7.
- Model Agnostic Benefits: The smaller VT5 model saw consistent improvements, gaining +13.2 ANLS on MP-DocVQA and +10.6 on InfographicVQA.
- Efficiency: By utilizing retrieval, smaller models can achieve performance levels comparable to much larger models that attempt to process entire documents at once.
One notable exception occurred on the DUDE dataset, where Visual RAG saw a slight dip of -0.8 ANLS. This suggests that for documents requiring high-level global reasoning across the entire document, aggressive retrieval-based pruning may occasionally discard necessary information.
Conclusion and Future Work
This research confirms that RAG is a highly effective strategy for multi-page DocVQA, offering a scalable alternative to brute-force processing. However, challenges remain in performing complex cross-page reasoning where answers are synthesized from scattered data points.
Future work will focus on "context-aware" retrieval to ensure that retrieved patches include necessary structural elements, such as table headers or section titles. Additionally, further optimization of the late-interaction mechanism in Visual RAG could lead to even faster and more accurate visual retrieval systems.
Summary updated