/
Part 1: The Science of Teaching AI Agents to Read Handwritten Forms Reliably
Science & Innovation

Part 1: The Science of Teaching AI Agents to Read Handwritten Forms Reliably

Last-mile customization, and how synthetic environments and harness optimization prepare agents for unique customer needs

10 Nov 2026

Every day, insurers, banks, and other enterprises receive stacks of forms, many filled out by hand. Before a claim is paid or a policy changed, each form has to be read and its values entered into the right systems.

Today, that work is increasingly done by an AI agent. This document-processing agent reads a scanned page, finds the fields a business needs (a policy number, a name, a date of birth), and checks those values against the company’s records. When everything matches, the transaction moves forward without anyone retyping it.

Getting an intelligent document processing (IDP) agent to work in a demo is easy. Getting it to work on a specific customer’s proprietary documents is the hard part, and it’s where most of the value is. We call this the last mile, and it’s a tangle of three problems.

  • Every customer and industry brings different context. Forms, field definitions, permitted models, and verification systems all vary, so a workflow tuned for one customer can fail on the next.
  • Labeled examples are scarce. Customers can share blank forms long before they can share filled-in examples with correct answers, and real documents carry personal data that’s hard to move.
  • Small errors result in outsized costs. A single handwritten S read as a 5 can fail a records check and send an otherwise good document to manual review, which is one of the biggest cost drivers in IDP.

These problems feed off each other. Without data, you can’t adapt the agent. Without realistic test documents, you can’t trust it. And even the strongest model still trips over small misreads.

Why reliable agents start with science

It’s tempting to treat this as an engineering backlog of more tuning, more rules, and a bigger model. But engineering needs solid ground to build on, and here that ground doesn’t exist yet. Each strand of the tangle is an open research question that science has to answer first.

  • Can synthetic data stand in for real data? Do results on generated forms hold on real handwriting?
  • Can an agent’s workflow be tuned automatically, and safely? An agent has many settings, and finding the right mix takes measurement and guardrails, not intuition.
  • Can an agent fix its own mistakes? Language models asked to critique themselves don’t reliably improve without an independent signal.
  • Can automation stay safe? Before a document skips human review, we need to measure how often the agent could confirm the wrong person’s record.

A bigger model doesn’t answer any of these. In our benchmark, the weakest model running our method beat the strongest model without it. The answers come from framing the problem precisely, running controlled experiments, and stress-testing against realistic databases.

How AIVista builds reliable and autonomous document agents

At NTT DATA AIVista, we tackle these four questions with three connected pieces, each one measurable.

  1. Synthetic data and environments answer the data question. They complement the customer data we have with realistic filled forms and known answers, so we can evaluate and improve the agent before much customer data arrives.
  2. Harness optimization answers the tuning question. During setup, it uses the synthetic environment to evaluate and automatically improve the agent’s harness. That includes its prompts, field descriptions, model choices, and workflow, as well as how and when it checks its own work. The result ships as a reviewed, versioned release.
  3. The self-correction loop answers the last two questions, and it’s one of the strategies a harness can include. While processing a document, the agent uses an external verifier, in this case the customer’s own records, to revisit ambiguous readings and fix extraction errors. We measure how often that could confirm the wrong record.

The two are nested, not separate. Harness optimization decides how the agent works, including whether and how it self-corrects, and that decision carries across future documents. Self-correction is that decision in action on each individual document. Together with synthetic environments, they add up to last-mile customization, adapting document agents to each customer, even when customer data is limited.

Underneath all three is a shift in how we define extraction. A field reading has value only if it lets the business process move forward. So instead of “extract, then validate,” we let validation guide extraction. In a controlled production pilot on 172 low-confidence handwritten insurance forms, self-correction nearly doubled the share of forms that skipped manual review, from 33% to 62%.

What makes our agent unique, and why the AIVista approach is novel

  • The business check is part of the problem. We define success as passing the customer’s records check, not just reading accurately.
  • The verifier is exact, binary, and blind. Unlike learned verifiers that approximate the answer and can be gamed, ours says only “match” or “no match” and never reveals stored values. Every correction has to come from the page.
  • Ambiguity lives in the proposal, not the acceptance. The agent can suggest several readings, but acceptance stays strict, and we tune that strictness to each database.
  • Evidence climbs a ladder. Results move from synthetic forms to real human handwriting, then to simulated two-million-record databases, and finally to live customer documents.
  • Alternatives are tested, not assumed. We benchmarked fuzzy matching and richer feedback against our approach under matched budgets and kept what the evidence supported.

This is how our research team works. We state the problem precisely, build the environment to test it, compare against the strongest alternatives, and submit the method for peer review. The self-correction work in Part 2 is under peer review at ACL, a leading venue for natural language processing research.

The case for synthetic environments when real examples are scarce

Because labeled examples are scarce, we complement the customer data we have with a synthetic environment, a controlled sandbox of realistic documents where every correct answer is known. Our pipeline turns blank customer templates into filled, labeled forms, varying content, handwriting, layout, and scan quality. The same environment is then used for evaluation and improvement.

A real example. One insurance customer gave us blank forms, the fields to extract, and the technical specs for its records system, but no filled documents or database access. We generated hand-filled forms with known answers and built a mock records system to match. The agent ran against it exactly as it would in production, proving the approach worked before any customer data changed hands.

How do we know results hold beyond synthetic data? We test along a four-step evaluation ladder.

  1. Synthetic forms (120 documents generated from customer templates) give controlled coverage with exact answers.
  2. Real human handwriting (84 forms from 11 templates, filled in by people with made-up identity values) stress-tests the reader.
  3. Simulated databases of two million records each, built from US population statistics, test whether a corrected reading could match the wrong person.
  4. Live customer documents from three carriers test the agent in real operations.

Across all 204 offline forms, the agent reached 93.2–97.6% field exact match with every model we tested. Real-document validation remains essential, but synthetic environments let us evaluate and improve the agent before large labeled customer datasets exist.

How harness optimization tunes the agent for each customer

Every agent runs inside what researchers call a harness, a playbook of instructions and settings. It decides how a document is read, how each field is described, which approved models and tools are used, and when to double-check an answer. A harness can also include a self-correction strategy, such as which records to check, which fields to verify together, and how many correction rounds to allow. In that sense, self-correction can itself be an outcome of harness optimization.

Our optimizer uses the synthetic environment to evaluate and improve this playbook at setup. It proposes changes, scores each against a fixed objective, and keeps what works, so in effect one agent helps improve another. The result is reviewed and released like any other change, so the deployed agent never rewrites itself. Per-customer model and field-description configuration already runs in production, and fully automatic optimization is where we’re headed.

How harness optimization and self-correction fit together

Harness optimization runs at setup and shapes the workflow used across future documents, including the self-correction strategy. Self-correction then runs on each hard document in production, following that strategy to fix individual readings. One sets the playbook, and the other carries it out.

Coming up in Part 2

That covers how we prepare the agent before it goes live. Part 2 looks at what happens in production, including how the agent catches its own misreads, why its checks stay strict, and how it nearly doubled the share of hard documents that skipped manual review in a live insurance pilot.

Interested in how this could work with your documents? Get in touch with the NTT DATA AIVista team here.

Vassilis Ioannidis and Costas Mavromatis
Members of Technical Staff, NTT DATA AIVista
Share this post

More articles

Science & Innovation
17 Nov 2026
Insights
Why Operationalizing AI isn’t a Technology Problem, But a People Issue
25 Oct 2026

Interested in learning more, contact us:

For general inquiries:
For press inquiries:
Locations:

Contact Us