Reading invoices with AI, without sending them to the cloud
Supplier invoices still arrive as PDFs. Somebody opens each one, finds the vendor, types the lines into the ERP and checks that the totals add up. It is slow work, and it is exactly the kind of work a modern language model seems made for.
It is, with one catch: a model that reads an invoice will sometimes read it wrong, and it will do so with complete confidence. Our Document Intelligence is built around that catch.
The printed amounts are the truth
The rule at the centre of the product is simple: the model proposes, the arithmetic decides.
The model reads the page and suggests what the lines are. Ordinary, deterministic code then holds those suggestions against what is printed on the document: the net, the tax, the gross, the amount on every row. If the rows do not add up to the printed net, the reading is not accepted. Where the page itself proves what the right answer is, for example a quantity read a thousand times too large, the code corrects it without asking the model again. Asking again costs seconds and may return a different answer. The arithmetic returns the same answer every time.
The model chooses, it does not invent
The second step is matching the invoice to the company’s own data: which vendor sent it, which purchase order it belongs to, which order lines it bills.
Here the model is never asked an open question. It gets a narrow one with real candidates from the ERP: which of these three vendors, which of these orders. Identifiers such as VAT and registration numbers come first, because they are worth more than a name that is spelled differently on every document.
“We could not check” is an answer too
Every check ends with an explicit result, and “this does not match” is kept apart from “we could not judge this”. The two call for different actions from the person who reads the result. A reading that is doubtful does not get booked; it goes to a person, with the reason attached.
Why on our own hardware
Invoices carry prices, margins, bank details and the names of business partners. Many companies would rather not send them to an external AI service, and some are not allowed to.
Document Intelligence runs its model on our own hardware. Documents are read where they are stored and never leave the building. The trade-off is that we have to work harder for quality, which is exactly why the checks above exist.
What we learned
- One run proves nothing. Even with identical input, a language model does not always give identical output. Rules that the arithmetic can settle are worth more than prompts that usually work.
- Scans need care. A PDF with a text layer reads far better than a scanned image. Scans work, but they read noticeably worse, and that is where we are improving next.
- Structured e-invoices are the next step. Formats such as ZUGFeRD or UBL carry the invoice as data. Reading them is parsing, not recognition, and it is right every time.
If invoice entry takes up too much of your team’s time, let us talk.
Want to talk it through?
We are happy to discuss your software questions.