AI · 2 min read

LLM Document Processing: How to Measure Accuracy on Invoices and Orders

How to answer "how accurate is it?" with numbers in AI document-processing projects: test sets, metrics and automation thresholds.

LLM document processing means automatically reading and structuring data from documents such as supplier invoices, order forms and delivery notes. Demos are usually impressive, but the production decision depends on one question: "How accurate is this system, and on which documents does it fail?" That question must be answered by measurement, not intuition.

1. Build a golden dataset

Select a representative sample of real documents: different suppliers and formats, scanned and digital, multi-page and with handwritten notes. For each one, a person enters the correct values (invoice number, date, tax ID, line items, amounts). For a start, 100–300 documents give meaningful results in most scenarios. The set is re-run after every model or prompt change.

2. Measure per field

A single number such as "92% of documents are correct" is misleading. Accuracy should be measured per field:

  • Exact match: are fields such as invoice number and tax ID exactly right?
  • Normalised match: are dates and amounts right, ignoring format differences?
  • Line items: are item count, quantities and unit prices right, and do line totals add up to the invoice total?
  • Missing and extra fields: did the model fail to find a field, or invent a value that is not there?

The second kind of error, inventing a value, is silent and dangerous and should be reported separately.

3. Add rule-based validation

Model output is checked automatically against business rules: do line totals match the invoice amount, does the tax ID match the supplier in master data, does the order number correspond to an open order? These checks provide reliability the model cannot reach on its own.

4. Set the automation threshold

Each document takes one of three paths:

  1. Automatic: passes all rules with high confidence; lands in the ERP as a proposal without user review.
  2. Review: one or more fields are doubtful; the user checks only the flagged fields.
  3. Manual: the document could not be read or rules were badly violated.

Keep the automatic path narrow at first and widen it as measurements improve. The architecture side is covered in enterprise AI architecture.

5. Keep measuring in production

Every correction users make in production is logged. These logs show real accuracy and grow the golden dataset. If accuracy drops when a new supplier format arrives, you notice early.

What result is "good enough"?

It depends on business impact. Calculate manual entry time per document, the cost of errors and review time together. In most scenarios the goal is not removing people entirely but turning the work from "data entry" into "exception handling". That is where AI process automation projects deliver the most.

An AI project that is not measured is an AI project that is not trusted. As an AI project specialist, my first deliverable is always a measurement set-up.

Frequently asked questions

How many documents are needed to measure accuracy?

For a start, 100–300 documents representing different suppliers and formats give meaningful results in most scenarios. The set grows over time with user corrections from production.

How do you stop an LLM from inventing values?

Combine a structured output schema, an instruction to leave fields empty when not found, and rule-based validation against master data. Invented values should be tracked as a separate metric.

Erhan AI — ERP & SAP Assistant

SAP S/4HANA & AI Consulting

Hello! I am Erhan Deniz's ERP and AI assistant. I can answer your questions about SAP S/4HANA (SD, ABAP, CO-PA), ERP consulting or AI solutions. How can I help you?