---
title: "Docmatix - a huge dataset for Document Visual Question Answering"
description: "Docmatix is a Document Visual Question Answering dataset with 2.4 million images and 9.5 million Q/A pairs drawn from 1.3 million PDFs, roughly 240x larger than earlier DocVQA datasets."
url: "https://swe.quest/articles/docmatix-a-huge-dataset-for-document-visual-question-answering-acf1e0919e3f7459"
canonical: "https://huggingface.co/blog/docmatix"
source: "Hugging Face"
published: "2024-07-18"
difficulty: "medium"
kind: "Research"
reading_minutes: 4
tags: ["computer-vision","model-training","llms"]
---

# Docmatix - a huge dataset for Document Visual Question Answering

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-07-18, 4 min read, Research. Original: [https://huggingface.co/blog/docmatix](https://huggingface.co/blog/docmatix)

## Summary

Docmatix is a Document Visual Question Answering dataset with 2.4 million images and 9.5 million Q/A pairs drawn from 1.3 million PDFs, roughly 240x larger than earlier DocVQA datasets. Q/A pairs were generated with Phi-3-small from PDFA OCR transcriptions. About 15% of generations were discarded as hallucinations using regex code detection and an "unanswerable" keyword filter, and prompts were tuned toward about four diverse, human-like pairs per page. Fine-tuning the 0.7B Florence-2 on a small slice of Docmatix and then DocVQA raised ANLS from 60.1 to 71.4. That is within about 5% of the 8B Idefics2.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Computer vision](https://swe.quest/tags/computer-vision.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- vision-language models ([easy posts on Computer vision](https://swe.quest/tags/computer-vision.md?difficulty=easy))
- fine-tuning basics ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))

## Keywords

Docmatix, DocVQA, Florence-2, Phi-3, PDFA, Idefics2, The Cauldron, Hugging Face

## Related posts

- [LAVE: Zero-shot VQA Evaluation on Docmatix with LLMs - Do We Still Need Fine-Tuning?](https://swe.quest/articles/lave-zero-shot-vqa-evaluation-on-docmatix-with-llms-do-we-still-need-fine-tuning-73f0201bd0909eab.md): Hugging Face · 2024-07-25 · Hard · 7 min read · Evaluation, LLMs, Computer vision, Machine learning
  Exact-match VQA metrics badly underrate zero-shot answers on synthetic datasets like Docmatix, whose answers are semantically correct but stylistically different from DocVQA references.
- [Visual Document Retrieval Goes Multilingual](https://swe.quest/articles/visual-document-retrieval-goes-multilingual-a925525d4c93b18e.md): Hugging Face · 2025-01-10 · Hard · 11 min read · RAG & retrieval, Model training, Evaluation, Computer vision, Vector search
  vdr-2b-multi-v1 is a multilingual embedding model that encodes document page screenshots into single dense vectors for OCR-free retrieval.
- [Fine-tuning Florence-2 - Microsoft's Cutting-edge Vision Language Models](https://swe.quest/articles/fine-tuning-florence-2-microsoft-s-cutting-edge-vision-language-models-184087851c31370f.md): Hugging Face · 2024-06-24 · Medium · 6 min read · Model training, Computer vision, Python
  Florence-2, Microsoft's small (0.2B/0.7B) sequence-to-sequence vision-language model built from a DaViT encoder, BERT text embeddings and an encoder-decoder transformer pre-trained on the 126M-image FLD-5B dataset, can be fine-tuned to handle visual question answering, a task the released checkpoints don't support.
- [PRX Part 4: Our Data Strategy](https://swe.quest/articles/prx-part-4-our-data-strategy-65ac8355bac33db9.md): Hugging Face · 2026-07-06 · Hard · 20 min read · Model training, Data pipelines, Computer vision, Machine learning
  PRX's pre-training corpus for a 7B text-to-image model is assembled from public and internal datasets, re-captioned with a VLM into long dense paragraphs, curated in Lance and streamed to training as Mosaic Data Shards.
- [Build awesome datasets for video generation](https://swe.quest/articles/build-awesome-datasets-for-video-generation-234cead646e03175.md): Hugging Face · 2025-02-12 · Medium · 5 min read · Model training, Computer vision, Data pipelines, Video & media
  A three-stage pipeline for building small video-generation fine-tuning datasets: acquisition with yt-dlp and scene splitting, per-frame filtering for watermarks, aesthetics and NSFW content plus an OpenCV motion score, and captioning with Florence-2 or a video captioner like Qwen2VL.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
