The Document Agent

Extraction API Stress Testing on Handwritten Annotations Nested Tables and Multi-Page Forms

Handwriting, nested tables, and page breaks each break extraction differently.

· 9 min read
Cover illustration for “Extraction API Stress Testing on Handwritten Annotations Nested Tables and Multi-Page Forms”
Extraction Evals · November 12, 2026 · 9 min read · 1,979 words

Stress testing extraction APIs on handwritten annotations, nested tables, and multi-page forms reveals a hierarchy of failures. Handwriting breaks how the system uses recognition and context, nested tables break its structural prediction, and multi-page forms break its assembly. Reliable production infrastructure depends on evaluating those layers separately, then connecting model selection, validation, confidence scoring, and review into a coherent pipeline.

Why extraction APIs fail differently on handwritten annotations, nested tables, and multi-page forms

A document can fail extraction even when the API reads its words correctly. The missing information may be the relationship between a header and its rows, or the continuation of a table across a page break. These are different engineering problems. Treating them as interchangeable recognition errors directs attention toward model quality when the defect may lie elsewhere in the stack.

The hierarchy separates recognition, structural prediction, and assembly by what each layer must preserve. Recognition recovers content using characters and context, while structural prediction recovers the relationships that organize it. Assembly preserves those relationships across pages. This distinction identifies where intervention belongs, whether in the model, the surrounding validation harness, or the confidence layer that determines which results need review.

How handwriting breaks extraction at the character and context layer

Handwriting defeats pattern matching built for uniform fonts because strokes, pressure, and document quality vary. Traditional engines such as Tesseract handle clean printed text well but are not robust for handwriting. The weakness is systematic. WildHandBench's finding that degradation is non-uniform across structures reinforces the distinction between a recognition problem and the structural failures that follow. Performance on one document structure does not establish reliability on another.

LLM-based vision pipelines do better with handwriting because they can use the words around it and the document type to work out unclear characters. The use of context makes model type consequential alongside the quality of a recognition engine. Yet contextual reasoning does not eliminate errors, and the available clues differ between a handwritten clinical note, a subcontractor invoice, and a free-text annotation on a printed form.

A pipeline depends more on these clues when it must switch between printed and handwritten recognition in the same document. Most pipelines are not architected to make that switch cleanly. A legible printed label therefore does not establish that the handwritten value beside it has been extracted correctly. The engineering response is context engineering that uses field relationships, document structure, and domain-specific terminology. Routing documents to specialized models is consequently an architectural decision.

How nested tables break extraction at the structural prediction layer

Nested tables move the problem from reading content to recovering its organization. An API may read every value in a table yet miss the parent-child relationships between spanning headers, multilevel rows, and sub-tables. Correct text is not sufficient evidence of correct extraction. FormStruct-Bench finds that systems do well at the document level, but the best fine-grained structural score is still below 18%. The gap separates reading the contents of a table from recovering the hierarchy that gives them meaning.

That distinction becomes concrete in the returned object. Valid JSON can contain correct field values while assigning rows to the wrong sub-table or flattening a hierarchical grid into a list. The downstream agent then gets the content with the relationships between its parts lost. Such an output need not look broken. Its defect becomes apparent only when evaluation asks whether a value belongs under the right header or within the right group, rather than whether the value appears somewhere in the result.

ExtractBench tags hierarchical headers and large or irregular tables as named challenges and measures value accuracy and grounding separately. Those categories help distinguish structural difficulty from a general label of “hard documents.” Field type provides another useful signal. Simple, unique fields such as invoice total and vendor name reach high accuracy across modern approaches, while individual line items, multi-row tax breakdowns, and nested tables perform substantially worse. The unevenness points to a relationship-modeling problem that stronger text recognition alone cannot resolve.

How multi-page forms break extraction at the assembly layer

Multi-page forms introduce a further requirement beyond recognizing values and recovering the structure of a page. The system must determine which content continues an earlier record or table. Without continuation logic, it can return several single-page tables that are each valid where there should be one correct multi-page table. Each page may appear internally consistent. The error lies in how those pages have been assembled, which makes it invisible to scores that assess extracted fields without testing their cross-page relationships.

When continuation handling is absent, page two may become a separate table and running balances may reset. A repeated header can enter the data as a row, while a row split by the page break can disappear or be duplicated. The downstream agent receives structurally valid JSON that is semantically wrong. No error is thrown by this failure. Compared with visibly garbled handwriting or a flattened nested table, the complete-looking result gives fewer reasons to question it.

Continuation tables are especially difficult when later pages contain partial headers or no headers at all. Rows on page three must still belong to the table that began on page one, often without an explicit structural signal in the document format. A truncated schedule makes it harder for reviewers to locate where assembly failed. Visual grounding identifies the source page and location of extracted content, giving a reviewer evidence for locating where assembly failed. Without that metadata, a reviewer may have to read the whole document to locate where something went wrong.

Why accuracy scores alone do not surface these failure modes in production

Standard accuracy measures undercount these failures because they commonly assume clean documents, fixed schemas, and single-page extraction. Published results often come from clean PDFs with standard layouts and consistent formatting, leaving out the handwriting and difficult tables where most errors occur. The resulting score describes a narrower task than production demands. It offers little evidence about how a system behaves when recognition, hierarchy, and continuation must all work together.

The level of measurement also changes what success means. High character accuracy can coexist with poor field accuracy, and high field accuracy can coexist with poor document accuracy. A short invoice with one incorrect field still fails the requirement for an error-free document. That distinction determines zero-touch processing rates. Even when a system does well enough at the document level, it may do poorly at structural recovery, so scoring a larger unit will not always reveal every relationship error.

FormStruct-Bench shows that aggregate scores tell little about where structural failures happen, including those in nested sub-tables. ExtractBench instead lets each field have its own scoring metrics, including string-semantic for names, number-tolerance for financial figures, and array_llm for lists. One F1 score cannot capture all of those differences. But typed value scoring still leaves questions about missing records and incorrect assembly.

What production-grade evaluation of these failure modes actually requires

Production-grade evaluation separates content accuracy from structural recovery and scores record completeness explicitly. For a long schedule, correct values in the returned rows do not establish that every required row was returned. Truncation needs its own penalty. Measuring completeness exposes omissions that field-level scoring can miss, while measuring cost with accuracy establishes the resource demands of the evaluated approach.

FormStruct-Bench uses five primary metrics and three structure-specific diagnostics across page, schema, and component levels. This design traces aggregate performance back to failures in cell-spanning logic, header hierarchy, or regional organization. The distinction is useful to engineering teams and researchers. A vendor evaluation that reports structural recovery separately gives a team evidence about which part of its extraction harness needs attention, rather than leaving it with an unexplained overall score.

Challenge-tag slicing makes that evidence specific to the document classes a pipeline will process. Teams should demand results for named failure categories rather than accepting an average across all documents. A handwriting-heavy workload and a workload dominated by continuation tables do not test the same capability. Their evaluation slices should reflect that difference. Word- and page-level source traceability should also be an evaluation requirement, so reviewers can locate a misassembled table or truncated schedule without rereading the full source. Once evaluation finds the weak points, runtime architecture must decide which outputs can go through and which need help.

How confidence scoring converts failure detection into a production reliability layer

Evaluation establishes where a system is likely to fail, but it does not identify every failed extraction in production. A confidence layer connects that knowledge to a review workflow. Without useful confidence signals, people must review much of the output from document classes that are hard to process. Field-level confidence narrows the review target, while source citations give reviewers evidence to inspect. ExtractBench's joint measurement of value accuracy and grounding supports evaluating those outputs together rather than treating confidence as a substitute for correctness.

The score must be calibrated to actual errors. LLM-based extraction can give false positives very high confidence, so traditional threshold filtering fails to catch them. A single document-level score also cannot show which value or relationship in a nested table needs attention. Field-level scoring provides the granularity needed to route uncertain results without sending every field in the document through the same review path.

Healthcare routing illustrates the architecture but cannot by itself calibrate scores to actual errors. Extractions above a high confidence threshold route to auto-commit, those in a middle range enter human review, and those below it route to source clarification. Contextual correction provides another response to uncertainty. In handwriting pipelines, an agentic OCR correction layer reviews low-confidence extractions and applies corrections using document context, field relationships, and domain-specific patterns. Confidence is the trigger for that layer, whose correction may still be wrong.

Handwriting failures tend to produce correctly flagged low confidence because the model recognizes its uncertainty. Nested-table failures may receive high confidence because the content was read correctly even though its hierarchy was not. Multi-page truncation often produces no uncertainty signal at all. The result looks complete, so confidence-based routing needs the structural and completeness checks set up during evaluation to catch failures that the system's own certainty can hide.

What the failure hierarchy means for choosing and configuring extraction infrastructure

Teams should start choosing infrastructure by looking at the document structures in their production workload. For pipelines that handle a lot of handwriting, teams should require evidence that training used many kinds of real-world handwriting as well as synthetic degradation. Context engineering must use document type and field relationships alongside character recognition. Per-field confidence is also a selection requirement. It lets the system send uncertain extractions from mixed printed-and-handwritten documents to review while accounting for how much each field can be trusted.

For nested tables, vendor evaluations should include TEDS or equivalent structural metrics on nested and multi-level header documents. Overall document scores do not answer that question. Teams processing insurance declarations, financial schedules, or hierarchical government forms also need to assess how the surrounding harness validates extraction results against schema constraints. Model choice and validation work together here.

For multi-page forms, teams should require a demonstration of a table spanning a page break with a repeated header on page two. Record completeness must be scored with value accuracy, and word- and page-level grounding must be available for review. These requirements address different risks. Continuation handling preserves the table, completeness scoring detects missing records, and grounding helps reviewers locate an assembly failure.

Sensitive-document pipelines must also meet applicable compliance requirements, including SOC 2, HIPAA, and GDPR, with self-hosted or bring-your-own-cloud deployment where data residency is non-negotiable. These constraints belong in infrastructure selection before launch. Integration is the final requirement that connects the layers. Classification, splitting, extraction, confidence scoring, and human-in-the-loop routing should operate as a coherent pipeline. That design reduces the risk that a document passes one component's checks while losing the context, structure, or continuation that the next component needs.

Sources

  1. ExtractBench: A Benchmark for Schema-Guided Enterprise Document Extraction
  2. FormStruct-Bench:A Hierarchical and Diagnostic Benchmark for Table-Form Document Structure Recognition
  3. WildHandBench: A Benchmark for Handwritten Text Understanding that Challenges MLLMs and Humans
  4. Best Handwriting OCR Tools March 2026
  5. Layout-First vs OCR Document Parsing July 2026
  6. OCR Benchmarks & Real-World Documents (July 2026)
Filed underExtraction Evals

More in Extraction Evals