Introduction
As Large Language Models (LLMs) evolve into Vision Language Models (VLMs), the ability to process and understand long-form documents in their native visual format—complete with charts, tables, and complex layouts—has become a critical frontier. While text-based "Needle in a Haystack" tests are standard for LLMs, existing multimodal benchmarks often fall short by using truncated documents or pre-extracted text. To address this, we introduce Document Haystack, a large-scale benchmark designed to evaluate VLMs on their ability to retrieve specific information buried within visually complex documents up to 200 pages in length.
The Document Haystack Benchmark
The core of the Document Haystack methodology is the strategic insertion of "needles"—specific key-value pairs—into real-world documents at varying depths and spatial positions. Unlike traditional benchmarks, this study evaluates two distinct retrieval scenarios:
- Text Needles: A text-based fact is overlaid onto a document page.
- Text+Image Needles: The key is text, but the value is a small image, requiring the model to integrate visual and textual understanding to succeed.
The benchmark utilizes 25 publicly available financial 10-K reports, trimmed into sizes ranging from 5 to 200 pages. This setup allows for a granular analysis of how performance scales with context length and information depth.
Experimental Setup
The researchers evaluated three prominent models: Amazon Nova Lite, Google Gemini 2.0-Flash, and OpenAI GPT-4o-mini. To isolate the impact of visual processing, documents were provided in three formats: original PDF, page-wise images (200 DPI), and parsed plain text. This multi-format approach reveals a "Visual Tax"—the performance penalty incurred when a model must "see" the document rather than read a text-only version. For a 200-page document, accuracy can drop by approximately 30% just by switching from text to image input.
Analysis of Model Performance
The study reveals a significant "multimodal gap." While top-tier models like Nova Lite achieve over 90% accuracy in retrieving text-based needles from 200-page image streams, their accuracy plummets to approximately 40% when the target information is an image rather than text.
As shown in the performance heatmaps, accuracy generally trends downward as document length increases. Furthermore, a mild "lost in the middle" effect was observed, where models struggle more with information placed in the center of a long document compared to the beginning or end.
Token Density and Efficiency
A key finding involves the trade-off between token density and retrieval detail. Amazon Nova Lite utilizes a high-detail representation (~1,626 tokens per image), which contributes to its superior performance in text-in-image extraction. Conversely, Google Gemini 2.0-Flash uses a much more compact representation (258 tokens per image). While Gemini's lower resolution can lead to missed details, its efficiency appears to offer more robustness for certain image-based needles in extremely long contexts.
Conclusion and Future Directions
Document Haystack highlights that while current VLMs are becoming proficient at visual text extraction, true multimodal integration remains a significant challenge. The 60% drop in accuracy for image-based retrieval suggests that models are not yet "seeing" images with the same fidelity they "read" text.
Future work must address the latency hurdles associated with processing hundreds of high-resolution images and move toward native PDF support. Ultimately, the goal is to transition from simple retrieval tasks to complex reasoning that requires synthesizing visual information across multiple pages of a document.
Summary updated