In 2021 an American property company announced that it was closing its home-buying business and writing off more than half a billion dollars. For three years it had used a model to estimate what houses were worth, bought them at those prices, and resold them. The model had performed well in a rising and fairly steady market. When the market shifted quickly, the model went on making offers based on patterns that no longer held, and the company found itself owning thousands of houses for which it had paid too much.

A year earlier, in the first weeks of the pandemic, models across retail, banking and logistics had gone wrong together. Systems trained on years of normal behaviour faced customers who had stopped travelling, started hoarding and moved their shopping online within days. Fraud detectors flagged ordinary purchases. Demand forecasts became meaningless.

In neither case did the software break. The models did exactly what they had been built to do. The world had changed, and the models had no way of noticing.

Why models decay

A machine-learning model captures the relationship between inputs and an outcome as it stood in the training data. It assumes the future will resemble that past. The ways in which it may not have names.

The inputs change. The model was trained mostly on customers aged thirty to fifty and is now seeing many over seventy. It was trained on one supplier's parts and a second supplier has been added. The relationship it learnt may be fine. It is simply being asked about cases it has seen little of. This is called data drift, or covariate shift.

The relationship changes. The same inputs now lead to a different outcome. A message that would have been harmless two years ago matches a new fraud pattern. An income that comfortably supported a loan before interest rates rose no longer does. This is concept drift, and it is the more serious kind, since the model's logic is now wrong.

The data pipeline changes. A source system is upgraded and a field switches from kilograms to grams. A category is renamed. A feed stops and missing values are filled with zeros. In practice this is the commonest cause of sudden failure, and it has nothing to do with the world.

The model changes its own environment. A recommendation system shapes what people click, and is then retrained on those clicks. A credit model decides who gets loans, so outcomes are only ever observed for those it approved. Predictions feed back into the data.

Drift can be abrupt, as in March 2020. More often it is gradual, a slow slide over a year that no single week reveals. It can also be seasonal, returning each December.

The difficulty: the truth arrives late

The obvious thing to monitor is accuracy. Compare predictions with what actually happened.

Often this cannot be done in time. A model predicting whether a loan will default within a year learns the answer a year later. A model predicting which machines will fail learns only about those that were not repaired first. A model flagging fraud learns of the cases someone reported.

So monitoring has to work on three levels, in order of how quickly each can be seen.

Level one: the inputs

These are available immediately and should be checked first.

Are they arriving? Volume per hour or day, compared with the usual.

Are they well-formed? Missing values, values outside the valid range, new categories never seen in training, wrong types.

Has their distribution moved? For each important input, compare recent values with those in the training data. For a numeric field, compare the average, the spread and the shape. For a category, compare the proportions.

Several statistics summarise such a comparison in one figure. One long used in credit scoring is the population stability index, which sorts values into bands and measures how far the proportions in each band have moved. A common rule of thumb treats a value under 0.1 as stable, 0.1 to 0.25 as worth a look and above 0.25 as a significant shift.

Input monitoring catches pipeline faults within hours. It also gives early warning of real change, though a shift in inputs does not prove that predictions have got worse.

Level two: the outputs

Also available immediately.

Has the distribution of predictions moved? If a model that normally approves 70 per cent of applications is approving 85, something has changed, in the applicants or the data.

Is it more uncertain? Many models give a score or probability. A growing share of scores near the middle, where the model cannot decide, suggests it is meeting unfamiliar cases.

How do the people using it respond? If staff override the model's recommendation twice as often as they did, they have noticed something. Override rates are among the most informative signals available, provided overrides are recorded.

Level three: the outcomes

When the truth does arrive, measure properly.

  • Use the measure that mattered at design time, such as precision at the volume the team can handle or error weighted by cost, and not accuracy if accuracy was never the point.
  • Check calibration. Of the cases the model rated at 20 per cent, did about 20 per cent occur?
  • Break it down. By region, product, customer group and channel. An overall figure that holds steady can hide one segment where performance has collapsed. This is also where unfair effects on particular groups become visible.
  • Compare with the baseline. Keep the simple rule the model replaced, and keep scoring it. If the model's advantage over the baseline is shrinking, that is the clearest sign of decay.

Where outcomes are slow, look for faster proxies. A loan's first missed payment comes months before a formal default. A sample of cases can be reviewed by hand each week.

Thresholds, and who acts

A dashboard that nobody is obliged to look at does not count as monitoring. Before launch, write down:

  • which measures are tracked, and how often
  • the level of each that triggers investigation
  • the level that triggers switching the model off
  • who is responsible, by name
  • what the fallback is

The fallback matters. If the model is withdrawn tomorrow, what takes its place? Usually it is the rule that was used before, or a simpler model kept ready. If there is no fallback, the organisation will continue to use a failing model, having no alternative.

Keep the alerts few. A system that raises drift warnings on forty features every week will be ignored within a month.

Retraining

There are two approaches, and most teams end up combining them.

On a schedule. Retrain every month or quarter on recent data. This is simple, and it handles gradual drift without anyone having to detect it.

On a trigger. Retrain when monitoring shows performance has fallen past a threshold.

Either way, retraining should not be automatic and unexamined.

A newly trained model must be tested before it replaces the old one, on recent data it has not seen, against the current model and against the baseline. New is not always better.

Retraining on recent data alone can make a model forget rare conditions. A fraud model retrained on a quiet quarter may lose its knowledge of an attack pattern that will return.

If the data pipeline is at fault, retraining teaches the model the fault. Find the cause first.

After a sudden break, there may be too little data from the new regime to learn from. The honest course then is to fall back on something simple and say that the model is not currently reliable.

Keep versions: which data, which code, which model, in use from when to when. If a decision made last March is questioned, it should be possible to say which model made it.

Language models

Systems built on large language models need the same discipline, and they have some further characteristics.

The model may be supplied by another company, which can update or withdraw it. Behaviour can change without anything having been changed on your side. A fixed set of test questions with known good answers, run regularly, will detect this.

Output is text, so quality is harder to score than a number. Common practice combines automatic checks, review of a sample by people, and tracking of indirect signals such as how often users rephrase a question, reject an answer or ask for a human.

The inputs drift as well. People start asking about a new product, or in a different language.

Proportion

The effort should match the stakes. A model that orders the items in a newsletter needs a weekly glance. A model that influences credit, medical or safety decisions needs formal monitoring, documentation and review. In a growing number of jurisdictions, regulation requires this for systems classed as high-risk.

For most organisations a workable minimum fits on a page:

  1. Volume and validity checks on inputs, daily.
  2. Distribution of predictions, weekly.
  3. Override rate, weekly.
  4. Outcome measures against the baseline, monthly, by segment.
  5. Two thresholds for each, a named owner and a fallback.
  6. A dated log of every change to data sources, features and model.

The property company again

After its losses, the company's chief executive said that the unpredictability of house prices had far exceeded what had been anticipated. There is no reason to doubt the model's quality on the data it was trained on. What was lacking, by the company's own account, was an adequate appreciation of how wrong it could be when conditions moved, and a point at which the buying would stop.

A model has no way of knowing that the conditions it was trained under have ended. Monitoring exists so that a person finds out reasonably soon.