TL;DR
This paper introduces OHRBench, a novel benchmark designed to evaluate how Optical Character Recognition (OCR) errors cascade and impact the performance of Retrieval-Augmented Generation (RAG) systems. The authors demonstrate that current OCR solutions are insufficient for building high-quality RAG knowledge bases and that both semantic and formatting noise introduced by OCR significantly degrade RAG performance.
What Problem Does This Paper Address?
Retrieval-Augmented Generation (RAG) is a powerful technique that enhances Large Language Models (LLMs) by providing them with external knowledge, reducing hallucinations and enabling them to access up-to-date information. A crucial step in building RAG systems involves extracting structured data from unstructured documents (like PDFs) using Optical Character Recognition (OCR). However, OCR is not perfect, and its errors, along with variations in how structured data is represented (e.g., tables in Markdown vs. LaTeX), introduce "noise" into the knowledge base. This noise can negatively affect RAG performance, but existing research has largely overlooked this cascading impact. The paper aims to fill this gap by systematically evaluating how OCR-induced noise affects different components of RAG systems and the overall system performance.
Methods
The core contribution of this paper is the introduction of OHRBench, a new benchmark specifically designed to assess the impact of OCR on RAG. OHRBench consists of:
- A diverse document collection: 8,561 unstructured PDF document images from seven real-world RAG application domains (Textbook, Law, Finance, Newspaper, Manual, Academic, Administration). These documents feature challenging OCR attributes like complex layouts, handwritten text, and multilingual content.
- Ground truth structured data: Human-verified annotations of the structured data within these documents.
- Q&A pairs: 8,498 question-answer pairs derived from multimodal elements (text, tables, formulas, charts) and reading order information within the documents. These Q&A pairs are designed to test various RAG tasks, including understanding and reasoning.
- Perturbed structured data: To simulate OCR noise, the authors introduce two primary types of noise:
- Semantic Noise: Mimics OCR prediction errors that alter the meaning of the content. This is achieved by applying realistic distortions to document images and then processing them with OCR.
- Formatting Noise: Simulates inconsistencies in structured data representation (e.g., variations in table formatting, spacing, bolding). This is introduced by applying heuristic rules to the ground truth structured data.
The authors then use OHRBench to:
- Benchmark current OCR solutions: Evaluate the performance of various OCR systems (pipeline-based, end-to-end, and Vision-Language Models) in generating structured data for RAG.
- Analyze the impact of OCR noise: Systematically evaluate how Semantic Noise and Formatting Noise, at varying levels, affect RAG performance across retrieval, generation, and end-to-end evaluation.
- Investigate table format impact: Examine how different table representations (Markdown, LaTeX, HTML) influence RAG performance.
Datasets
- OHRBench: A newly introduced benchmark dataset. It comprises 1,261 PDF documents, 8,561 document images, and 8,498 Q&A pairs. The dataset is notable for its focus on real-world RAG application domains and its inclusion of challenging OCR attributes and multimodal elements.
- Existing Datasets: The authors also leveraged existing datasets such as DUDE, OmniDocBench, FinanceBench, CUAD, and GNHK to build their document collection.
Key Insights and Ideas
- OCR is a significant bottleneck for RAG: The paper strongly suggests that the quality of OCR output directly and substantially impacts RAG performance. Current OCR solutions are not yet sufficient for creating high-quality knowledge bases for RAG.
- Semantic Noise is more detrimental than Formatting Noise: Increasing Semantic Noise leads to a sharp decline in RAG performance across the board. While Formatting Noise also degrades performance, its impact is more variable and often concentrated on multimodal questions.
- Larger LLMs are more robust to OCR noise: The study found that larger LLMs (like Qwen2-72B) exhibit greater resilience to OCR errors compared to smaller LLMs, particularly in handling Semantic Noise.
- Reading Order is a particular challenge for VLMs: Vision-Language Models (VLMs), despite their strong semantic understanding, struggle with accurately parsing and integrating information across multiple paragraphs for reading order tasks.
- Standard OCR metrics don't fully capture RAG impact: Edit distance, a common OCR metric, doesn't always correlate with RAG performance. This highlights the need for RAG-specific evaluation metrics and benchmarks.
Key Results
- OCR performance gap: Even the best OCR solutions exhibit a performance gap of at least 14% (in F1-score) compared to ground truth structured data for RAG tasks.
- Semantic Noise impact: Increasing Semantic Noise from mild to severe resulted in nearly a 50% performance decline for most retrievers and LLMs.
- Formatting Noise impact: Maximum performance losses for Formatting Noise reached up to 12.7% for retrieval and generation. Larger LLMs showed only a 7% performance reduction on multimodal questions.
- Table format impact: HTML tables showed inferior retrieval performance compared to Markdown and LaTeX.
- LLM robustness: Qwen2-72B demonstrated a 9.4% and 3.5% higher percentage of correct answers despite OCR errors in Formatting Noise and Semantic Noise, respectively, compared to Qwen2-7B.
Limitations and Future Work
- Limitations:
- The paper acknowledges that while they've introduced diverse OCR challenges, real-world scenarios might present even more complex noise patterns.
- The evaluation of OCR solutions is based on specific configurations and prompts, and further tuning might yield different results.
- Future Work:
- The authors believe OHRBench will facilitate the development of OCR solutions specifically tailored for RAG.
- It will also drive research into developing RAG systems that are more robust to OCR noise.
- Further exploration of the interplay between different types of OCR noise and their combined effects on RAG is suggested.
Summary updated