Search tldr

Ingesting Millions of PDFs and why Gemini 2.0 Changes Everything

Gemini 2.0 Flash makes large-scale PDF-to-Markdown extraction and LLM-driven chunking economically viable, delivering roughly 6,000 pages per dollar with near-perfect OCR in internal testing. Its major remaining limitation is unreliable bounding-box localization for source citations.

Share

Ingesting Millions of PDFs and why Gemini 2.0 Changes Everything

Author: Sergey Filimonov | Published: 2025-01-15 | Generated: 2025-02-06 | Domain: sergey.fyi
Tags: ‘#gemini’ ‘#pdf-parsing’ ‘#rag’ ‘#document-ai’ ‘#ocr’ ‘#chunking’


TLDR

Gemini 2.0 Flash substantially changes the economics of document ingestion: the author estimates about 6,000–6,379 PDF pages per dollar for PDF-to-Markdown, compared with roughly 1,000 for AWS Textract and 200 for GPT-4o. Internal tests show strong OCR and table-extraction performance, while enabling LLM-based semantic chunking for a 100M+-page corpus at an estimated $5,000. The key unsolved component is accurate text bounding boxes, which are necessary for precise, trustworthy citations back to a source PDF.

Key Takeaways

  • Cost-effective PDF extraction: Gemini 2.0 Flash is estimated at approximately 6,000 pages per dollar for PDF-to-Markdown; Flash Lite is theoretically around 12,000 pages per dollar but was not tested. The author’s detailed estimate reaches 6,379 pages per dollar using $0.00009675 per input image and $0.0000525 per 400 output tokens.
  • Competitive table parsing: On a subset of Reducto’s rd-tablebench, Gemini 2.0 Flash scored 0.84 ± 0.16, matching Anthropic Sonnet and exceeding Gemini 1.5 Flash (0.77), GPT-4o (0.76), and GPT-4o-mini (0.67). Reducto led at 0.90 ± 0.10.
  • Errors are often structural, not factual: Review of Gemini’s lower-scoring table outputs found that most discrepancies were formatting or structural variations rather than misread numerical values, making many failures immaterial for downstream LLM understanding.
  • LLM chunking becomes affordable at corpus scale: The author estimates parsing a 100M+-page corpus for $5,000 with Gemini 2.0 Flash, making semantic chunking alongside Markdown extraction practical for RAG pipelines.
  • Citation grounding remains unresolved: Gemini’s bounding-box predictions for text locations in page images were “wildly inaccurate” despite varied prompts. Better document-layout training or fine-tuning could close this gap, but as of January 2025 it prevents reliable source-localized citations.

Images & Media

Keep reading