Toward Simulating Environments in Reinforcement Learning Based Recommendations

Xiangyu Zhao, Long Xia, Zhuoye Ding, Dawei Yin, Jiliang TangarXiv 2019

Introduction

Training reinforcement learning (RL) agents for recommendation systems usually requires risky and expensive online A/B testing. This paper introduces RecSimu, a GAN-based user simulator that mimics complex user behavior and generates realistic synthetic interaction logs. By using these "augmented" logs, researchers can pre-train and evaluate RL recommendation policies in a safe, offline environment before going live.

The Challenge of Online RL

Reinforcement Learning is a natural fit for recommender systems because it treats recommendation as a sequential interaction aimed at maximizing long-term rewards (like total revenue). However, RL agents are "data-hungry" and typically require real-time feedback to learn.

In the real world, getting this feedback via online A/B testing has three major flaws:

  1. Efficiency: It takes weeks to collect statistically significant data.
  2. Cost: Engineering deployment is expensive.
  3. User Experience: An untrained RL agent might show irrelevant items, frustrating real users.
The RecSimu framework replaces or augments real user interactions with a simulator to safely train RL agents.

Building a simulator is the obvious solution, but it's technically difficult. Recommender systems deal with millions of items (complex distributions), and individual users often have very sparse historical data, making it hard to model their unique preferences accurately.

The RecSimu Framework

The authors propose RecSimu, a framework based on Generative Adversarial Networks (GANs). The system is split into two main parts that "compete" to improve the simulation:

The RecSimu architecture consists of a Generator (mimicking the system) and a Discriminator (mimicking the user).
  • The Generator (The "System" Mimic): Uses an Encoder-Decoder architecture. An RNN (specifically a GRU) encodes a user’s browsing history and feedback into a preference vector. The decoder then predicts the next item the user is likely to see. Crucially, it includes a supervised component that forces the generated items to be close to actual historical items (using $L_2$ distance).
  • The Discriminator (The "User" Mimic): This is the "brain" of the simulator. It doesn't just distinguish between real and fake logs; it also predicts the user's feedback (e.g., click vs. skip). It outputs a $2 \times K$ dimensional vector representing $K$ classes of feedback for both real and generated items.
  • The Training Loop: The generator tries to produce item sequences so realistic they "fool" the discriminator, while the discriminator learns to better predict how a user would react to those items. This adversarial process acts as a form of data augmentation, effectively expanding the limited historical logs available for each user.

Evaluation and Results

The researchers evaluated RecSimu using a real-world dataset from a large e-commerce company (July 2018), consisting of 272,250 recommendation sessions and over 1.3 million unique items.

Key Results

RecSimu was compared against several baselines, including standard GRUs and supervised GAN variants (GAN-s):

  • Behavior Prediction: RecSimu outperformed all baselines in predicting user feedback, achieving the highest F1-score (~0.23) and AUC (~0.68).
  • Generator Quality: To see if the generator actually mimicked a real system, they tested it against representative recommendation algorithms (FM, W&D, GRU4Rec). RecSimu’s generated logs were the closest to the actual historical "Logs" in terms of MAP (Mean Average Precision) and NDCG, trailing the real data by only about 5%.
  • Sensitivity: The model's performance improves as the history length ($N$) increases, but plateaus around $N=15$ to $20$, suggesting a "sweet spot" for context window size.

Discussion and Insights

  • GANs as Data Augmenters: The core innovation is using the GAN to solve the data sparsity problem. By generating realistic "fake" logs, the model creates a denser training space for the RL agent to explore.
  • The Multi-Task Discriminator: Unlike a standard GAN discriminator that only outputs "real or fake," this discriminator performs fine-grained classification. By forcing it to predict specific user behaviors (clicks/skips) on both real and fake items, the authors significantly increased the "power" of the discriminator and the quality of the generator.
  • Temporal Dynamics: Ablation studies showed that capturing the order of user interactions (via GRUs) is vital for a realistic simulation, as non-sequential models like Logistic Regression performed significantly worse.

Limitations and Future Work

While promising, RecSimu has areas for improvement. Currently, the model treats state-action pairs as somewhat independent, whereas real user reactions often depend on the immediate sequence of items. Additionally, the inherent feedback imbalance (many more skips than clicks) remains a challenge for predicting positive interactions. Future work may incorporate "explainable recommendation" techniques to better understand the underlying reasons for user feedback.

Summary updated

BibTeX
@misc{zhao2019toward,
  author = {Xiangyu Zhao and Long Xia and Zhuoye Ding and Dawei Yin and Jiliang Tang},
  title = {{Toward Simulating Environments in Reinforcement Learning Based Recommendations}},
  year = {2019},
  eprint = {1906.11462},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.11462},
}
Figure