Bayesian Model-Based Offline Reinforcement Learning for Product Allocation

Porter Jenkins, Hua Wei, J. Stockton Jenkins, Zhenhui Li

Product allocation—the strategic placement of items within a store to maximize revenue—is a foundational challenge in retail. While traditionally addressed through heuristic search or mathematical programming, Reinforcement Learning (RL) offers a dynamic alternative. However, applying RL to physical retail environments faces two significant hurdles: the Sim2Real Gap, where simulators fail to capture complex human shopping behaviors, and the Cost of Exploration, as real-world experimentation with physical inventory is prohibitively expensive.

Presented at AAAI-22, this research introduces PPOPO (Posterior Penalized Offline Policy Optimization), a Bayesian model-based offline RL framework designed to learn effective strategies from historical logs while navigating the pitfalls of out-of-distribution data.

The PPOPO Framework

The authors propose a two-step approach that combines economic domain knowledge with robust uncertainty quantification.

1. The Bayesian World Model

Rather than relying on a black-box neural network, PPOPO utilizes a probabilistic model of spatial demand. This model incorporates several key features to handle the sparsity and complexity of retail data:

  • Hierarchical Priors: Parameters are shared across regions and products to improve learning in data-scarce scenarios.
  • Spatial Covariance: A Graph Laplacian prior, based on the physical layout of the store, is used to acknowledge that adjacent regions likely share similar traffic patterns.
  • Product Substitution: The model incorporates a covariance matrix derived from external datasets (e.g., Amazon reviews) to account for consumer substitution effects—where a customer might buy a similar product if their first choice is unavailable.
Graphical representation of the Bayesian world model showing the hierarchical relationships between product weights, region weights, quantity, and revenue.

2. Posterior Penalized Policy Optimization

To train the policy, PPOPO performs "offline exploration" within the Bayesian world model. To prevent the agent from over-optimizing on regions where the model has little data, the authors implement a penalized reward function:

$$\tilde{r} = p(\hat{r}) - \lambda \sigma_{p(\hat{r})}$$

In this equation, the reward is the mean predicted revenue minus a penalty based on the standard deviation ($\sigma$) of the posterior predictive distribution. This "pessimism under uncertainty" forces the agent to stay within the safe, known distribution of historical data, avoiding unrealistic actions.

Experimental Evaluation

The framework was evaluated using real-world transaction data from Swire Coca-Cola, covering two supermarkets over a two-year period.

Predictive Accuracy

The Bayesian world model demonstrated superior performance in predicting demand compared to standard machine learning baselines like Random Forest (RF) and Gradient Boosted Regression Trees (GBRT).

Table comparing the predictive accuracy (MAE and MAPE) of the Bayesian World Model against standard baselines across two store locations.

As shown in the results, the Bayesian world model achieved a significant reduction in error. Specifically, in "Store 2," it reached a 36% reduction in Mean Absolute Error (MAE) compared to the next best model.

Policy Performance

In simulated planning horizons, PPOPO consistently outperformed Off-policy DQN and Batch Constrained Q-learning (BCQ). As the planning horizon increased to 90 days, PPOPO’s relative improvement grew, reaching over 40% improvement in cumulative reward in some scenarios. Furthermore, using Per-State Rejection Sampling (PSRS) as a real-world proxy, PPOPO achieved a score of 5.71, while standard Off-policy DQN failed to produce any proposals accepted by the sampler.

Conclusion

PPOPO demonstrates that incorporating Bayesian uncertainty and economic priors can bridge the gap between offline data and real-world deployment in discrete environments like retail. While the computational overhead of MCMC sampling remains a challenge, the framework provides a mathematically grounded path toward safe, effective automated product allocation.

Summary updated

BibTeX
@inproceedings{jenkins2022bayesian,
  author = {Porter Jenkins and Hua Wei and J. Stockton Jenkins and Zhenhui Li},
  title = {{Bayesian Model-Based Offline Reinforcement Learning for Product Allocation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i11.21523},
}
Figure