Docmatix - a huge dataset for Document Visual Question Answering
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.
Related posts
- LAVE: Zero-shot VQA Evaluation on Docmatix with LLMs - Do We Still Need Fine-Tuning?
Hugging Face hardMasterExact-match VQA metrics badly underrate zero-shot answers on synthetic datasets like Docmatix, whose answers are semantically correct but stylistically different from DocVQA references. Evaluating MPLUG-DocOwl1.5 zero-shot on ~200 Docmatix samples, CIDEr, BLEU and ANLS scored 0.14, 0.003 and 0.002, while LAVE (LLM-Assisted VQA Evaluation) using Llama-2-Chat-7b with a 1-3 rating prompt, rationale-first instructions and few-shot demonstrations scored 0.58. The rating is mapped to [0,1] via (r-1)/2. Rigid string-matching metrics may be pushing teams toward format-only fine-tuning, and LLM-based rating aligns better with human judgment, though the authors note more ablations are needed.
- Visual Document Retrieval Goes Multilingual
Hugging Face hardMastervdr-2b-multi-v1 is a multilingual embedding model that encodes document page screenshots into single dense vectors for OCR-free retrieval. It is fine-tuned from dse-qwen2-2b-mrl-v1 on a new open 500k-sample synthetic dataset covering Italian, Spanish, English, French and German. The data pipeline is laid out step by step: topic-driven PDF scraping, layout-based page sampling, VLM query generation, filtering with voyage-3 and hard-negative mining. The model improves NDCG@5 by about 2.3% on average over the base model and by 2.3% on Italian-to-German cross-lingual search. An English-only variant matches the base model using 768 instead of 2560 image tokens, about 3x faster inference, and Matryoshka plus binary embeddings keep roughly 97-99% of quality at much smaller vector sizes.
- Fine-tuning Florence-2 - Microsoft's Cutting-edge Vision Language Models
Hugging Face mediumAdeptFlorence-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. Fine-tuning on DocVQA for seven epochs raised validation Levenshtein similarity from 0 to 57.0. The low-resource setup froze the vision encoder and used batch size 6 on a single A100 (or 1 on a T4), while a full fine-tune at batch size 64 took 70 minutes on 8 H100s. A small learning rate of 1e-6 avoided rapid overfitting, and a PyTorch walkthrough covers the dataset, collator and training loop.
- PRX Part 4: Our Data Strategy
Hugging Face hardMasterPRX'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. The pipeline favors breadth over aesthetic filtering and relies on faithful captions to turn imperfections like text or logos into promptable attributes. Measured decisions include storing images as JPEG quality 92, since PNG-vs-JPEG training runs were indistinguishable, and computing Qwen3-VL text latents on the fly for only a ~3–4% throughput cost. Over-fragmented Lance tables made queries slow until compaction to ~1M rows per fragment, and long Qwen2.5-VL captions clearly beat short LLaVA captions on FID, CMMD and DINO-MMD.
- Build awesome datasets for video generation
Hugging Face mediumAdeptA 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. Filtering the crush-smol dataset on pwatermark < 0.1 and aesthetic > 5.5 kept only 47 of 1493 clips. The authors conclude that averaging watermark scores across frames with a 0.2–0.3 threshold works better, and that aesthetic scores are biased toward colorful, regular shapes and suit a minimum cutoff of about 4.25–4.5. The resulting datasets were used to fine-tune CogVideoX-5B with finetrainers for effects like Crush and Cakeify.