Design paper
Demand forecasting under high volatility: a design for multi-region commerce
Abstract
Commerce demand is shaped by sales events, promotions, price changes and sudden shifts in attention, and inventory, marketing and delivery decisions all depend on forecasting it. We describe a design for forecasting demand across many products, stores and regions when that demand is volatile. The design has five layers: a data and signal layer with explicit event and price covariates, a feature layer with region and product embeddings, a model layer that runs classical, global deep and attention-based models side by side, a reconciliation and calibration layer that makes forecasts coherent across the product and location hierarchy, and a serving and monitoring layer. We argue each choice from published work on probabilistic forecasting, forecast reconciliation, proper scoring rules and recent evidence on when Transformer models do and do not help. We give a map from components to evidence, a worked example of why percentage errors mislead on low-volume series, and the evaluation protocol a deployment would need. We report no accuracy figures of our own. This is a design proposal, not a measured result.
Method. Design paper: the architecture is argued from the cited literature; we report no measurements of our own. Table 2 is a worked model with its inputs shown.
1Context and motivation
Many commerce decisions rest on a demand forecast: how much stock to buy and where to place it, how much safety stock to hold, how hard to push a promotion, which delivery promise to show, and what carrier capacity to book. Errors during a sales event, a promotion or a sudden rise in interest in one product matter most, because that is when stock-outs and overstock are largest.
Classical forecasting treats a series as trend, seasonality and noise. That decomposition works well when the series is long, regular and slowly changing. Commerce demand often is not. Sales events and promotions are dense and overlap; prices and discounts change; new products have no history; currency and payment conditions differ between regions; and some products sell a few units a week while others sell thousands. A single model family tuned for one of these conditions tends to fail on the others.
This paper describes the forecasting architecture we propose for that setting. Its unit is a product at a store or location in a region, at daily resolution, with an hourly path for a small set of high-volume products. We describe the design and the reasons for each part of it. We do not report accuracy results, because we have not run the evaluation that would produce them.
2Background
2.1Classical models
Autoregressive integrated moving average models, with their seasonal extension, describe a series through its own lags and lagged errors after differencing, and come with a full procedure for identification, estimation and diagnostic checking1. Exponential smoothing, including the Holt-Winters method with trend and seasonal components, weights recent observations more heavily than older ones2. Both are fitted series by series and are cheap, but a model fitted to one short series cannot borrow from thousands of similar series, and an event that has never appeared in that series cannot be anticipated.
2.2Global and probabilistic deep models
DeepAR trains one autoregressive recurrent network on a large number of related series and produces a full predictive distribution rather than a single value; its authors motivate it with retail demand, where the right quantity of stock in the right place depends on the distribution, not the mean3. N-BEATS uses a deep stack of fully connected layers with backward and forward residual links; it was evaluated on the M3, M4 and TOURISM competition datasets, and a variant of it produces interpretable outputs4. Both are global models: parameters are shared across series, which is what lets a new or sparse series draw on the others.
2.3Attention-based models
The Temporal Fusion Transformer handles the mix of inputs that commerce forecasting has: static covariates such as product category, inputs known in advance such as a planned promotion or a holiday, and inputs observed only in the past such as page views. It uses recurrent layers for local patterns, interpretable self-attention for long-range dependencies, and gating and variable-selection components to suppress inputs that do not help5. A line of work adapts attention to long horizons. Informer reduces the cost of self-attention on long sequences6; Autoformer makes series decomposition an inner block of the model and replaces point-wise attention with an auto-correlation mechanism7; PatchTST splits each series into patches that serve as input tokens and shares weights across series8.
2.4The case against assuming attention helps
The evidence on Transformers for forecasting is not one-sided. On nine real datasets, a set of one-layer linear models outperformed the Transformer-based long-horizon models of that time in every case, often by a large margin; the authors argue that permutation-invariant self-attention loses temporal ordering information9. We take this as a design constraint, not a footnote: no model family is adopted for a segment unless it beats simple and classical baselines on that segment under the same protocol.
2.5Retail hierarchies
Commerce forecasts are needed at several levels at once: product, category, store, region. The M5 competition set the task in this form, asking for forecasts of 42,840 hierarchical unit-sales series from Walmart, with forecasts at the lowest level summed upward to the other levels10. When each level is forecast separately, the forecasts do not add up. Reconciliation adjusts them so that they are coherent2. The trace minimisation method uses the full covariance matrix of forecast errors and minimises the mean squared error of the coherent forecasts across the whole collection, assuming unbiased base forecasts, with a closed-form solution11.
3What the design must handle
We set six requirements from the setting described above. They are design choices, not findings.
- Regime changes. Large deviations during events are often the most important points for the business, so the design must model them as signal with explicit event inputs rather than discard them as outliers.
- Heterogeneity across regions. Regions differ in event calendars, currencies and payment conditions. The design lets the model learn region-specific effects rather than assume one seasonal profile.
- Exogenous inputs. Promotions, prices, holidays, stock-outs and supply constraints enter as covariates, not as unexplained noise.
- Uncertainty. Inventory decisions need quantiles, so every model in the stack produces a predictive distribution or a set of quantiles.
- Operator trust. A planner has to see which inputs moved the forecast.
- Cost and latency. Nightly forecasts cover many series; the intra-day path covers few, and the compute budget for each is fixed in advance.
4Architecture
The stack has five layers.
4.1Data and signal layer
The grain is product by store or location by region by day, with an hourly grain for a small set of high-volume products. Inputs are orders, views, add-to-cart events, cancellations, returns, stock-outs, prices, discounts and promotions. Exogenous inputs are holidays and planned sales events, logistics constraints, and macroeconomic indicators where they are available for the region.
Sales recorded while an item was out of stock understate demand, so the design flags those periods to keep the model from learning the constraint as a fall in demand.
4.2Feature and embedding layer
Each region and product receives a learned embedding, combined with calendar features (day of week, week of year) and event indicators. The region embedding is where differences in seasonality and response to promotions are absorbed. Inputs are labelled by type, static, known in advance, or observed only in the past, because the attention-based models treat these types differently5.
4.3Model layer
Three families run side by side and compete per segment.
- Classical baselines: seasonal naive, exponential smoothing and seasonal ARIMA2, 1, plus a linear model of the kind shown to be a strong baseline for long horizons9.
- Global deep models: DeepAR for probabilistic forecasts shared across series3 and N-BEATS for point forecasts with an interpretable configuration4.
- Attention-based models: the Temporal Fusion Transformer where rich known-in-advance covariates exist5, and a patch-based model for long horizons8.
Series are grouped by volatility (rolling variance, promotion density, stock-out frequency), and each group uses the family with the lowest error under the protocol below; a simpler family wins ties.
4.4Reconciliation and calibration layer
Raw forecasts are post-processed in three steps. Negative values are clipped and known capacity limits are applied. Forecasts across the product and location hierarchy are reconciled so that store forecasts sum to the region forecast and product forecasts sum to the category forecast11. Quantiles are recalibrated per region against recent coverage, so that a stated 90 percent interval covers about 90 percent of outcomes in that region and not only on average across all regions.
4.5Serving and monitoring layer
The stack produces nightly batch forecasts and rolling intra-day updates for the high-volume set. Monitoring tracks error and interval coverage by region and volatility group, input pipeline freshness, and the share of series where a fallback model was served. A sustained drop in coverage in one region triggers retraining for that region.
5Components and evidence
Table 1 maps each design component to the problem it addresses and the published work it rests on.
| Component | Problem it addresses | Evidence |
|---|---|---|
| Global model trained across related series | Short or new series have too little history alone | 3, 4 |
| Probabilistic outputs and quantiles | Stock decisions depend on the distribution, not the mean | 3 |
| Typed covariates (static, known, observed) | Promotions and holidays are known in advance and must be used | 5 |
| Patch-based attention for long horizons | Long input windows are costly for point-wise attention | 8, 6 |
| Decomposition inside the model | Trend and seasonality obscure longer-range dependencies | 7 |
| Linear and classical baselines kept in every comparison | Attention models do not reliably beat simple models | 9, 1 |
| Hierarchical reconciliation | Forecasts at different levels do not add up | 11, 10 |
| Proper scoring of distributions | Point metrics cannot judge a quantile forecast | 12 |
| Scaled error alongside percentage error | Percentage errors break on zero or low volumes | 13, 2 |
Source: our design, with the works cited in the table.
6Evaluation protocol
Before any accuracy claim about this design could be made, it would need the following evaluation.
- Rolling-origin splits. Training and test windows advance through time, and test windows are chosen to include sales events, so that results are not driven by quiet periods only.
- Horizons. Separate scores at 7, 14, 30 and 60 days, because the ranking of model families can change with horizon.
- Point accuracy. Mean absolute error and root mean squared error in units, and mean absolute scaled error for comparisons across series of different scales13.
- Distribution accuracy. The continuous ranked probability score, a proper scoring rule that generalises absolute error to a full predictive distribution, plus interval coverage and quantile loss12.
- Event error. Error restricted to the most volatile tenth of periods, reported separately so that gains in quiet periods cannot hide losses in events.
- Breakdown. Every score by region and volatility group, and at each hierarchy level after reconciliation.
- Baselines. Seasonal naive, exponential smoothing, seasonal ARIMA and a linear model, all on the same splits9.
Percentage error is never used alone to choose a model; Table 2 shows why.
7A worked example: percentage error on low volumes
Table 2 takes one hypothetical product over three days, with one quiet day, one ordinary day and one event day, and compares absolute and percentage errors. All demand and forecast values are inputs chosen for illustration.
| Day | Actual (units, input) | Forecast (units, input) | Absolute error (units) | Absolute percentage error |
|---|---|---|---|---|
| Quiet day | 2 | 3 | 1 | 50% |
| Ordinary day | 4 | 5 | 1 | 25% |
| Event day | 50 | 45 | 5 | 10% |
| Mean | 2.33 | 28.3% |
Source: Worked model; inputs in the table.
The mean absolute percentage error is driven by the two low-volume days, each off by one unit, while the event day, with five units missing from stock, contributes least. A model tuned to this percentage would trade event-day error for quiet-day error, the opposite of what inventory planning needs. Had the quiet day sold zero units, the percentage error would be undefined; percentage errors are infinite or undefined when an actual value is zero and extreme when it is close to zero2. Many common accuracy measures degenerate in such cases, which is why scaled errors were proposed as the standard for comparing accuracy across series13.
8Illustrative scenarios
The scenarios below are hypothetical. They show how the layers would interact; they are not results.
A planned sales event. If a merchant planned a multi-day sales event, the event would enter as a known-in-advance input with its dates and discount depth. A model that uses known future inputs would have the information to raise the forecast before the event starts5, while a model that sees only past sales would react only after the spike began. The event error in the protocol is the measure that would show whether this happens.
Currency-linked prices. If a product were priced in local currency while its costs moved with another currency, frequent repricing would follow. With price as a covariate and quantile outputs, the forecast could widen its interval when prices change, and restocking could be set from an upper quantile instead of the mean3.
A sudden rise in interest. If a product with little history suddenly drew attention, the global model would have little to go on from that series alone but could draw on similar products through shared parameters. Recent views and add-to-cart events would be the earliest signal. Whether any model family detects the shift earlier than smoothing methods is for the event-error breakdown to show.
9Privacy and fairness
The forecasts run on aggregated series, not on individual shoppers' histories, and personal identifiers are excluded from the inputs.
Systematic under-forecasting in a smaller or more volatile region leads to less stock and longer delivery promises there. Reporting every score by region, and recalibrating quantiles per region, is meant to make such a bias visible rather than averaged away.
Planners see, alongside each forecast, the inputs that moved it most, the attention-based interpretation where the model provides one5, and the predictive interval, so that a forecast is read as a range with conditions, not a promise.
10Limitations
- No measurements. We have not run the evaluation protocol. We make no claim that any model family in the stack is more accurate than another on commerce data; every expected benefit is a hypothesis.
- Mixed evidence on attention. Published comparisons disagree on whether Transformer models help forecasting9, 8. Most were run on public benchmarks unlike retail demand, so their rankings may not transfer.
- Data and compute. Global deep and attention-based models need many series and more compute than classical models. Small merchants may have too few series for a model of their own and depend on transfer from shared models.
- Unprecedented shocks. Events with no precedent in the training data are not forecastable from history. Covariates help only for events that someone records.
- Censored demand. Stock-out flags correct for missing sales only as well as stock records are kept. Where they are wrong, the model learns supply limits as demand.
- Operational complexity. Three model families, per-segment selection and reconciliation add monitoring work that we have not costed.
- Long horizons. Uncertainty grows with horizon, and the intervals at 60 days and beyond may be too wide to support decisions in volatile categories.
11Conclusion
We have described a forecasting stack for volatile, multi-region commerce demand: typed event and price covariates, global probabilistic models, attention-based models where their inputs justify them, simple baselines that every model must beat, reconciliation across the hierarchy, and per-region calibration of intervals. Each part rests on published work, summarised in Table 1. What the design lacks is evidence of its own accuracy. The next step is to run the rolling-origin protocol on one region's data, with event error and interval coverage reported alongside point accuracy, and publish what is measured.
References
- 1
Box, G. E. P., Jenkins, G. M., Reinsel, G. C., & Ljung, G. M. (2015). Time series analysis: Forecasting and control (5th ed.). Wiley. www.wiley.com/en-us/Time+Series+Analysis%3A+Forecasting+and+Control%2C+5th+Edition-p-9781118675021
- 2
Hyndman, R. J., & Athanasopoulos, G. (2021). Forecasting: Principles and practice (3rd ed.). OTexts. otexts.com/fpp3/
- 3
Salinas, D., Flunkert, V., Gasthaus, J., & Januschowski, T. (2020). DeepAR: Probabilistic forecasting with autoregressive recurrent networks. International Journal of Forecasting, 36(3). doi.org/10.1016/j.ijforecast.2019.07.001
- 4
Oreshkin, B. N., Carpov, D., Chapados, N., & Bengio, Y. (2019). N-BEATS: Neural basis expansion analysis for interpretable time series forecasting. arXiv:1905.10437 (International Conference on Learning Representations 2020). arxiv.org/abs/1905.10437
- 5
Lim, B., Arık, S. Ö., Loeff, N., & Pfister, T. (2021). Temporal fusion transformers for interpretable multi-horizon time series forecasting. International Journal of Forecasting, 37(4). doi.org/10.1016/j.ijforecast.2021.03.012
- 6
Zhou, H., Zhang, S., Peng, J., Zhang, S., Li, J., Xiong, H., & Zhang, W. (2020). Informer: Beyond efficient transformer for long sequence time-series forecasting. arXiv:2012.07436 (AAAI Conference on Artificial Intelligence 2021). arxiv.org/abs/2012.07436
- 7
Wu, H., Xu, J., Wang, J., & Long, M. (2021). Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting. arXiv:2106.13008 (Advances in Neural Information Processing Systems 34). arxiv.org/abs/2106.13008
- 8
Nie, Y., Nguyen, N. H., Sinthong, P., & Kalagnanam, J. (2022). A time series is worth 64 words: Long-term forecasting with transformers. arXiv:2211.14730 (International Conference on Learning Representations 2023). arxiv.org/abs/2211.14730
- 9
Zeng, A., Chen, M., Zhang, L., & Xu, Q. (2022). Are transformers effective for time series forecasting?. arXiv:2205.13504 (AAAI Conference on Artificial Intelligence 2023). arxiv.org/abs/2205.13504
- 10
Makridakis, S., Spiliotis, E., & Assimakopoulos, V. (2022). M5 accuracy competition: Results, findings, and conclusions. International Journal of Forecasting, 38(4). doi.org/10.1016/j.ijforecast.2021.11.013
- 11
Wickramasuriya, S. L., Athanasopoulos, G., & Hyndman, R. J. (2019). Optimal forecast reconciliation for hierarchical and grouped time series through trace minimization. Journal of the American Statistical Association, 114(526). doi.org/10.1080/01621459.2018.1448825
- 12
Gneiting, T., & Raftery, A. E. (2007). Strictly proper scoring rules, prediction, and estimation. Journal of the American Statistical Association, 102(477). doi.org/10.1198/016214506000001437
- 13
Hyndman, R. J., & Koehler, A. B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting, 22(4). doi.org/10.1016/j.ijforecast.2006.03.001
Cite this paper
Tanqory Research (2025). Demand forecasting under high volatility: a design for multi-region commerce. Tanqory. https://tanqory.com/research/demand-forecasting-high-volatility