01 Document Processing 3 min read 576 words
OCR and Layout Analysis (Dec 2025)
In late 2025, traditional OCR (Tesseract, specialized engines) has been largely superseded by Native Multimodal LLMs (Gemini 3, GPT-4o, Claude Sonnet 4.5). We no longer "read characters"; we "understand layouts."
The Shift: Traditional OCR vs. Vision-LLMs
| Feature | Traditional OCR (Tesseract/AWS Textract) | Vision-LLMs (Gemini/GPT-4o) |
|---|---|---|
| Primary Mechanism | Character recognition | Visual token understanding |
| Logic | Point-and-line analysis | Semantic context |
| Reading Order | Simple top-to-bottom | Multi-column, complex layout aware |
| Handwriting | Poor | Excellent (Human-level) |
| Output | Text blocks + Bounding boxes | Structured Markdown/JSON |
Vision-LLM Layout Extraction
The 2025 standard workflow is Screenshot-to-Markdown.
- Rasterize: Convert PDF pages to images.
- Visual Prompting: Ask the vision model to "Transcribe the following page into GitHub-flavored Markdown, preserving tables and headers."
- Structured Recovery: Use the model's spatial awareness to rebuild the logical hierarchy.
Reading Order and Logical Structure
Handling Low-Quality Scans
Late 2025 models are robust to:
- Skew/Rotation: Automatically corrected in the visual attention layer.
- Bleed-through: The model uses semantic context to "ignore" text from the back of the page.
- Handwritten Annotations: Can be extracted into a separate
annotationsJSON field.
Cost and Latency Tradeoffs
| Model Tier | Use Case | Latency | Cost (1K pages) |
|---|---|---|---|
| Gemini 3 Flash | High-volume batch | 1-2s / page | $1-3 |
| GPT-4o (Native) | High-precision / Legal | 3-5s / page | $10-20 |
| Local (Llama 3.2 Vision) | PII-sensitive / On-prem | <1s / page | Infrastructure only |
Interview Questions
Q: Why would you still use AWS Textract or Azure AI Search (OCR) in 2025?
Strong answer: Strict Spatial Metadata and Compliance. If my application needs exact pixel-level bounding boxes for every single word (e.g., for a legal redaction tool), a specialized OCR engine is often more precise and cheaper. Furthermore, OCR engines are Deterministic: they do not "Hallucinate" words that do not exist. For high-stakes document processing where 100% character accuracy is required over "Layout understanding," traditional engines still hold a spot in the hybrid pipeline.
Q: How do you handle a 500-page PDF with Vision LLMs efficiently?
Strong answer: We use a Parallel Map-Reduce pattern.
- Map: We spin up 50 parallel workers (using AWS Lambda or Modal) to process 10 pages each. Each worker calls a fast Vision model (like Gemini 3 Flash) to get the Markdown.
- Consolidate: A central agent reviews the Markdown snippets to ensure header continuity.
- Cache: We store the resulting Markdown in a vector DB. This reduces the processing time from 30 minutes (sequential) to under 20 seconds.
References
- Google DeepMind. "Gemini 2.0: Understanding Multi-column Documents" (2025)
- OpenAI. "Vision Models for Document Understanding" (2025)
- Tesseract v6. "The Integration of Hybrid Transformer OCR" (2025)
Next: Multimodal Parsing and Markdown Conversion
Key takeaways
01
Screenshot-to-markdown displaced character recognition
The workflow is rasterise each page, ask a vision model to transcribe it as GitHub-flavoured markdown preserving tables and headers, then rebuild the logical hierarchy from its spatial awareness.
02
Reading order is the real gain
Rule-based parsers read straight across a two-column page and split paragraphs; a vision model sees the gutter and sequences the columns in the order a human would.
03
Determinism still favours classic OCR
Textract-style engines give pixel-exact bounding boxes and never invent words, which is why legal redaction and 100%-character-accuracy work keeps them in the hybrid pipeline.
04
Per-page cost spans an order of magnitude
Batch tiers run $1-3 per thousand pages at one to two seconds each; high-precision legal work runs $10-20 at three to five seconds; local models cost only infrastructure.
05
Parallelise pages, then reconcile headers
Fifty workers taking ten pages each cut a 500-page PDF from thirty minutes to under twenty seconds, with a consolidation pass to keep header continuity intact.