Machine Learning in Spend Analytics: How AI Spend Analysis Works, What It Gets Right, and What to Buy
How machine learning classifies spend: line items to a taxonomy, supplier normalisation, confidence and review, accuracy to expect, and services vs software vs a workflow.
Written by Max Zeshut
Founder at Agentmelt · Last updated Sep 18, 2026
TL;DR: Machine learning in spend analytics does one job well — classifying every invoice and purchase-order line into a category, a normalised supplier and a cost centre, with a confidence score — and that job is what makes the rest of spend analysis possible. A trained classifier or a language model with your taxonomy in front of it gets 85–95% of line items right without a person; the remainder goes to a review queue, and every correction improves the next run. The choice is no longer whether to use AI for spend analysis but how to buy it: a consultancy's one-off spend cube, a spend analytics platform, or a workflow that runs monthly in your own systems.
Buildable version: the spend analysis workflow — what arrives, what happens, who reviews, a free template, and the price to have it run for you.
Spend analytics answers a procurement question that sounds simple: what does the company buy, from whom, at what price, and where is the money that could be saved? The reason it is hard is that the answer lives in hundreds of thousands of invoice and purchase-order lines written by suppliers, coded by whoever was in a hurry, and spread across an ERP, a card programme and a few spreadsheets. Machine learning does not change the question. It changes the cost of reading the lines.
What spend analytics is, and where the manual work goes
A spend analysis has five steps, and only the last one is analysis:
- Extract the lines: invoices, purchase orders, expense and card transactions, from every system that pays anyone.
- Cleanse them: one supplier under one name (the ERP has "Amazon", "AMZN Mktp", "Amazon Web Services" and "AWS EMEA SARL" as four vendors), currencies, duplicates.
- Classify every line into a category taxonomy — UNSPSC, a procurement standard, or your own 30–200 categories — plus the cost centre and the contract it should have gone through.
- Enrich with what is not on the invoice: contract terms, preferred-supplier status, diversity or risk flags, market price benchmarks.
- Analyse: the spend cube (category × supplier × business unit × time), maverick spend outside contracts, price variance for the same item, consolidation opportunities.
Steps 2 and 3 are where the weeks go. A consultancy running a spend analysis project puts junior analysts on classification for a month; the result is accurate on the day it is delivered and stale the month after. That is the work machine learning takes.
How machine learning classifies spend
Spend classification is a text-classification problem with a numeric twist. Each line has a supplier name, a description ("HP 305A toner black 2-pack", "consulting services Q2", "MISC"), an amount, a GL account, sometimes a PO reference. The model's job is to map that to a category with a confidence.
Three approaches are in production in 2026, and most systems combine them:
Rules and lookups first. If the supplier is classified and sells one thing, every line from them is that category. If the PO line carries a category, the invoice inherits it. Rules handle 30–60% of lines at 100% accuracy and cost nothing; a system that sends everything to a model is wasting money.
A supervised classifier trained on your history. Gradient-boosted trees or a fine-tuned transformer trained on the lines your team already classified — typically 20,000 to 200,000 examples — learn the company's own vocabulary and coding habits. They are fast, cheap per line and very accurate on categories they have seen often; they are weak on rare categories, new suppliers and descriptions the training set never contained.
A language model with the taxonomy in front of it. A large language model reads the line and the taxonomy definitions and picks the category, with a one-line reason and a confidence. It needs no training data, handles new suppliers and odd descriptions, and can explain itself — which is why it has become the default for the long tail. It is slower and costs a fraction of a cent per line, so it runs on what the rules and the classifier could not settle.
The output of all three is the same: a category, a confidence and, for the language model, a reason. Lines above the confidence threshold are accepted; the rest go to a review queue where a person confirms or corrects in seconds. The corrections are the most valuable data the system produces: they retrain the classifier and become few-shot examples for the model, so the queue shrinks every month.
Supplier normalisation is half the value
Category classification gets the attention; supplier normalisation delivers the savings. The negotiation lever is "we spend $2.4M a year with you across four entities", and you cannot say that while the same supplier sits under four names and three tax IDs.
Machine learning does this with entity resolution: string similarity on names and addresses, matching on tax and registration numbers, and a language model to settle the ambiguous pairs ("is 'Deloitte Consulting LLP' the same supplier as 'Deloitte Tax'?" — usually the same parent, different service). The result is a supplier master with a parent hierarchy, which is what a category manager needs for the consolidation conversation.
Accuracy: what to expect, and how to measure it
Honest numbers for a company with a maintained taxonomy and a few months of corrections:
| Measure | Typical result | What moves it |
|---|---|---|
| Lines auto-classified (above threshold) | 85–95% | Taxonomy clarity, supplier coverage, description quality |
| Accuracy of auto-classified lines | 95–98% at category level | Threshold setting; lower for fine-grained sub-categories |
| Lines to human review | 5–15% | Falls monthly as corrections feed back |
| Spend coverage (value, not count) | 97–99% | Large lines are usually clean; the tail is small amounts |
| Time to first cube | 2–4 weeks from data access | Number of source systems, taxonomy decisions |
Two cautions. First, measure accuracy by value as well as by count: a system that misclassifies 5% of lines but they are the 5% of $30 card transactions is fine; one that misfiles a $400,000 consulting invoice is not. Second, ask any vendor or model how it reports confidence and what happens below the threshold. "98% accurate" with no review queue means 2% of your spend is filed wrong and nobody knows which 2%.
What generative AI adds — and where it does not belong
Language models added three things to spend analytics that classifiers could not do:
- Classification of the long tail without training data, with a reason a reviewer can check in a glance.
- Explanations of the numbers: "Marketing services spend rose 40% in Q2; 80% of the increase is two new agencies onboarded without a contract." The model reads the cube and the changes and writes the paragraph a category manager would have written.
- Questions in plain words over the cube — "how much did we spend on cloud across all entities last year, and with whom?" — answered by generating the query, not by guessing the number.
Where generative AI does not belong: computing the numbers. Totals, variances and savings estimates are arithmetic over classified lines, done by code and checked by reconciliation to the ledger. A model that is asked to "estimate our savings opportunity" will produce a confident figure with no audit trail. The pattern that works is the same as elsewhere in automation: rules and code for everything deterministic, the model for reading, judging and writing.
Services, software, or a workflow: how to buy it
The searches for "spend analysis services" and "spend analysis software" are the same buyer at different budgets. The three options, honestly:
| Consultancy project | Spend analytics platform | Installed workflow | |
|---|---|---|---|
| What you get | A spend cube and a savings report, once | A hosted product with dashboards, refreshed on a schedule | The classification pipeline running in your own systems, monthly |
| Who classifies | Their analysts, their taxonomy | Their models, tuned to your taxonomy over time | Rules, a classifier and a language model, with your reviewers |
| Refresh | A new project (every 1–3 years) | Monthly or continuous | Monthly (or weekly) |
| Typical cost | $50k–250k per project | $50k–500k a year, by spend under management | From a few hundred dollars a month for one ERP source; custom above that |
| Best for | A one-off baseline before a sourcing programme | Large, multi-entity spend with a procurement team to use the dashboards | Mid-sized companies that want the cube current without a platform, in the BI tool they already have |
| Watch out for | Stale in six months; logic stays with the consultancy | Cost scales with spend, not with value; data leaves your systems | You own the taxonomy and the review; someone must look at the queue |
The workflow option is what Agentmelt installs: the spend analysis blueprint reads the lines from the ERP and card feeds each month, runs the rules, the classifier and the model against your taxonomy, sends the uncertain lines to a review sheet, publishes the cube into your BI tool and writes the change summary. It is the same pipeline the platforms run, without the platform. For the wider procurement picture — sourcing, supplier risk, purchase orders — see the supply chain and procurement team page.
Data you need before any of this works
- Invoice lines and PO lines for at least twelve months, with supplier, description, amount, date, GL account and cost centre. Card and expense transactions if they are material.
- A supplier master, however messy — the normalisation step starts from it.
- A taxonomy, or the decision to adopt one. UNSPSC is the safe default for a company that sells or buys internationally; a custom taxonomy of the 30–60 categories procurement negotiates on is faster to get value from. Do not start with 800 categories.
- A reviewer: one person who will spend an hour a week on the queue for the first three months. That hour is what turns 85% into 95%.
Questions, answered
What is machine learning spend analysis?
The use of trained models to do the reading part of spend analysis: classify each invoice and purchase-order line into a category, normalise supplier names into one master, and flag the lines it is unsure about for a person. The analysis itself — the spend cube, maverick spend, price variance — is arithmetic over the classified lines. Machine learning makes the classification continuous and cheap instead of an annual project.
How accurate is AI spend classification?
For a maintained taxonomy: 85–95% of lines classified automatically at 95–98% accuracy, with the remainder reviewed by a person; coverage by value is higher because large lines are usually clean. The number to ask for is not the accuracy but the review rate and how it changes month to month — a falling review queue is the sign the corrections are feeding back.
Do we need machine learning spend analysis services, or software?
Services give you a baseline once; software gives you a refreshed cube for an annual fee that scales with your spend; a workflow installed in your own systems gives you the same monthly refresh for a fraction of the platform cost, if you have a person for the review queue. Mid-sized companies with one or two ERPs usually get the most from the workflow; large multi-entity groups with a procurement organisation to use the dashboards are the platforms' market.
Can ChatGPT or another generative AI do spend analysis?
It can classify lines and explain changes well, and that is exactly how it is used inside the pipeline. On its own, without the rules, the reconciliation and the review queue, it will also produce totals and savings figures that nobody can audit. Use generative AI for the reading and the writing; let code do the counting.
How long does it take to get a first spend cube?
Two to four weeks from access to the source systems, most of it spent on the taxonomy decision and the supplier master. The first cube is 80% right and improves monthly; the consultancy-grade cube arrives after the third review cycle, and it stays current afterwards.