Researchers at Spotify (KDD ’23) have introduced a scalable reinforcement learning (RL) framework designed to generate personalized music playlists. By moving away from rigid assumptions regarding content quality and instead optimizing directly for user satisfaction through simulation, the framework bridges the gap between offline model performance and online user behavior.
The Challenge of Sequential Recommendation
Traditional recommendation systems, such as collaborative filtering, often suffer from a "target-to-metric disconnect." While they may excel at predicting a high rating for a single item, they struggle with the sequential nature of music consumption. A playlist of 30 high-rated songs might result in a jarring mix of genres, leading to poor user satisfaction.
Furthermore, applying RL to playlists presents a massive combinatorial challenge. Selecting 30 tracks from a pool of even 1,000 candidates results in approximately $10^{89}$ possible combinations. Standard RL "slate" methods often assume a user interacts with only one item, but music listeners consume playlists over time, requiring models to optimize for long-term session satisfaction rather than immediate clicks.
The Simulation-based RL Framework
The proposed solution formulates playlist generation as a Markov Decision Process (MDP) using a model-based RL approach. This involves two primary components:
- The World Model (Simulator): To avoid the risks of training on live users, the researchers developed a simulator to predict user responses (e.g., skips, completions, or listening duration). They evaluated a Sequential World Model (SWM) using LSTMs to capture track order and a simpler Non-sequential World Model (CWM).
- Action Head DQN (AH-DQN): Standard Deep Q-Networks (DQNs) utilize a fixed output layer where each neuron represents a specific item. This is impractical for catalogs with millions of tracks. The AH-DQN architecture instead takes both the user state and track features as inputs.
By treating track features as inputs, the model becomes "item-agnostic." This allows the agent to calculate a Q-value (expected reward) for any track with available features, even those not encountered during training. To maintain tractability, the task of generating a full playlist is decomposed into a sequence of "pick the next best track" actions, with the state updating after each choice based on simulator feedback.
Experimental Validation
The framework was validated using three distinct datasets:
- Spotify Music Streaming Sessions Dataset: A public dataset of 160 million sessions used to demonstrate the agent's ability to outperform random and greedy baselines.
- Proprietary Spotify Data: Internal streaming data used to train production-grade world models and agents.
- Online A/B Test: A live deployment involving 2 million users and 4 million sessions to compare the agent against existing production systems.
Key Results and Insights
One of the most significant findings was the high correlation between the simulator’s offline predictions and actual online A/B test results. This validation suggests that researchers can iterate rapidly offline with high confidence that performance gains will translate to the real world.
In live A/B tests, the AH-DQN agent significantly outperformed the control group, achieving a 10.17% increase in Completion-Count (the number of tracks a user finishes). The results also highlighted that track order and context—captured by the Sequential World Model—are critical; simply providing "good" songs is insufficient for maintaining user engagement throughout a session.
Conclusion and Future Work
The AH-DQN framework demonstrates that simulation-based RL can effectively manage the scale and complexity of industrial recommendation systems. While successful, future research may explore more complex user modeling architectures, such as Transformers, to capture longer-range dependencies. Additionally, integrating sophisticated exploration strategies could further enhance music discovery without compromising short-term user satisfaction.
Summary updated