huybrechtsg commited on
Commit
7fadaf8
·
verified ·
1 Parent(s): a00fca2

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +193 -3
README.md CHANGED
@@ -1,3 +1,193 @@
1
- ---
2
- license: cc-by-nc-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Document Haystack Dataset
2
+
3
+ This repository contains the dataset for the paper "Document Haystack: A Long Context Multimodal Image/Document Understanding Vision LLM Benchmark".
4
+
5
+ ---
6
+
7
+ ## 📑 Abstract Paper
8
+
9
+ The proliferation of multimodal Large Language Models has significantly advanced the ability to analyze and understand complex data inputs from different modalities. However, the processing of long documents remains under-explored, largely due to a lack of suitable benchmarks. To address this, we introduce Document Haystack, a comprehensive benchmark designed to evaluate the performance of Vision Language Models (VLMs) on long, visually complex documents. Document Haystack features documents ranging from 5 to 200 pages and strategically inserts pure text or multimodal text+image "needles" at various depths within the documents to challenge VLMs' retrieval capabilities. Comprising 400 document variants and a total of 8,250 questions, it is supported by an objective, automated evaluation framework. We detail the construction and characteristics of the Document Haystack dataset, present results from prominent VLMs and discuss potential research avenues in this area.
10
+
11
+ ---
12
+
13
+ ## 🗂️ Overview
14
+
15
+ **Document Haystack** is a comprehensive benchmark dataset designed to evaluate the **long-context retrieval** and **multimodal document understanding** capabilities of Vision Language Models (VLMs).
16
+
17
+ It expands on the *Needle in a Haystack* concept by embedding *needles* — short key-value statements in pure text or as multimodal text+image snippets — within real-world long documents (5–200 pages). These needles test whether models can **locate specific information** hidden deep inside long, complex documents with textual, visual or mixed content.
18
+
19
+ ---
20
+
21
+ ## ✅ Key Features
22
+
23
+ - **Document Lengths:** 5, 10, 25, 50, 75, 100, 150, 200 pages
24
+ - **Total Documents:** 400 document variants
25
+ - **Total Questions:** 8,250 unique retrieval queries
26
+ - **Needle Types:**
27
+ - *Text Needles*: Pure text (e.g., “The secret sport is *basketball*.”)
28
+ - *Text+Image Needles*: The value is shown as an image (e.g., “The secret sport is *<image of basketball>*.”)
29
+ - **Formats Provided:**
30
+ - Original PDF
31
+ - Page-wise images (200 DPI)
32
+ - Parsed plain text (for text needles only)
33
+
34
+ ---
35
+
36
+ ## 📊 Document Haystack Characteristics
37
+
38
+ | # Pages | 5 | 10 | 25 | 50 | 75 | 100 | 150 | 200 | Total |
39
+ |----------------|-----|-----|------|------|------|-------|-------|-------|-------|
40
+ | Text Needles # Documents | 25 | 25 | 25 | 25 | 25 | 25 | 25 | 25 | 200 |
41
+ | Text Needles # Questions | 125 | 250 | 625 | 625 | 625 | 625 | 625 | 625 | 4125 |
42
+ | Text+Image Needles # Documents | 25 | 25 | 25 | 25 | 25 | 25 | 25 | 25 | 200 |
43
+ | Text+Image Needles # Questions | 125 | 250 | 625 | 625 | 625 | 625 | 625 | 625 | 4125 |
44
+ | **Total Documents** | **50** | **50** | **50** | **50** | **50** | **50** | **50** | **50** | **400** |
45
+ | **Total Questions** | **250** | **500** | **1250** | **1250** | **1250** | **1250** | **1250** | **1250** | **8250** |
46
+
47
+ ---
48
+
49
+ ## 📦 Document Haystack Format Variants
50
+
51
+ | Benchmark Set | Format | Description | Use Case |
52
+ |----------------|--------|-------------------------------|-------------------------------|
53
+ | (1) Text needles | PDF | Original document format | VLMs supporting PDF input |
54
+ | | Image | 200 DPI page-wise images | VLMs requiring image input |
55
+ | | Text | Extracted plain text | Text-only LLMs |
56
+ | (2) Text+Image needles | PDF | Original document format | VLMs supporting PDF input |
57
+ | | Image | 200 DPI page-wise images | VLMs requiring image input |
58
+
59
+ ---
60
+
61
+ ## 📁 Dataset Structure
62
+
63
+ Below is an example of the dataset’s folder layout:
64
+
65
+ ```
66
+ DocumentHaystack/
67
+ ├── AIG/
68
+ │ ├── AIG_5Pages/
69
+ │ │ ├── AIG_5Pages_ImageNeedles.pdf
70
+ │ │ ├── AIG_5Pages_TextNeedles.pdf
71
+ │ │ ├── Images_TextImageNeedles/
72
+ │ │ │ ├── AIG_5Pages_ImageNeedles_page_1.jpg
73
+ │ │ │ ├── AIG_5Pages_ImageNeedles_page_2.jpg
74
+ │ │ │ ├── ...
75
+ │ │ ├── Images_TextNeedles/
76
+ │ │ │ ├── AIG_5Pages_TextNeedles_page_1.jpg
77
+ │ │ │ ├── AIG_5Pages_TextNeedles_page_2.jpg
78
+ │ │ │ ├── ...
79
+ │ │ ├── Text_TextNeedles/
80
+ │ │ │ ├── AIG_5Pages_TextNeedles_page_1.txt
81
+ │ │ │ ├── AIG_5Pages_TextNeedles_page_2.txt
82
+ │ │ │ ├── ...
83
+ │ │ ├── needles_info.csv
84
+ │ │ ├── needles.csv
85
+ │ │ ├── prompt_questions.txt
86
+ │ ├── AIG_10Pages/
87
+ │ ├── AIG_25Pages/
88
+ │ ├── AIG_50Pages/
89
+ │ ├── AIG_75Pages/
90
+ │ ├── AIG_100Pages/
91
+ │ ├── AIG_150Pages/
92
+ │ ├── AIG_200Pages/
93
+
94
+ │ needles.csv
95
+ │ prompt_questions.txt
96
+
97
+ ├── AmericanAirlines/
98
+ ├── APA/
99
+ ├── BankOfMontreal/
100
+ ...
101
+ ```
102
+
103
+ ---
104
+
105
+ ## 📁 File and Folder Descriptions
106
+
107
+ Below is an explanation of the files inside the **AIG_5Pages** subfolder:
108
+
109
+ | File/Folder | Description |
110
+ |-------------------------------|--------------------------------------------------------------------------|
111
+ | **AIG_5Pages_ImageNeedles.pdf** | PDF version with hidden Text+Image needles |
112
+ | **AIG_5Pages_TextNeedles.pdf** | PDF version with hidden Text-only needles |
113
+ | **Images_TextImageNeedles/** | Folder with page-wise JPGs of the Text+Image needles PDF |
114
+ | **Images_TextNeedles/** | Folder with page-wise JPGs of the Text-only needles PDF |
115
+ | **Text_TextNeedles/** | Folder with plain `.txt` files per page for Text-Needles version |
116
+ | **needles.csv** | Lists the key-value pairs inserted in the document variant |
117
+ | **needles_info.csv** | Detailed placement metadata for each needle (page, coordinates, font, etc.) |
118
+ | **prompt_questions.txt** | Contains the questions the model must answer for needle retrieval |
119
+
120
+ Within the main **AIG folder**, you'll find two key files: *needles.csv*, which lists all 25 needles that are utilized across the different AIG variants, and *prompt_questions.txt*, which contains the complete set of 25 prompts used throughout the AIG variants.
121
+
122
+ There are 25 top-level subfolders in total, each referring to a different document (e.g., **AIG/**, **AmericanAirlines/**, **APA/**, **BankOfMontreal/**), each structured the same way.
123
+
124
+ ---
125
+
126
+ ## 📌 `needles_info.csv`
127
+
128
+ Each document variant includes a `needles_info.csv` detailing every needle’s properties:
129
+
130
+ **Example rows:**
131
+ ```
132
+ The secret currency is a "euro".,1,13,purple,white,0.546,0.163,times-roman,143
133
+ The secret office supply is a "pencil".,2,8,gray,white,0.339,0.931,times-bold,90
134
+ ```
135
+
136
+ | Column | Description |
137
+ |---------------------|----------------------------------------------|
138
+ | **Needle** | Needle text statement (the hidden key-value pair) |
139
+ | **Page** | Page number where needle is inserted |
140
+ | **Font Size** | Font size |
141
+ | **Text Color** | Foreground color |
142
+ | **Background Color** | Background color |
143
+ | **X** | X coordinate (normalized 0–1) |
144
+ | **Y** | Y coordinate (normalized 0–1) |
145
+ | **Font** | Font type |
146
+ | **Scale** | Image scale (for text+image needles) |
147
+
148
+ **Placement:**
149
+ - Needles are randomly placed across equal, non-overlapping page ranges to ensure coverage throughout the document.
150
+ - Same locations are reused for both text-only and text+image sets.
151
+
152
+ ---
153
+
154
+ ## 🎯 Benchmark Design
155
+
156
+ - **Key-value pairs:** Needles are in the format: “The secret *KEY* is *VALUE*.” (e.g., “The secret sport is *basketball*.”). Cover diverse categories (sports, animals, currencies, fruits, instruments, etc.) — see Table 3 in paper for full list.
157
+ - **Tasks:** Each needle has an associated retrieval question:
158
+ _“What is the secret KEY in the document?”_
159
+ - **Objective scoring:** The VLM’s answer is checked for the correct `VALUE` (or acceptable aliases for text+image needles).
160
+
161
+ ---
162
+
163
+ ## 🔬 Use Cases
164
+
165
+ - Stress-test multimodal VLMs for long-context understanding
166
+ - Compare retrieval from parsed pdf text vs images vs original pdfs
167
+ - Explore text vs image vs mixed retrieval challenges
168
+ - Measure performance drop with increasing context length
169
+
170
+ ---
171
+
172
+ ## 📏 Reference Evaluation
173
+
174
+ Use with the [Document Haystack Benchmark Code](https://github.com/amazon-science/document-haystack) for:
175
+ - Fully automated inference & scoring pipelines
176
+ - Heatmap generation for depth-based performance
177
+
178
+ ---
179
+
180
+ ## 📝 License
181
+
182
+ This project is licensed under the **CC-BY-NC-4.0** License - see the GitHub LICENSE file for details.
183
+
184
+ ---
185
+
186
+ ## 👥 Authors
187
+
188
+ Amazon AGI
189
+ - **Goeric Huybrechts**
190
+ - **Srikanth Ronanki**
191
+ - **Sai Muralidhar Jayanthi**
192
+ - **Jack Fitzgerald**
193
+ - **Srinivasan Veeravanallur**