DeepChain: Multi-Agent RL Framework
- DeepChain is a multi-agent reinforcement learning framework for whole-chain recommendations that formulates user sessions as a single MDP with coordinated scenario-specific policies.
- It employs specialized actor networks with attention mechanisms and a global critic to learn recommendation strategies across heterogeneous interaction phases.
- The framework integrates a model-based component to mitigate data scarcity and imbalanced rewards, achieving superior performance on benchmark datasets.
DeepChain is a multi-agent reinforcement learning (RL) framework for whole-chain recommendations, designed to jointly optimize multiple recommendation strategies across consecutive user scenarios within a session. Departing from previous approaches that either apply a single policy to all scenarios or treat scenario-specific strategies independently, DeepChain models the entirety of a user’s session—spanning heterogeneous interaction phases such as entrance and item-detail pages—as a single Markov decision process (MDP) where specialized recommender agents (RAs) coordinate to maximize cumulative reward. It incorporates a model-based component to address sample complexity and imbalanced reward distributions common in large-scale recommender systems (Zhao et al., 2019).
1. Whole-Chain Recommendation as Multi-Agent RL
DeepChain formalizes the user session as an MDP , where:
- : At step , the state encodes the chronologically ordered item interaction history across all scenarios.
- : An action is a single item recommendation ().
- : Upon , the user response yields reward 0, with typical values: skip = 1, click or purchase = 2, leave = 3.
- 4: The transition kernel 5 captures both user feedback and scenario transitions (e.g., entrance page to item-detail page).
- 6: Discount factor in 7.
There are 8 scenario-specific RAs, 9, each uniquely responsible for a scenario. For a session trajectory 0 and joint policy 1, the objective is to maximize expected return:
2
At each 3, only the agent for the active scenario selects 4, with all agents sharing user-history memory.
2. State, Action, and Reward Specification
For illustrative purposes, consider two scenarios: entrance page (5) and item-detail page (6).
- State 7: A sequence of 8 item IDs, each with a pre-trained embedding 9 (e.g., via word2vec trained on click sequences), yielding 0.
- Action 1: Item recommendation, represented by its embedding 2.
- Immediate reward 3 depends on user action:
- Skip 4
- Click or purchase 5
- Leave 6
- Transition probabilities for each scenario 7: Click/go-to-detail 8, skip/stay 9, leave 0.
3. Joint Multi-Agent Policy Learning Objective
The goal is to learn scenario-specific policies 1 so as to maximize the session's cumulative discounted return,
2
A global action-value function 3 (the Critic) is used, and the designated actor at step 4 applies 5, with 6.
4. DeepChain Architecture
Agents, Critic, and Model-Based Component
The architecture comprises the following:
- Shared Memory: All agents operate on a common user-history state, 7.
- Actor Networks for each Scenario (8):
- Preference Encoder: A GRU processes the sequence 9, outputting hidden vectors 0. An attention mechanism computes per-item weights:
1
yielding the user preference embedding 2. - Recommendation Decoder: For candidate item 3 with embedding 4, score is
5
and the top-scoring item is recommended.
- Global Critic 6: GRU+attention encoder (two heads, one per scenario) produces context representations concatenated with the action embedding, followed by MLP layers to estimate 7.
- Model-Based Probability Network (8): Learns to predict next-scenario transitions (9, 0, 1 for each 2) using two softmax heads given 3, facilitating model-based target computation and reducing reliance on rare real user signals.
5. Training Methodology
DeepChain follows an off-policy actor–critic paradigm similar to DDPG, with four trainable neural nets: actors 4, critic 5, probability network 6, and their soft-updated targets 7. A replay buffer 8 stores experience tuples.
The model-based multi-scenario Bellman backup is given by (for mini-batch update on scenario 9):
- If 0:
1
- If 2:
3
Loss functions:
- Critic: Mean squared error loss,
4
- Actor: Deterministic policy gradient,
5
- Probability Net: Cross-entropy loss on next-scenario labels.
Target networks are updated via soft updates with 6 (e.g., 7).
6. Addressing Data Scarcity and Imbalanced Rewards
To overcome the data demands and highly skewed reward distribution (dominance of skip/zero-reward events), DeepChain leverages:
- Model-Based Rollouts: The probability network 8 enables generation of imagined transitions, mitigating the scarcity of positive signals.
- Multi-Scenario Bellman Backup: Model-based targets aggregate over possible user behaviors and scenario transitions, smoothing sparse rewards.
- Replay Buffer and Target Networks: These mechanisms stabilize learning and further reduce the reliance on infrequent reward events during policy updates.
7. Empirical Evaluation and Comparative Analysis
Experiments were conducted on a JD.com dataset with 500K user sessions (19.7M interactions, train/validation/test split at 80/20). Key configuration details:
- User-history length 9
- Embedding dimension 0, GRU hidden units 1, discount 2, target soft update 3
- Reward assignments: skip = 0; click = +1; leave = –2
Offline evaluation utilized MAP and NDCG@40 as metrics, with DeepChain compared against W4D (Wide & Deep), DeepFM, GRU4Rec, DDPG (single-agent), and MA (model-free multi-agent) baselines. DeepChain achieved 4–19% higher scores than the strongest baselines (e.g., entrance page MAP: DeepChain 5 vs. MA 6 vs. DDPG 7).
Ablation studies confirmed that using separate actors per scenario and the model-based component accelerated learning and improved convergence relative to single-agent or model-free variants. Performance sensitivity analysis showed session length/history length (8 up to 50) notably improved entrance page recommendations, reflecting the impact of historical diversity on scenario-specific policy efficacy.
For further architectural and algorithmic details, see (Zhao et al., 2019).