Own Weights

Intelligent document processing vs LLM extraction

Intelligent document processing vs LLM: how template IDP and OCR rules compare with a trained model on accuracy, cost and upkeep, with exam results.

Updated

Part of: AI for customs and logistics

Intelligent document processing (IDP) is software that reads a document and pulls out its fields, such as a total, a date or a party name. A trained LLM does the same extraction by reading the text and returning the values, and on one public exam a fine-tuned open-weight model scored higher than Claude Opus and Claude Haiku. That result comes from training for one task, so it does not show that LLMs beat every IDP product on every document. Template IDP fits fixed forms; a trained LLM is worth testing when template upkeep is your main cost.

How does template IDP work, and where does it break?

Template IDP and OCR rule sets find fields by position, by an anchor phrase, or by a zone drawn on the page. A rule might say the total sits in the box to the right of “Amount due.” That works while every document looks the same. When a supplier moves the field, adds a column or sends a slightly skewed scan, the rule misses, and someone writes a new template.

Here is a hypothetical with round numbers. A team keeps 40 templates for supplier invoices. In one month, three suppliers change their layouts, and 12 documents fall through to manual review. Each fix is small, but the template library keeps growing, and nobody owns it.

An LLM does not replace OCR. OCR turns an image into characters, and a text model needs characters, so a scanned page still goes through OCR or through a vision model that reads the page directly. What an LLM replaces is the rule layer: the zones, anchors and regular expressions that decide which text is the total. For the cost of reading pages with each method, see OCR vs vision LLMs: cost per page.

Which is more accurate: LLM vs template-based extraction?

Accuracy here means the share of values that match the source text exactly. A near miss, such as a value with one dropped digit, counts as wrong.

We scored models on CUAD, a public set of 510 commercial contracts with passages marked by lawyers. The task was to find 10 kinds of passage and quote each one exactly. Scoring used 5-fold cross-validation, so every document was scored by a model that never saw it in training.

Model Exact-quote score (1.0 is perfect)
Our Accuracy model 0.717
Our Standard (fast) model 0.650
Claude Opus 0.635
Claude Haiku 0.584

Our Accuracy model led Claude Opus by 0.082 and Claude Haiku by 0.133. Both gaps are larger than the margin of error, and the Accuracy model was ahead of both in all 5 groups of 102 documents. Claude got one prompt with no examples and no task training. Our models were fine-tuned for this exam. The full benchmark results are published.

Two limits matter. Contracts are not invoices, and we did not run template IDP tools on this exam, so this page does not rank them. This is also extraction work only. It is not a legal product or legal advice.

What does each method cost at volume?

Cost per document is the number most buyers need. On the same exam, our Accuracy tier cost $4.50 per 1,000 documents and our Standard tier cost $3.54. Claude Haiku cost $4.95, and Claude Opus cost $154.49, at list price for the tokens it used. Per document, that is $0.0045 for ours and $0.155 for Opus.

Claude list prices are $4 per million input tokens and $20 per million output tokens for Opus, and $0.10 input and $0.50 output for Haiku. Anthropic’s Batch API is half price. For OpenAI, Google or other vendors, check their current pricing pages, since prices change.

Template IDP is priced differently, usually as licenses plus template work. Compare the total: license, template upkeep, manual review and the cost of any model calls.

Throughput matters for large batches. With 32 requests at a time, the Accuracy tier processes about 5,100 tokens per second and the Standard tier about 14,000, counting input and output across all requests. The Standard tier handles 2.7x more documents an hour than Accuracy. One request at a time, they write about 90 and 174 output tokens per second. Through the API, one request at a time on the same contract prompts, Claude Opus wrote about 114 output tokens per second and Claude Haiku about 200. For a batch, the API’s rate limits cap how many requests you can run at once.

How do you keep extraction accurate as documents change?

A trained model is not finished at launch. Its accuracy depends on documents that look like the training set. If a supplier changes its invoice format, or a new contract type appears, the model needs new labeled examples and a retest. Template rules fail on layout changes. Trained models fail when the document mix drifts. Both need a schedule and a held-out test set. The guide on retraining a fine-tuned model covers the upkeep side.

Keep a person on low-confidence items either way. The model assists the people who review its output. It does not replace their judgment.

When is template IDP the right choice?

Stay with template rules if your documents come from one form, the layout never changes, and the current tool already meets your error budget. Rules are cheap to explain and easy to audit. A fine-tuned model needs a labeled set, a test, and someone who can judge the errors. If you have none of those, the switch will cost more than it saves.

How do you test IDP against an LLM on your own documents?

Start with a labeled set from your own files. Split it by document, not by page, so no document appears in both training and testing. Include the layout changes you actually see, not only the clean samples. Score the current IDP tool and each LLM on the same held-out set with the same exact-match rule. Then compare three numbers: exact accuracy, cost per correct field, and manual review time. The LLM evaluation guide covers building that test set in more detail.

If your template library is growing and your error rate is the problem, a trained model is worth testing. Run the free AI cost audit on the code that calls your models, or book a call from the homepage and we will look at a sample of your documents with you.

Questions

Can LLMs replace OCR?

Not on their own for scanned pages. OCR or a vision model still turns the image into text, and the LLM takes over the rule layer that picks out the fields. Whether that is worth it depends on how often your layouts change.

Which is more accurate, an LLM or template-based extraction?

On the public contract exam we ran, a fine-tuned open-weight model scored 0.717 against 0.635 for Claude Opus and 0.584 for Claude Haiku. We did not run template IDP tools on that exam, so test your own labeled set before you decide.

What is the best AI for extracting data from PDFs?

There is no single best model. The right one is the cheapest model that passes an exact-match test on your own PDFs. Run the current model, a frontier model and a trained model on the same held-out set.

Should I replace IDP software with an LLM?

It can make sense when your documents change often and template upkeep is the main cost. Keep the IDP tool if the forms are fixed and it already meets your error budget. Measure cost per correct field before you switch.

What is the most accurate way to extract data from documents?

Score each method on a labeled set from your own files, using the same exact-match rule for all of them. Use a trained model if it wins that test, and send low-confidence fields to a person.