Est.

Parsing Architecture Decisions That Determine Structured Output Fidelity Across Multi-Column Tables and Mixed-Format Pages

· 9 min read
Cover illustration for “Parsing Architecture Decisions That Determine Structured Output Fidelity Across Multi-Column Tables and Mixed-Format Pages”
Document AI Market · November 6, 2026 · 9 min read · 1,914 words

A high-accuracy document extraction API for complex real-world layouts must keep column boundaries, merged-cell relationships, and reading order intact as well as recognize words. Structured output fidelity depends on the architecture used for spatial reasoning, the output format, and how semantic block classification works. Those choices set limits that model tuning cannot remove, so API selection must test structural correctness on production documents.

Why structured output fidelity is not an OCR problem

A parser reads across two columns and returns a run-on sentence made from passages that do not belong together. Every word may be correct, yet the sentence is not. PDFs store content as positioned glyphs on a canvas, so recognizing characters does not establish which passages belong together. The failure is in the reconstructed layout.

That distinction changes what an extraction pipeline must optimize. Word error rate measures recognition, but it does not establish that table values remain under the correct headers or that separate columns remain separate. A layout error can cascade through element parsing and corrupt an entire section of retrieved context. Better OCR alone cannot fix that structural failure, because what is missing is how the parts relate to each other, even when the characters are correct.

How spatial reasoning architecture determines whether column boundaries survive parsing

The first architectural distinction is whether a parser identifies layout before extraction or treats the page as a flat character stream. Structure must precede serialization. Once unrelated columns have been joined, downstream components get a sequence that no longer shows the page’s original boundaries. The parser’s capacity to infer those boundaries therefore sets an upstream limit on fidelity.

Text-extraction libraries do not all have the same limits. pdfminer reads what the PDF exposes with limited layout inference, while pdfplumber supports coordinate-based column detection. PyMuPDF has built-in GNN-based layout analysis that supports multi-column reading order by default. These differences rule out treating open-source extraction as a single architectural category.

Neural parsers use layout models to identify bounding boxes, classify semantic blocks, and predict reading order before extracting text. Vision-language model parsers instead reason about the page as a visual artifact, including implicit cues in borderless tables and hierarchical headers. Coordinates alone can be brittle. When extraction depends on expected positions, a field outside its expected bounding box can be misclassified or dropped before table reconstruction begins.

That dependency becomes consequential as document sources diversify. A full-width totals row can become a separate single-cell table, an embedded sub-header can become a data row, and numeric columns can shift when font output varies across PDF generators. Camelot automatically detects tables, but its documentation also provides optional bounding-box coordinates when automatic detection is insufficient. Coordinates set for a template can work for a known layout without handling the differences between layouts. The engineering choice is therefore the class of spatial reasoning needed for the document population, before accuracy tuning begins.

Why output format choice creates a fidelity ceiling that cannot be fixed after the fact

Even correct spatial reasoning can be undone by the output contract. Standard Markdown pipe-table syntax is limited to representing cells that occupy a single row and column. A parser may recognize a merged header correctly and still lose its geometry when required to serialize the table into that syntax.

A vertically merged label illustrates the consequence. If a label in column A spans two rows, both values in column B must retain their relationship to it. Assigning the label only to the first row leaves the second value without its proper attribution. With hierarchical headers, each sub-column also depends on the category label above it for its meaning. Flattening that hierarchy removes information that plain text accuracy does not measure.

Other formats can preserve those relationships explicitly. HTML and structured JSON can encode rowspan and colspan, while XLSX and LaTeX also support merged-cell geometry. The choice need not always be HTML. It must, however, distinguish standard Markdown pipe tables from formats that can express spans, including raw HTML embedded in a Markdown document.

The loss becomes harder to detect when Markdown is later converted to JSON. That conversion can duplicate values or shift columns without recovering the original merge relationships. Downstream systems then get text that looks right in the wrong fields. In financial or healthcare documents, assigning one line item’s amount to another account code, or one patient’s value to another field, is a correctness failure. Preserving geometry still leaves another requirement, which is preserving the sequence in which page elements belong.

Reading order as a system-level decision on mixed-format pages

Reading order on a page containing text, tables, figures, captions, and footnotes cannot be inferred from glyph position alone. Spatial adjacency does not establish semantic membership. A figure caption to the right of a table may sit beside its cells while belonging to the figure. A left-to-right extraction pass can insert that caption into the table despite recognizing every character correctly.

Footnotes create a similar ambiguity at the bottom of a column. Without semantic classification, a footnote beneath a table can be appended as another row or absorbed into body text. Full-width tables introduce a sequencing problem as well. In a two-column flow, the parser may need to interrupt column reading, process the table, and then resume the appropriate column rather than attach the table to whichever column is closest.

A layout-aware architecture assigns block types such as Title, Narrative, Table, Figure, Caption, and Footnote, then determines order from block relationships. Classification makes that sequencing decision possible. It must be part of the parsing system. Once serialization has discarded the correct boundaries, a chunker or embedding model cannot reliably reconstruct them from the resulting text alone. Spatial reasoning, representation, and reading-order classification each need their own checks to show that they work correctly.

What benchmarks actually measure and where they go silent on production fidelity

OmniDocBench, produced by Shanghai AI Laboratory and presented at CVPR 2025, evaluates text extraction, table structure, formula recognition, and layout. It uses Normalized Edit Distance, or NED, for content accuracy and Tree Edit Distance-based Similarity, or TEDS, to compare HTML table trees. The distinction is essential. When content accuracy is strong but structural similarity is weak, the text is recognizable but its parts are in the wrong places.

OmniDocBench v1.6 covers 10 document categories, 5 layout types, and 5 language types. ParseBench, published in 2026 as arXiv:2604.08538, covers 2,078 pages and complements it with AI-agent-specific scenarios. Coverage does not establish production fit. A composite score can describe performance across the benchmark population without showing whether merged cells, cross-page tables, or mixed-format reading order survive in a particular workload. Those dimensions need separate scrutiny.

“Beyond String Matching: Semantic Evaluation of PDF Table Extraction,” the 2026 paper identified as arXiv:2603.18652, argues that rule-based metrics fail to capture semantic equivalence. A thousands separator can create a string difference without changing a value’s meaning. Conversely, a shifted column can preserve much of the text while attaching values to the wrong fields.

OCR scores and full document AI evaluations also answer different questions. Word error rate measures raw recognition, while structured extraction evaluation includes fields, tables, confidence scoring, and multi-page processing. Neither label should stand in for the other. Moreover, OmniDocBench and similar corpora skew toward born-digital scientific and financial PDFs, leaving archival or hand-drawn tables and scanned logistics, insurance, and healthcare documents underrepresented. That population mismatch is why benchmark leadership cannot establish which extraction API will perform best on a team’s messy production documents.

How to pick a document parsing API that will not fail on scanned invoices and irregular layouts

For teams choosing an API, the practical response is to evaluate their own documents against explicit structural requirements. A known multi-column page provides the first test. Its output should follow columns, making this a pass/fail check. Scanned invoices and irregular layouts from the actual workload belong in that evaluation because clean benchmark PDFs do not expose the same distribution of failures.

Merged-cell tests should establish both recognition and preservation. A table with known rowspan and colspan cells reveals whether the output retains merge geometry, duplicates labels, or drops relationships. The format contract is part of the test. If it permits only standard Markdown pipe tables, that limitation exists before extraction begins, regardless of how persuasive a rendered preview appears.

Cross-page continuity requires a separate document spanning two or more pages. Headers from the first page must stay linked to the data rows on later pages so those rows still have their field names. Mixed-format reading order needs another explicit check. A full-width table embedded in two-column text should interrupt the flow correctly and allow it to resume in the proper column. These tests isolate different architectural responsibilities that a single “accuracy” figure would obscure.

Completeness deserves equal attention in large-array extraction. A parser can return accurate values for the rows it retained while silently omitting others. Missing rows are still extraction failures. An evaluation that does not penalize them can reward incomplete tables, so fidelity assessment must include whether the full table survived as well as whether individual returned values are correct.

Confidence scoring should also be evaluated as a routing mechanism. A system with three tiers can auto-post high-confidence outputs, auto-draft moderate-confidence outputs, and send low-confidence cases to an exception queue. The scores must track real field-level errors. Otherwise, the system can send dependable fields for review while allowing incorrect ones through. Useful confidence signals separate uncertain fields from dependable outputs without constant retuning as new document types appear.

Architectural decisions that remain tunable after the foundational choices are fixed

Once spatial reasoning, merged-cell representation, and reading-order classification are suitable, downstream changes can improve fidelity without replacing the parser. Document splitting is one such decision. A loan application packet containing a tax form, a bank statement, and a cover letter requires different extraction logic for its constituent documents. Using one structural model for the whole packet can produce mixed-schema output that downstream agents cannot reliably use.

Splitting before extraction separates those requirements. For a stable, high-volume document type from a known sender, deterministic splitting can run faster, cost less, and be easier to audit than an agent-based approach. The choice remains tunable within the system. It addresses how inputs reach extraction logic rather than attempting to compensate for a parser that cannot understand their layout.

Splitting, extraction, and parsing depend on how the system organizes their work, so changing the underlying model offers less leverage than fixing a broken harness. Model choice still has a role. Resolve spatial and representational constraints first, then tune model selection where the architecture already preserves the information required downstream.

Once that information survives, changing how chunking works can also help. Structural boundaries, including tables, section headings, and semantic block transitions, preserve relationships that fixed token counts can sever. Splitting a table in the middle cuts later rows off from their headers. Combining a table with unrelated following prose can also dilute its signal in an embedding. Structure-aware chunking can keep correctly parsed relationships intact, but it cannot bring back boundaries lost during extraction.

The remaining distinction is between tuning and changing a contract. If downstream systems require Markdown pipe tables, preserving merged cells through HTML or JSON requires a contract change. Likewise, position-only serialization cannot be repaired reliably by a stronger embedder. Integrated parsing, extraction, splitting, classification, and confidence scoring can reduce the number of foundational decisions teams manage separately. Engineering effort should first remove limits that destroy information, then tune the components that operate on what has been preserved.

Sources

  1. ParseBench: A Document Parsing Benchmark for AI Agents
  2. Doc Parsing: Open Source vs. Production APIs August 2026
  3. Best Document AI Evaluation Tools (February 2026)

More in Document AI Market