Back to blog

AI vs Rule-Based Invoice Coding: Why Predictable Beats Smart

There's a quiet problem with AI-assisted accounting software that nobody puts in the marketing copy: it guesses. Most of the time the guesses are right. When they're wrong, you don't get a warning. You get a reconciliation at month-end where the numbers don't match, and someone has to go hunting for which invoices landed in the wrong account.

AI vs Rule-Based Invoice Coding: Why Predictable Beats Smart

There’s a quiet problem with AI-assisted accounting software that nobody puts in the marketing copy: it guesses.

Most of the time the guesses are right. When they’re wrong, you don’t get a warning. You get a reconciliation at month-end where the numbers don’t match, and someone has to go hunting for which invoices landed in the wrong account.

For a bookkeeper with a handful of clients, that’s annoying. For a finance team processing hundreds of invoices a month, it’s a real tax on accuracy. It’s also the reason Datamolino’s invoice coding automation runs on deterministic rules rather than predictive models.

This isn’t an argument against AI, OCR and data extraction from PDFs have improved enormously because of it, and Datamolino uses that work too. The question is where AI belongs in the pipeline and where it doesn’t. Account code assignment, we think, is one of the places it doesn’t.

What “AI coding” actually does

When Xero or Dext suggests an account code, the software is usually looking at the supplier, looking at your past coding decisions, and producing a probabilistic guess. Sometimes it’s trained on your history, sometimes on aggregated patterns across many customers. Either way the output is a prediction, not a rule.

Predictions are right most of the time. They’re also wrong some of the time, in ways that are hard to anticipate.

Keith Bristow runs accounts payable for a multi-entity UK company processing about 800 invoices a month. He put it bluntly:

“The AI-driven coding in Xero is inconsistent, often misallocating invoices about 2% of the time, making deterministic control necessary.”

— Keith Bristow, Multi-Entity Company (UK, 800 invoices/month, 415 self-billing)

Two percent sounds small until you do the arithmetic. And those are only the ones that get caught.

The real cost of a 2% error rate

The headline cost is the time spent fixing mistakes. That’s easy to quantify. a junior bookkeeper can usually correct a miscoded invoice in a few minutes once they know it exists.

The harder cost is the time spent looking for mistakes you’re not sure are there. When you know the system is probabilistic, you can’t fully trust any batch. You end up spot-checking, running variance reports, comparing this month’s P&L to last month’s to see if a category looks off.

Molly Leith, who runs AP automation for a UK firm doing 600 invoices a month, described why she switched:

“Predictable, rule-based automation avoids AI-generated guesses, ensuring accuracy and control.”

— Molly Leith, AP Automation (UK, 600 invoices/month across 2 entities)

Control is doing a lot of work in that sentence. In accounting, control is the basis on which auditors, reviewers, and finance leadership trust the numbers. A system you can’t fully explain is a system you can’t fully control.

How rule-based coding works in Datamolino

Instead of predicting where an invoice should go, Datamolino follows rules you set once. The logic is simple enough to describe in a paragraph, which is sort of the point.

When an invoice arrives, Datamolino checks whether you’ve defined rules for that supplier. If you have, it applies them. The rule might be “every invoice from British Gas goes to account 7100 (Utilities).” Or layered: “invoices from this supplier usually go to 7100, but if the line mentions ‘installation’ or ‘callout’, send those to 7120 (Repairs & Maintenance).”

Rules sit in a hierarchy. Folder-level defaults catch suppliers you haven’t configured yet. Supplier-level rules override the folder, And within a supplier, keyword rules handle the fact that line-item descriptions are rarely consistent.

That last point matters more than people expect, suppliers are bad at naming things consistently. A freight charge might be “Shipping” on one invoice, “Freight” on the next, “Carriage & Packing” on another, “Delivery fee” after that. All four mean the same thing for accounting purposes. An AI model will often work this out. Sometimes it gets clever and decides “Carriage & Packing” must be something else, you won’t know which happened until you check.

A keyword rule just says: if the description contains shipping, freight, delivery, carriage, or postage, code it to account X. It will behave the same way this month and next year. Keith again:

“Keyword rules allow consistent automatic coding even when descriptions vary slightly, ideal for recurring items like shipping charges.”

— Keith Bristow, on real-world application of deterministic coding

The rule is visible, editable, explainable. If it’s wrong, you can see why and fix it in one place. If an AI model is wrong, you can retrain it and hope.

What you give up with rules

Rule-based systems do cost you something, the main thing is upfront configuration. When a new supplier appears you set up rules for them, rather than getting an AI suggestion on the first invoice. Folder-level defaults soften this, but somebody still decides where a new supplier belongs.

For high supplier-churn accounts, that’s real overhead. For most accounts, where the bulk of invoices come from a stable list of 50 to 200 recurring suppliers, it’s one-time setup that pays back within a few cycles.

The other trade-off: rule-based systems don’t learn from your corrections in a generalised way. If you correct an AI, a good model will eventually get better at that pattern. If you correct a rule-based system, you edit the rule. Targeted and immediate, but also your responsibility. Some teams find that reassuring. Others find it annoying. Both reactions are fair.

The audit question

One thing that rarely gets mentioned in product comparisons: auditability. If your external auditors ask why a particular invoice was coded to a particular account, “the AI suggested it and we accepted” isn’t a great answer. It isn’t legally wrong (humans reviewed and approved), but it doesn’t give you a defensible trail.

“The rule we set for this supplier in 2023 sends all matching invoices to 7100” is a different kind of answer. It points to a decision made by a person, documented, consistently applied. Audit teams like that kind of answer. For regulated industries, or any business where finance controls get examined seriously, the distinction matters.

When AI coding is fine

Not every business needs deterministic coding. A solo freelancer processing 20 invoices a month is probably fine with AI suggestions and quick human review. The error rate is low in absolute terms, corrections are cheap.

The maths changes when volume goes up, when more than one person handles the books, or when someone’s going to audit the output. 2% unpredictable errors stop being acceptable once you’re doing several hundred invoices a month across multiple entities.

Bottom line

The ai vs rules based coding question isn’t really about which technology is better. It’s about which kind of error you’d rather live with: the occasional wrong rule you can see and fix, or the occasional wrong prediction you have to catch by looking.

For high-volume invoice coding automation, where auditability and month-end sanity matter more than effortless onboarding, predictable wins. Rules aren’t glamorous. They just don’t surprise you.

If you’re comparing options, we’ve also written a detailed Dext Prepare alternative breakdown that goes deeper on the coding differences.

Try Datamolino free — process 100 documents at no cost.