跪拜 Guibai
← All articles
Artificial Intelligence

Route Pages Before OCR: Citi, EY, and Nvidia's Four-Phase Ingestion System Cuts Vision-Model Calls by 92%

By lucas_AI ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Most enterprise RAG teams pay for OCR on pages that never need it; page-level routing cuts vision-model calls by over 90% on typical corpora. The pipeline also gives data teams a concrete audit trail and evaluation discipline, so offline metrics actually describe the production system.

Summary

Enterprise RAG pipelines usually treat OCR as the default first move. A four-phase ingestion system from Citi, EY, and Nvidia engineers argues the opposite: route every page before deciding. The system computes an image-area ratio per page; pages above 0.8 get rasterized and sent to a vision model, everything else goes through PyMuPDF's native structure extraction. On a 10,507-page corpus, 92% of pages take the zero-model-cost path and only 8.1% need OCR. Scan-page detection uses two signals, a text layer under 40 characters plus a high image share, so a full page of text with one large photo is not misclassified.

Extraction is only phase one. The curation stage samples scarce modalities first, with a six-table audit workbook for reproducibility. A reference scorer combines CER, WER, BLEU, length ratio, and TEDS for tables, then multiplies the composite by coverage, so a model that skips hard documents cannot score high. Chunking keeps tables and figures atomic, uses 320-token child cards with parent paragraphs in a KV table, and prepends a structural breadcrumb to each embedding, all without an LLM. Retrieval evaluation is read-only: Mistral-Medium generates page-answerable questions, and the same embedding fingerprint as production judges hits.

Measured results: Gemini 3.1 Pro scores 97.37 on the coverage-penalized composite, Mistral OCR v3 95.98, and two compact Docling versions trail by 4-7 points. On 25,050 synthetic questions, hit@1 is 68.6%, hit@10 92.8%, MRR 0.77. Every claim carries an evidence-level tag, and the numbers are self-tested on an internal corpus with no public code. The practical claim still stands: most enterprise corpora can cut visual-model calls by over 90% with page-level routing.

Takeaways
— Page-level routing sends only pages with an image-area ratio above 0.8 to OCR/vision models; the rest use PyMuPDF native structure extraction.
— On the 10,507-page Orion corpus, 92% of pages take native extraction and 8.1% need OCR.
— Scan-page detection requires two signals: a text layer under 40 characters and a high image share, avoiding false positives from text pages with one large photo.
— The system follows three rules: structure before semantics, don't change what you measure, and budget annotation with small modality-balanced traceable samples.
— The extraction score combines CER, WER, BLEU, length ratio, and TEDS for tables, then multiplies by coverage so models cannot cherry-pick easy pages.
— Chunking uses 320-token child cards (max 512) in the vector index, parent paragraphs up to 3,500 tokens in a KV table, atomic tables/figures, a 48-token overlap, and a structural breadcrumb prefix.
— Retrieval evaluation is read-only: Mistral-Medium generates 25,050 page-answerable questions, and hits require similarity plus page distance within ±1.
— Gemini 3.1 Pro scores 97.37 on the coverage-penalized composite; Mistral OCR v3 scores 95.98; two compact Docling versions trail by 4-7 points.
— Full extraction of 180 documents takes 45-57 minutes, with about 34 minutes of fixed preprocessing; model inference is no longer the bottleneck.
— All reported numbers are self-tested on an internal corpus with no public code or datasets; 'auditable' is an architectural property, not external validation.
Conclusions

The coverage multiplier on the composite score is a cheap anti-gaming mechanism; any leaderboard that averages per-item scores rewards models that skip hard inputs.

The 34-minute fixed preprocessing cost dominating extraction time shows where enterprise ingestion actually spends money once OCR is routed away; optimization attention should move to parsing and layout work, not model inference.

Tagging every claim with evidence levels ([E], [D], [P], [H]) makes the boundary between measured fact and proposal explicit; more systems papers would benefit from the same discipline.

Because the retrieval evaluation stops at hit@k and MRR, the pipeline's effect on final answer quality remains unknown; a strong retrieval layer does not guarantee good generation.

The caveat that all numbers are self-tested on an internal corpus means the architecture is auditable but not externally validated; teams should treat the specific scores as indicative, not as benchmarks to quote.

Concepts & terms
Page-level routing
Deciding per page whether to run OCR or native PDF structure extraction, based on signals like image-area ratio and text-layer size, instead of OCR-ing the whole corpus.
Coverage-penalized composite score
An extraction quality score that multiplies combined metrics (CER, WER, BLEU, TEDS) by the fraction of pages attempted, so a model cannot score high by skipping hard documents.
Scarcity-first sampling
A curation strategy that prioritizes rare page types (scan pages, chart pages) using modality quotas and greedy coverage, so evaluation samples do not starve uncommon but important cases.
Parent-child chunking
Storing small fixed-size child chunks in the vector index while keeping larger parent paragraphs in a key-value table; retrieval hits a child and fetches the parent for the LLM.
Structural breadcrumb
A deterministic prefix added to embedding text, such as 'document > title > section > subsection (p.12)', that gives the model context without calling an LLM.
Read-only evaluator
An evaluation component that only queries the production index and never writes to it, preventing evaluation from polluting online data.
From the discussion

The routing thresholds draw the sharpest scrutiny: the 0.8 image-area ratio's denominator and its relationship to the scanned-page dual-signal remain unclear, and loosening either threshold could shift the 8.1% figure. One practical take supports the 92% reduction but warns that layout fidelity—two-column papers, cross-page tables—often costs more in post-OCR rework than OCR itself, so those pages still need layout-aware parsing. The exchange splits between accepting the headline number and demanding precision on how the gates are defined.

— The 92% reduction matches real-world experience, but the cost metric omits layout fidelity: plain-text extraction from two-column or cross-page layouts drives expensive rework, so such pages still warrant layout-aware parsing.
— The 0.8 image-area ratio is ambiguous as defined: whether its denominator is the whole page or the content area after stripping headers/footers, and whether it is the same gate as the scanned-page dual-signal, remain unresolved; a text-dense page with one large image could still be routed to OCR.
— The system's sensitivity to thresholds matters: loosening the 0.8 ratio and the sub-40-character secondary signal together could materially change the 8.1% routing share, so the reported reduction is not robust to threshold choices.
Featured comments
静水深码 1 likes

The conclusion that 92% of pages don't need OCR matches my practical experience. One boundary judgment to add: layout fidelity should also count as a cost—two-column papers and cross-page tables, once extracted as a plain text stream, often incur more rework cost for alignment and layout than OCR itself. Such pages still warrant a layout-aware parsing path; you can't look only at the OCR proportion.

智测星球

The 0.8 image-area ratio in page-level routing—I don't understand whether it's the same gate as the dual-signal for scanned pages later. If a full page of text comes with one large image, would it still get sent to OCR in the extraction phase?

智测星球

For that 0.8 image-area ratio, is the denominator the whole page or the content area after removing headers/footers? And scanned pages use fewer than 40 characters as a second signal—if both thresholds were loosened a bit, would the 8.1% change dramatically?

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗