NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ROLeR: Effective Reward Shaping in Offline Reinforcement Learning for Recommender Systems

Yi Zhang, Ruihong Qiu, Jiajun Liu, Sen Wang

Introduction

Reinforcement Learning (RL) has emerged as a powerful paradigm for recommender systems (RS) because it prioritizes long-term user engagement over immediate, short-sighted metrics like click-through rates. However, deploying RL agents in real-world environments is fraught with risk; interacting with live users to explore new policies is both expensive and potentially damaging to the user experience. This necessitates Offline RL, where agents are trained using logged historical interaction data.

The most common approach in this domain is "model-based" offline RL. In this setup, researchers learn a "world model"—essentially a simulator of user behavior—from historical logs. The RL agent then learns its policy by interacting with this simulator. However, these simulators often suffer from a significant "reward gap." Because offline data is frequently sparse and biased toward popular items (the Matthew Effect), reward models struggle to accurately predict user reactions to novel or niche items. Furthermore, existing methods for quantifying uncertainty to prevent over-optimistic behavior typically rely on computationally expensive model ensembles, which remain limited by the biases of the underlying training data.

The ROLeR Framework

To address these challenges, we introduce ROLeR (Reward Shaping in Offline Learning for Recommender Systems). ROLeR improves the fidelity of the simulated environment through three primary innovations:

1. Non-parametric Reward Shaping

Rather than relying exclusively on a parametric neural network (such as DeepFM) to predict rewards, ROLeR incorporates a "soft-label k-nearest neighbors" (kNN) strategy. By identifying a user's nearest neighbors in the training data based on interaction history and embeddings, the system refines its reward predictions using the actual feedback those similar users provided for specific items. This collaborative approach leverages the foundational RS principle that similar users exhibit similar preferences, effectively filling the gaps left by sparse data.

2. Distance-based Uncertainty Penalty

Traditional offline RL methods use ensembles of models to estimate uncertainty, which is both resource-intensive and often inaccurate in high-dimensional recommendation spaces. ROLeR replaces this with a distance-based penalty. It uses the distance between a user and their nearest neighbors in the feature space as a proxy for risk. If a user's state is far from any known clusters in the training data, the system applies a penalty to the predicted reward, encouraging the agent to remain within "safe," well-supported regions of the state space.

3. Attention-based State Tracking

Accurately modeling the evolution of user interest is critical for long-term optimization. ROLeR utilizes an attention mechanism (inspired by architectures like SASRec) to encode the sequence of user interactions into a state representation. This approach captures temporal dependencies more effectively than the simple averaging methods used in previous state-of-the-art models like DORL.

Experimental Evaluation

ROLeR was evaluated across four diverse recommendation benchmarks:

  • KuaiRec: A large-scale short-video dataset featuring a nearly complete user-item interaction matrix.
  • KuaiRand-Pure: A short-video dataset containing randomly inserted items to provide an unbiased evaluation of recommendation policies.
  • Coat & Yahoo: Two classic, smaller-scale datasets for shopping and music recommendations, respectively, used to test the model's debiasing capabilities.

Key Results and Insights

State-of-the-Art Performance

ROLeR achieved significant performance gains in Cumulative Reward (total satisfaction over a session) across all datasets. On the KuaiRec benchmark, ROLeR reached a cumulative reward of 33.25, a substantial improvement over the previous state-of-the-art, DORL, which achieved 20.49.

Improved User Retention

The model demonstrated a superior ability to maintain user engagement. In the KuaiRec and KuaiRand environments, ROLeR reached the maximum interaction length (30 steps) much earlier in the training process than baseline models. This suggests that the reward shaping and uncertainty penalties successfully prevent the agent from making "risky" recommendations that lead to early session termination.

Computational Efficiency

Despite the inclusion of a kNN component, ROLeR remains highly efficient. The framework requires less than two GPU hours per trial on an NVIDIA A6000, making it a practical solution for large-scale recommendation tasks where model ensembles would be prohibitively expensive.

Conclusion and Future Work

ROLeR demonstrates that the bottleneck in offline RL for recommendations is often the accuracy of the reward model within the simulator. By combining parametric neural networks with non-parametric user similarity priors, ROLeR effectively bridges the reward gap.

While the model is robust, it currently requires manual tuning of the hyperparameter $k$ (the number of neighbors). Future research will focus on automating the selection of distance metrics and uncertainty designs based on the specific density and scale of the underlying dataset. Additionally, the finding that high-quality item embeddings are difficult to learn from sparse offline data suggests a need for improved representation learning techniques within the world model framework.

Summary updated

BibTeX
@inproceedings{zhang2024roler,
  author = {Yi Zhang and Ruihong Qiu and Jiajun Liu and Sen Wang},
  title = {{ROLeR: Effective Reward Shaping in Offline Reinforcement Learning for Recommender Systems}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2024},
  url = {https://openreview.net/forum?id=uhMy7YazyT},
}
Figure