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."

multimodaldocument-processingcostcore
01vs. vision-llms

The Shift: Traditional OCR vs. Vision-LLMs

FeatureTraditional OCR (Tesseract/AWS Textract)Vision-LLMs (Gemini/GPT-4o)
Primary MechanismCharacter recognitionVisual token understanding
LogicPoint-and-line analysisSemantic context
Reading OrderSimple top-to-bottomMulti-column, complex layout aware
HandwritingPoorExcellent (Human-level)
OutputText blocks + Bounding boxesStructured Markdown/JSON
02layout extraction

Vision-LLM Layout Extraction

The 2025 standard workflow is Screenshot-to-Markdown.

  1. Rasterize: Convert PDF pages to images.
  2. Visual Prompting: Ask the vision model to "Transcribe the following page into GitHub-flavored Markdown, preserving tables and headers."
  3. Structured Recovery: Use the model's spatial awareness to rebuild the logical hierarchy.
03logical structure

Reading Order and Logical Structure

04low-quality scans

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 annotations JSON field.
05latency tradeoffs

Cost and Latency Tradeoffs

Model TierUse CaseLatencyCost (1K pages)
Gemini 3 FlashHigh-volume batch1-2s / page$1-3
GPT-4o (Native)High-precision / Legal3-5s / page$10-20
Local (Llama 3.2 Vision)PII-sensitive / On-prem<1s / pageInfrastructure only
06questions

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.

  1. 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.
  2. Consolidate: A central agent reviews the Markdown snippets to ensure header continuity.
  3. Cache: We store the resulting Markdown in a vector DB. This reduces the processing time from 30 minutes (sequential) to under 20 seconds.
07references

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

summary · added by this rebuild

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.