AI inventory management is sold on one promise: better forecasts, so you never run out and never over-buy. The largest public test of retail forecasting tells a more useful story. In the M5 competition, 5,507 teams forecast Walmart's daily sales; the winning machine-learning method was 77.9% more accurate than a classic method on total sales, and 4.5% more accurate on single products in single stores, the level at which you actually reorder. Most teams did worse than a simple statistical benchmark. For a small online store, the value of AI in inventory is less in a magic forecast and more in what comes after it: deciding, every day and for every product, what the forecast means for an order, a price or a clearance, and leaving the final call with you.
What is AI inventory management?
AI inventory management means using machine learning and software agents to run some of the work of keeping the right stock: estimating demand, setting reorder points and quantities, spotting products that are running low or not selling, and preparing the actions that follow. It is worth separating that work into four jobs, because AI changes each one by a very different amount.

- Count: knowing what you have, where, and that the number is true.
- Forecast: estimating how much of each product will sell over the next weeks.
- Decide: turning the forecast into reorder points, order quantities and clearances.
- Act: placing the order, changing a price, correcting a count.
The cost of getting these wrong is large at every scale. IHL Group, which has tracked the problem for nearly twenty years, puts the global cost of out-of-stocks and overstocks at $1.7 trillion a year in its 2026 study, 6.2% of retail sales, down from 10.4% in 2021. Its definition of an overstock is useful in itself: any time a shopper meets a discount of more than 25%, the store bought more than it could sell at full price.
What the biggest public forecasting test found
Most claims about AI forecasting come from vendors, measured on their own customers, against a baseline they chose. The cleanest independent evidence comes from the M competitions, a series of open forecasting contests run by academics since 1982. The fifth one, M5, was the first built on retail sales. Its organisers published the results in the International Journal of Forecasting, and the data, code and winning methods are public on the M5 competition site.
The task was to forecast 28 days of unit sales for 3,049 Walmart products across ten stores in three US states, using five years of daily history plus prices, promotions and calendar events. The forecasts were scored at twelve levels of detail, from total sales across all stores down to each product in each store: 42,840 series in all. The contest ran on Kaggle and drew 7,092 participants in 5,507 teams from 101 countries.
Three findings matter for a store owner.
The winners were machine-learning methods, and the margin was real. The winning team was 22.4% more accurate overall than the best simple benchmark, an exponential smoothing method; the top five were all more than 20% better. Most of the leading entries used LightGBM, a fast gradient-boosted tree library that learns one model across all products at once, so a slow product can borrow patterns from thousands of others.
Most teams lost to the simple benchmark. Only 415 of the 5,507 teams beat every benchmark, and the majority were more than 13% less accurate than plain exponential smoothing. Machine learning in expert hands won; machine learning on its own did not.
The advantage shrinks to almost nothing at the level you reorder. This is the finding vendors rarely quote.

Compared with Croston's method, a 1972 technique built for products that sell irregularly, the winning forecast was 77.9% more accurate for total sales across all stores, 56.7% more accurate for each store's total, and 41.7% more accurate for each department in each store. For each product across all stores the gain fell to 10.8%. For each product in each store, the series a store actually orders against, it was 4.5%.
The reason is not that the machine-learning methods were weak. It is that totals are smooth and individual products are not. Add up thousands of products and the randomness cancels: weekdays, paydays and holidays show up as clean patterns any good model can learn. Look at one product in one store and most days are zero, a few are one or two, and the occasional day is ten. No method can predict which day the ten arrives.
Why single products are so hard to forecast
The organisers describe most of the M5 series as intermittent: sporadic demand with many zeros. That is the normal state of a small online store's catalogue. A shop with 400 products might have 30 that sell every day and 370 that sell a few times a month.
Intermittent demand has its own literature. In 1972, J. D. Croston showed that forecasting such products with ordinary methods systematically misjudges them, and proposed forecasting the size of each sale and the gap between sales separately. Later work by Syntetos and Boylan measured and corrected a bias in Croston's estimates, and these methods remain standard in inventory software. M5 confirmed that they still hold their own at the product-in-store level.
For a store owner, the practical consequences are:
- Judge a forecasting tool by its accuracy on products like yours, not on totals. A tool that is 40% better on your store's monthly revenue can be barely better on the slow sellers where your stock problems live.
- Expect uncertainty, and plan for it. For a product that sells twice a month, the honest forecast is not "2.1 units" but a range. What protects you is a sensible buffer and a fast reaction, not a sharper point estimate.
- Aggregate where you can. If you order a T-shirt from one supplier in six sizes, forecast the style first and split by size second. The total is far more predictable than any single size.
A good free reference on all of this is Hyndman and Athanasopoulos's textbook Forecasting: Principles and Practice, which also explains how to compare any forecast against a naive one, the first test every forecasting claim should pass.
Where AI actually earns its keep
If the forecast for a single slow product can't get much better, where does AI change the result? In M5 and in practice, in four places.
1. It uses more than past sales. M5 gave teams prices, promotions and event calendars. Adding those explanatory variables made the classic methods better too: in the organisers' comparisons, exponential smoothing with explanatory variables was on average 6% more accurate than without, and ARIMA 13% more accurate. A store knows when it will run a promotion, send an email or appear in a gift guide. A forecast that knows it too is better than one that only looks backwards.
2. It learns across products. One model trained on the whole catalogue can tell that a new product resembles twenty older ones, and forecast it from their history before it has much of its own. This is the main reason gradient-boosted models won M5, and it is most useful for exactly the products that have the least data.
3. It decides, for every product, every day. This is the largest gain for a small store, and it has little to do with forecast accuracy. A person checking stock once a week looks at the products that shout. Software can recompute a reorder point for all 400 products each morning, weigh supplier lead times, notice that a product's sales have doubled since a mention in a newsletter, and flag a reorder before the stock runs out rather than after.
4. It notices when the data is wrong. A product that shows stock but hasn't sold for weeks while shoppers keep asking for it is often a counting error, not a demand problem. Spotting that pattern is easy for software and tedious for people.
The economics: how much safety stock is enough?
Every reorder decision rests on one trade-off: the cost of running out against the cost of holding more. Safety stock is the buffer that covers the uncertainty in demand and supplier lead time, and the standard formula makes the trade-off visible. For normally distributed demand, safety stock equals a service factor (z) times the variability of daily demand times the square root of the lead time in days.

In our illustrative example, a product whose daily demand varies by about three units, ordered from a supplier with a 14-day lead time, needs 14 units of safety stock to be in stock through 90% of order cycles, 19 units for 95%, 26 units for 99% and 35 units for 99.9%. Going from 95% to 99% adds 41% more buffer; going to 99.9% nearly doubles it. The last few percent of availability are the most expensive stock you will ever hold.
So the right service level is a business decision per product, not a single store-wide setting. The textbook rule comes from the newsvendor problem: the target in-stock probability equals the cost of a lost sale divided by the cost of a lost sale plus the cost of a leftover unit. If running out of a product loses you €30 of margin, and each unit left over costs you €5 to hold until it sells, the target is 30 ÷ 35, about 86%. For a product with a thin margin and a high holding cost, it is lower still. A store that runs every product at 99% is almost certainly over-stocked on its slow, low-margin items, which is where dead stock comes from; our guide to dead stock and what it costs picks up from there.
Two practical notes. First, variability counts more than volume: a product that sells a steady ten a day needs less buffer than one that sells nothing for a week and then thirty. Second, lead time enters under a square root, so halving a supplier's lead time cuts the buffer by about 29%, not 50%, but it also cuts the demand you have to cover while you wait, which usually matters more.
If you want the full reorder-point method worked through for Shopify, including how to set it without an app, we covered it in Stocky alternatives: what Shopify replaced, and what it didn't. For peak season, where the sales rate in your stock calculation is the wrong one, see Black Friday inventory planning.
Before any AI: is your count true?
Every method in this piece assumes the stock number in your system is right. Often it isn't: a variant received but not entered, a return put back on the shelf without a record, a damaged unit still counted. A forecast built on a wrong count is wrong with confidence, and an automated reorder built on it multiplies the error.
Shopify shows each product's sell-through rate and days of inventory remaining in its product analytics, and its purchase orders record what is on the way, so incoming stock is counted when it arrives. A regular count of your fastest movers and anything that looks odd does more for your inventory than any model can do with a wrong number.
What to ask before you buy an AI inventory tool
The M5 results translate into six questions for any vendor:
- Accuracy at which level? Ask for accuracy per product, or per product per location, not only for total demand.
- Against what baseline? A claim of "30% better" means little until you know the comparison. Ask how the tool does against a simple method such as exponential smoothing or a seasonal naive forecast on your own data.
- How does it handle slow sellers? Look for an answer that mentions intermittent demand, not one that treats every product the same way.
- What else does it use? Prices, promotions, marketing calendars, supplier lead times. A forecast that ignores your own promotions will be surprised by them.
- Who places the order? Software that drafts a purchase order saves time. Software that sends one without asking can spend a month's cash on a counting error.
- What is logged? You should be able to see why a recommendation was made and who approved the action.
How we approach inventory at Lumnya
Lumnya is a team of ecommerce AI agents for Shopify stores, in private beta. Inventory is handled by more than one of them, and we are deliberately conservative about what each one claims.
The Inventory Forecaster predicts stock-outs and over-stocks from each product's demand trend. It flags the products heading for a stock-out, by urgency, with a suggested reorder quantity for the merchant to decide on, and the ones holding far more than their demand needs. When a product's stock recovers, its recommendation is cleared automatically, so the list only shows what still needs attention.
At the other end, the Liquidation Planner looks for products that hold stock but have stopped selling and proposes a bounded clearance for the merchant to approve, as described in our piece on dead stock.
And for the count itself, a merchant can hand Lumnya a stock-count sheet and have it applied to Shopify. Because a wrong stock number lets a store sell goods it doesn't have, that action is confirmation-gated every time, never automatic: it shows what will change, refuses to overwrite a quantity if a sale lands between the preview and the approval, and asks which location when a store has more than one. Every action is confirm-gated and logged.
Where we could be wrong
M5 is one dataset: a large US retailer's grocery, household and hobby products between 2011 and 2016. A small online store's demand differs in many ways, including fewer products, more volatile marketing, and shorter histories, and the gaps between methods could be larger or smaller in your catalogue. We compared against Croston's method because the organisers published that comparison per level; against the exponential smoothing benchmark the pattern is the same, with different numbers: the winner was 53% more accurate on total sales and 3.4% per product per store. Our safety-stock example assumes normally distributed demand, which slow sellers often don't follow; for them, simulation or a method designed for intermittent demand gives better buffers. And machine-learning forecasting improves each year, so the gap at the product level may well narrow.
The short version
- AI inventory management covers four jobs: count, forecast, decide, act. AI changes deciding the most and counting the least.
- In the M5 competition, 5,507 teams forecast Walmart sales. The winner beat a classic method by 77.9% on totals and 4.5% per product per store; most teams lost to a simple benchmark.
- Single products are hard to forecast because their demand is sporadic. Plan buffers and react fast rather than chase a perfect forecast.
- Safety stock rises steeply with the target in-stock rate: in our example, 19 units for 95% and 35 for 99.9%. Set the target per product from margin and holding cost.
- Check your counts before you trust any forecast, and keep the final action with a person.
Frequently asked questions
What is AI inventory management?
It is the use of machine learning and software agents to estimate demand, set reorder points and quantities, flag products that are running low or not selling, and prepare the orders, price changes or clearances that follow, usually for a person to approve.
Is AI better than traditional inventory forecasting?
In the M5 competition, the best machine-learning methods were clearly more accurate overall, 22.4% better than the best simple benchmark. But the advantage was large for totals and small for single products in single stores, and most teams using machine learning did worse than the simple benchmark.
Can a small Shopify store use AI for inventory?
Yes, but the gains come mostly from automation and better decisions, not from dramatically better forecasts. Daily checks on every product, reorder suggestions that account for lead times, and early warnings on slow sellers are where a small store sees the difference.
How do you forecast demand for slow-selling products?
Use methods designed for intermittent demand, such as Croston's method or its corrected variants, forecast at a higher level (the style rather than each size) where you can, and hold a buffer sized to the product's margin rather than aiming for a precise point forecast.
How much safety stock should I keep?
Safety stock is a service factor times the variability of daily demand times the square root of the lead time in days. Choose the service level per product: high for products with high margins and cheap storage, lower for thin-margin or bulky items. In our example, moving from 95% to 99% availability needs 41% more buffer.
Should AI place purchase orders automatically?
We don't think it should without approval. A draft order prepared by software saves time; an order sent without a person checking it can turn a counting error into a month of tied-up cash.
Sources
- [1] IHL Group, “The 2026 Inventory Distortion Study” (overview page) (accessed 2026-11-06)
- [2] Spyros Makridakis, Evangelos Spiliotis and Vassilios Assimakopoulos, “M5 accuracy competition: Results, findings, and conclusions”, International Journal of Forecasting 38(4), 1346–1364, 2022 (Tables 1, 3, 4 and 5) (accessed 2026-11-06). Open copy
- [3] Makridakis Open Forecasting Center, University of Nicosia, “M5 competition” (accessed 2026-11-06)
- [4] Kaggle, “M5 Forecasting – Accuracy” (accessed 2026-11-06)
- [5] Microsoft, “LightGBM” (gradient boosting framework) (accessed 2026-11-06)
- [6] J. D. Croston, “Forecasting and Stock Control for Intermittent Demands”, Operational Research Quarterly 23(3), 1972 (accessed 2026-11-06)
- [7] Aris A. Syntetos and John E. Boylan, “The accuracy of intermittent demand estimates”, International Journal of Forecasting 21(2), 2005 (accessed 2026-11-06)
- [8] Rob J. Hyndman and George Athanasopoulos, “Forecasting: Principles and Practice”, 3rd edition (accessed 2026-11-06)
- [9] Wikipedia, “Safety stock” (accessed 2026-11-06)
- [10] Lumnya, “Dead stock: what it means, what it really costs, and how to clear it”, 18 Dec 2026 (accessed 2026-11-06).
- [11] Lumnya, “Stocky alternatives: what Shopify replaced, and what it didn't”, 22 Jul 2026 (accessed 2026-11-06)
- [12] Lumnya, “Black Friday inventory planning”, 4 Nov 2026 (accessed 2026-11-06)
- [13] Shopify Help Center, “Product analytics overview” (accessed 2026-11-06)
- [14] Shopify Help Center, “Purchase orders” (accessed 2026-11-06)
Lumnya is a team of ecommerce AI agents for Shopify stores, now in private beta. Join the waitlist.
Comments
…Every comment is read and approved by a human before it appears — the same confirm-gated rule the product runs on.
Loading comments…
Filed under AI & Commerce
All posts