# DocVQA (2020)

> 50,000 questions over 12,767 scanned industry documents—forms, tables, letters and handwritten notes.

Page: https://mralbu.github.io/ai-datasets/d/docvqa

## Key facts

- Category: Vision
- Task: Document visual question answering
- Creators: Minesh Mathew, Dimosthenis Karatzas, C. V. Jawahar (CVC Barcelona, IIIT Hyderabad)
- Size: 12,767 document pages, 50,000 questions
- Splits: train 39,463, validation 5,349, test 5,188
- Input: A scanned single-page document image and a question about its contents
- Labels: One or more verbatim reference answers, plus question-type tags (table, form, layout, handwritten, etc.)
- License: Research use (annotations); document images from UCSF Industry Documents Library
- Paper: [DocVQA: A Dataset for VQA on Document Images](https://arxiv.org/abs/2007.00398)
- Homepage: https://www.docvqa.org/
- Hugging Face: [HuggingFaceM4/DocumentVQA](https://huggingface.co/datasets/HuggingFaceM4/DocumentVQA)
- Sampled at Hub revision a44195f8f989c10d06ab4ccc98ffe9cdb6d928e4 (2026-11-22)

## Why it matters

Natural-photo VQA rarely tests whether a model can read dense typography, follow a two-column table or link a checkbox to its label. DocVQA turned real archival scans into a question-answering benchmark where layout carries half the meaning. Because small print vanishes when a page is squashed to 224×224 pixels, DocVQA became the stress test that drove modern VLMs toward high-res stages, image tiling and native dynamic resolution.

## Worth knowing

- Pages come from the UCSF Industry Documents Library—memos, budgets, lab reports and forms spanning decades, many typed or handwritten.
- Scored with ANLS (Average Normalized Levenshtein Similarity), which forgives minor one-character OCR typos while zeroing out responses that drift too far.
- Upgrading PaliGemma from 224px to 896px nearly doubled its DocVQA score (from 43.7 to 84.8), illustrating how severely fixed low-res crops bottleneck document reading.
- Questions are tagged by layout type—tables, forms, figures, lists, yes/no and handwritten text—so errors can be broken down by structure.

## Get the data

Single-page DocVQA (Task 1) in Parquet format with embedded page scans, questions, reference answers and layout tags.

```bash
# pip install -U huggingface_hub
hf download HuggingFaceM4/DocumentVQA --repo-type dataset \
  --local-dir docvqa
```

```python
from datasets import load_dataset   # pip install datasets

ds = load_dataset("HuggingFaceM4/DocumentVQA")
print(ds)
```

```python
import polars as pl

df = pl.read_parquet("hf://datasets/HuggingFaceM4/DocumentVQA@~parquet/default/validation/*.parquet")
print(df.shape)
```

## Related datasets

- [TextVQA](https://huggingface.co/datasets/lmms-lab-encoder/textvqa): 2019, reading text in everyday street and indoor photos (on this site: https://mralbu.github.io/ai-datasets/d/textvqa)
- [InfographicVQA](https://arxiv.org/abs/2104.12756): 2021, companion benchmark over tall, visually dense infographics
- [ChartQA](https://huggingface.co/datasets/HuggingFaceM4/ChartQA): 2022, visual and arithmetic reasoning over plots and charts (on this site: https://mralbu.github.io/ai-datasets/d/chartqa)
- [MP-DocVQA](https://arxiv.org/abs/2212.05935): 2023, multi-page extension requiring cross-page lookup
- [MMMU](https://huggingface.co/datasets/MMMU/MMMU): 2023, college-level multimodal reasoning (on this site: https://mralbu.github.io/ai-datasets/d/mmmu)
- [VQA v2](https://huggingface.co/datasets/lmms-lab-encoder/VQAv2): 2017, open-ended questions about everyday photos (on this site: https://mralbu.github.io/ai-datasets/d/vqa-v2)

## Landmark papers

- [OCR-free Document Understanding Transformer (Donut)](https://arxiv.org/abs/2111.15664) (2022)

## Papers on this site that use it

- [Molmo (2024)](https://mralbu.github.io/ai-datasets/p/molmo.md): Matched proprietary frontier VLMs using only open weights and newly collected human speech captions and 2D pointing data—with zero distillation from closed VLMs.
- [PaliGemma (2024)](https://mralbu.github.io/ai-datasets/p/paligemma.md): Paired SigLIP and Gemma-2B with a linear projection, prefix-LM attention and unfrozen multi-resolution pretraining to build a compact 3B transfer base model.
- [Qwen2-VL (2024)](https://mralbu.github.io/ai-datasets/p/qwen2-vl.md): Replaced fixed square crops and patch grids with Naive Dynamic Resolution and Multimodal RoPE so one ViT+LLM reads images and video at their native sizes.
