Source-linked AI summary
Applying Deep Learning to the Newsvendor Problem
Afshin Oroojlooyjadid, Lawrence Snyder, Martin Takáč
TL;DR
The paper addresses inventory decisions when demand distributions are difficult to specify and demand features are available. It uses deep learning to optimize order quantities directly from those features, reporting advantages over existing approaches in settings including volatile demand.
Problem
The paper addresses multi-feature inventory decisions while avoiding reliance on accurately specified demand distributions, whose approximation can be error-prone.
Method
The proposed approach uses deep neural networks to solve the newsvendor problem from demand features rather than separating forecasting from inventory optimization.
Results
The approach is reported to be effective with small historical datasets, unknown or unfitted demand distributions, and volatile data, where current approaches fail.
Takeaways & Limitations
The method extends feature-based deep-learning inventory optimization beyond the basic newsvendor setting to (r, Q) policies.
Takeaways & Limitations
The considered multi-product setting excludes demand substitution, correlation, and complementarity effects.
Abstract
from arXiv · showhide
The newsvendor problem is one of the most basic and widely applied inventory models. There are numerous extensions of this problem. If the probability distribution of the demand is known, the problem can be solved analytically. However, approximating the probability distribution is not easy and is prone to error; therefore, the resulting solution to the newsvendor problem may be not optimal. To address this issue, we propose an algorithm based on deep learning that optimizes the order quantities for all products based on features of the demand data. Our algorithm integrates the forecasting and inventory-optimization steps, rather than solving them separately, as is typically done, and does not require knowledge of the probability distributions of the demand. Numerical experiments on real-world data suggest that our algorithm outperforms other approaches, including data-driven and machine learning approaches, especially for demands with high volatility. Finally, in order to show how this approach can be used for other inventory optimization problems, we provide an extension for (r,Q) policies.
1 Introduction
The introduction frames the multi-feature newsvendor problem as choosing order quantities for multiple products using demand-related features. It motivates a deep-learning approach that directly addresses inventory decisions without requiring a specified demand distribution.
- The newsvendor problem: The newsvendor chooses an order quantity for perishable goods by balancing expected shortage and holding costs.Unsold goods are discarded at period end, while stockouts incur shortage costs and lost potential profit.
- The newsvendor problem: With a known demand distribution, the classical problem has an analytical solution based on the distribution’s α-quantile.Here, α = c_p/(c_p + c_h), where c_p and c_h are per-unit shortage and holding costs.
- Multi-feature newsvendor: Real applications require multi-product decisions and often provide features such as weather, calendar information, and store location.The paper calls the resulting setting the multi-feature newsvendor problem: choosing today’s base-stock level from today’s features.
- Proposed approach: The paper proposes solving the multi-feature newsvendor problem with deep neural networks.The introduction presents this as an approach for using demand features in the inventory decision.
- Extensions: The paper also studies an extension of the approach for (r, Q) inventory policies.This extension is presented as a further application to another inventory optimization problem.
2 Literature Review
Prior approaches forecast demand or estimate its distribution before optimizing inventory, creating limitations when distributions are misspecified, features are unused, or demand is volatile. The paper proposes a feature-based deep-learning approach that directly optimizes newsvendor quantities and extends beyond quantile-based problems.
- Existing approaches: Existing methods include forecast-as-solution, separated estimation and optimization, empirical quantiles, and related forecasting models.Forecast-based methods first predict demand; SEO estimates distributional parameters before optimization; EQ estimates a demand quantile directly.
- Existing approaches: SEO requires a specified demand-distribution form and compounds data-estimation error with model-optimality error.The approach can be provably suboptimal in some realistic settings.
- Existing approaches: EQ avoids distributional assumptions but does not use features, cannot naturally handle continuous features, and performs worse when training demand is volatile.Clustering extensions also prevent information sharing across clusters.
- Scope: The approach can be applied to other inventory problems with closed-form cost functions, including optimization of (r,Q) policy parameters.The paper presents this extension for a problem without a quantile-type solution.
- Proposed approach: The proposed method uses DNNs to relate features to optimal order quantities rather than first estimating demand distributions.Its revised loss functions target the newsvendor cost directly.
- Reported scope: The authors report effectiveness with small datasets, unknown or unfitted distributions, and volatile historical data, where current approaches fail.With sufficient historical data, the approach can solve known-distribution problems as accurately as the classical solution.
3 Deep Learning Algorithm for Newsvendor with Data Features
The algorithm replaces separate demand forecasting and inventory optimization with a DNN trained using losses tied to newsvendor cost. It uses historical demand and feature data to produce product order quantities directly.
- Problem formulation: The model uses n historical demand observations for m products, with p features recorded for each observation.The data are represented as feature vectors associated with product-demand observations.
- Motivation: Standard demand forecasts estimate the first distributional moment but are not necessarily optimal order quantities.A separate optimization step is therefore required in the SEO approach.
- Loss functions: The proposed DNN minimizes the newsvendor cost function instead of simply predicting demand.The paper also introduces a revised Euclidean loss as an alternative training objective.
Appendix A.
The appendix describes network-architecture selection and HyperBand-based training for the proposed DNN models. Randomly generated fully connected networks are progressively screened using test-set results.
- Model variants: The two model variants use the proposed linear and quadratic losses with their corresponding gradient procedures.They are designated DNN-ℓ1 and DNN-ℓ2.
- Network selection: The procedure generates 100 fully connected networks with randomly selected two- or three-hidden-layer structures.Hidden-layer widths are sampled from ranges determined by preceding-layer widths and the number of features.
- HyperBand training: HyperBand trains each candidate for one epoch, removes the worst 10%, and repeats this screening on the remaining networks.The process continues until the final best networks are obtained.
4 Numerical Experiments
The experiments compare deep-learning newsvendor models with empirical, statistical, nearest-neighbor, random-forest, and other approaches on small, real-world, and simulated data. Results generally favor DNN, especially on noisy data and with limited historical records, while performance differences narrow as data become plentiful.
- Real-world dataset: DNN-ℓ1 and DNN-ℓ2 outperform the other three algorithms on the real-world dataset.Their cost ratios remain comparatively stable as cp/ch changes, unlike the other approaches.
- Randomly generated data: As clusters increase and training samples per cluster decrease, method performance diverges, with DNN-ℓ1 remaining competitive across distributions.SEO performs well for normal demands but less well otherwise, while LML and RF are nearly always worse than the other methods.
- Randomly generated data: DNN-ℓ1, SEO, EQ, KR, and KNN perform best and have roughly equal performance across the randomly generated instances.Performance is more similar when data are non-noisy, while DNN-ℓ1 is statistically better than all other methods in some cases.
- Optimality comparison: The naive approach can produce errors ranging from 5.6% to 677.9% across simulated demand distributions and cluster counts.In nearly every instance, no method is statistically equal to the optimal solution; the exception is DNN-ℓ1 for normal demands with 100 clusters.
- Recommendations: DNN is recommended for noisy datasets and tends to outperform other methods when non-noisy data provide fewer than 10 records per feature combination.With at least 10,000 non-noisy records per combination, algorithms perform roughly equally well, making EQ or SEO attractive because they require no hyperparameter tuning.
5 Extension to (r, Q) Policy
The paper extends its deep-learning approach to jointly optimize (r, Q) inventory policies without requiring a known demand distribution. Across basket and randomly generated data, DNN performs especially well when demand data are noisy, sparse, or distributionally misspecified.
- Model and algorithm: The extension uses a DNN with two outputs, r and Q, and trains it directly on the expected-inventory-level cost function.Negative outputs are handled with positive-part terms and penalties.
- Model and algorithm: The EIL benchmark requires a demand-distribution assumption, whereas DNN uses historical data to learn policy parameters.For the experiments, EIL fits a normal distribution to each cluster.
- Basket-data results: 117,538 versus 121,772 cost: DNN is 3.5% better than EIL on the noisy basket dataset.The basket data contain only 1–9 historical observations per cluster, and EIL’s normality assumption is inaccurate.
- Random-data results: On randomly generated data, DNN is close to EIL for normal demand and achieves a near-0% gap for beta demand.For other distributions, DNN provides a better solution than EIL, with an average cost ratio of 0.83.
- Overall comparison: When the true distribution is known, DNN and EIL work almost equally well; when it is unknown, DNN remains effective with small or noisy historical datasets.The reported comparison covers instances with varying numbers of clusters and historical observations.
6 Conclusion
The conclusion presents deep learning as an integrated alternative for feature-based newsvendor optimization when demand distributions are difficult to estimate. Results indicate that DNN is particularly effective for noisy or volatile data and can extend beyond quantile-solvable inventory problems.
- Approximating the demand distribution can produce errors, especially when historical data are scant or volatile, making the resulting newsvendor solution potentially nonoptimal.
- The proposed DNN algorithm uses historical data without requiring the demand probability distribution and integrates parameter estimation with inventory optimization.
- Deep learning works well when demand volatility is high, while several approaches perform roughly equivalently when the distribution is well-defined and training data are sufficient.
- The approach is extended to (r, Q) optimization and is presented as applicable to settings that cannot be solved by estimating a quantile.
- Computational results show that DNN performs well with noisy or sparse data and often outperforms an exact algorithm when the true demand distribution is unknown.The exact algorithm must assume a distribution in that setting.
- The authors suggest extending the idea to other supply-chain problems, including difficult multi-echelon inventory optimization problems.Applying other machine-learning algorithms to the newsvendor problem is identified as another future direction.
A Proofs of Propositions 1 and 2
The appendix proves gradient formulas for the proposed deep-learning loss functions. It handles excess-inventory and shortage cases and propagates the resulting gradients through all network layers.
- The proofs derive gradients beginning at the final network layer and recursively extending them to earlier layers.
- The gradient derivation separately considers excess-inventory and shortage cases in the final layer.
- The resulting expressions give the gradient with respect to arbitrary network weights by combining the layerwise relationships.
- Proposition 2 applies the same proof strategy to the revised Euclidean loss function and obtains its weight gradients.
B Grid Search for Basket Dataset
The appendix tunes the DNN-ℓ2 model through grid search over learning-rate and regularization parameters, selecting the best configuration for Figure 3 experiments.
- The tuning procedure searches over learning rate, regularization coefficient λ, and decay parameter γ.These parameters determine the learning-rate schedule and regularization strength.
- The selected parameters are γ = 0.00005, λ = 0.00005, and lr = 0.000009.
- The selected parameters were used to test integer values of cp/ch ∈{3, . . . , 9} for the DNN-ℓ2-T series in Figure 3.
C A Tuning-Free Neural Network to Solve the Newsvendor Problem
The paper proposes a fixed network structure based on feature characteristics to avoid extensive hyperparameter tuning. Experiments indicate near-optimal performance when sufficient historical data are available, while sparse data require additional tuning or training.
- Motivation and approach: The proposed approach provides a cheaper way to set network structure than extensive random search or Bayesian optimization.It is intended for users lacking the time, resources, or expertise for complex tuning procedures.
- Network design: The network size is linked to the number of features, their value ranges, and the number of training samples.Small feature spaces can use smaller networks, whereas broad feature spaces require larger networks to distinguish cases.
- Network design: The default architecture has size [q, 1.5q, q, 0.5q, 1], with q combining continuous features and categorical combinations.The output layer contains a single node, and the default hidden-layer coefficients are a = 1.5, b = 1, and c = 0.5.
- Limitations and training: The method can overfit when the network has many variables relative to the available training data.The authors recommend reducing coefficients a, b, and c when the network is too large.
- Experimental results: With the fixed structure, costs were near-optimal for all tested demand distributions except normally distributed demand within at most 10 epochs.Normally distributed demand required at least 50 epochs for convergence, while the reported average training time was 10 minutes.
- Experimental results: After 100 epochs, average gaps versus HyperBand were 0.67%, 1.9%, 43.5%, and 65.3% for 1, 10, 100, and 200 clusters, respectively.After 300 epochs, the corresponding gaps were 0.5%, 0.08%, 3.29%, and 62.6%, showing that longer training can reduce gaps.
- Conclusion: The fixed network provides near-optimal results when historical records are sufficiently numerous, whereas insufficient data require additional tuning or training.In the experiments, fewer clusters corresponded to having more historical data.