Blog

Models drift. Plants drift faster

A model is a photograph of a plant. The plant does not hold still for long after the shutter clicks.

Date

Nothing broke, and that was the trouble

Here is a story I have heard in several versions, from several plants, and it always goes the same way.

A model is built to predict some quality, say the melt index of a polymer. It is tested hard. It is good. It goes into service with a small ceremony and a cake. For three months people check it against the lab every day and it is right. By six months they check it weekly. By nine months it is furniture.

Then one day a batch goes off-spec that the model had called fine, and somebody goes back through the record. The model had been wandering for months. Not wildly. A little worse each week. No error message, no alarm, no crash. Software that fails usually has the decency to stop. A model that fails goes on producing numbers of exactly the same shape as before, with the same number of decimal places.

What had changed? Nothing in the model. Not one coefficient. That is the point.

The plant moved

A model learns how a plant behaved during the months it was shown. It knows nothing else. And a process plant is a thing in slow, constant motion.

Catalyst loses activity from the day it is loaded. Heat exchangers foul, so the same duty needs a hotter utility. Pump impellers wear. A feedstock contract ends and the new supplier's material is within specification and different all the same. Summer comes and the cooling water is eight degrees warmer. An instrument is recalibrated, and the reading the model thought it understood now means something slightly else. Somebody retunes a control loop. A debottlenecking project puts in a bigger exchanger.

Each of these moves the plant a short distance from the one in the photograph. I sometimes think data people picked up the word "drift" from fields where the world changes slowly: shopping habits, the wording of emails. A plant is not like that. A plant has a turnaround every few years in which large pieces of it are literally replaced.

There are two different things going on, and it helps to keep them apart. In one, the inputs wander somewhere the model has never been: a feed rate higher than any in its training, a new grade. The model is then guessing, and it will not tell you so. In the other, the inputs look familiar but the relation between input and output has shifted, because the catalyst is older or the exchanger dirtier. The first you can spot from the inputs alone. The second you only catch by comparing predictions with what really happened.

Looking after a model like a machine

Nobody at a plant is surprised that a pump needs attention. There is a schedule, a vibration route, a man with a grease gun. A model deserves the same dull respect, and for the same reason: it is a working part.

So you watch the inputs, and flag the day they leave the range the model was trained on. You keep score: every lab result that comes in is set against what the model said, and the running error is plotted where people will see it. You decide in advance what error is too much, so that the question is not argued afresh each time by whoever is most tired.

And you make retraining ordinary. Fresh data, the same recipe, a test against the model now in service, a record of which version ran when. If that takes a specialist a fortnight each time, it will not be done. If it is a routine job that runs after each turnaround and whenever the score slips, it will. Most of what goes under the name of MLOps and data engineering comes down to that: making the care of a model as unremarkable as an oil change.

One more thing, a human one. Tell the operators the model will drift. Say it on the first day. If they are promised a thing that is always right, the first miss ends the relationship. If they are told it is an instrument that needs calibrating like any other, a miss is just a work order.

The model in my story was retrained and went back into service, and has behaved since. Nobody baked a cake the second time. I take that as a sign of progress.