Our Model Learned That Nobody Wanted The Things We Had Run Out Of

by Serguey Shinder

In 2024 we started using a machine learning model to help decide which products each branch should stock. Every quarter it read two years of sales by branch and line and proposed what to keep, what to add and what to drop, and a range manager signed off each list. Its proposals were sensible enough that most were approved as they stood.

In the spring of 2025 the manager of our Cardiff branch asked why he could no longer order eighteen millimetre OSB boards into stock. Builders asked for them every day. The quarter before, the model had proposed dropping them from his range, and the range team had agreed, because the sales history showed almost nothing for five months.

The sales history was accurate. For most of those five months Cardiff had had no boards to sell. A supplier problem the previous autumn left the branch empty for six weeks, the replenishment rules then trimmed the order because recent sales were low, and the smaller deliveries sold out within days of arriving. Each time the shelf was empty, a customer asked, was told no, and bought elsewhere. None of that reached any system. As far as our data was concerned, a day with no stock and a day with no customers looked exactly the same: a zero.

The model had done precisely what we asked. It learned demand from sales, and sales only record what we managed to sell. Every time we failed to have something, it concluded the product was less wanted and proposed holding less of it, which made the next failure more likely. When we went looking, about a hundred and forty lines across our branches were somewhere in that spiral.

I had thought of our sales history as a record of what customers wanted. It is a record of what they wanted that we happened to have at the time, and its gaps sit exactly where we let them down.

So we changed what the model reads. Every day a line had no stock in a branch is now marked, and those days are left out when demand is estimated instead of being counted as nothing. Counter staff have a single button for a customer who asked for something we did not have, and about four thousand of those are recorded a month. Any proposal to drop a line, or cut its stock by more than a third, shows the range manager how many days it was unavailable and how often it was asked for, beside the sales.

The boards went back on the Cardiff range that June and have been in its top fifty lines since.

A model trained on our sales learns our failures as faithfully as our successes, and it cannot tell them apart unless somebody writes down the days we had nothing to sell.

– Serguey Asael Shinder

Leave a Reply