Sequential Search with Off-Policy Reinforcement Learning

Dadong Miao, Yanan Wang, Guoyu Tang, Lin Liu, Sulong Xu, Bo Long, Yun Xiao, Lingfei Wu, Yunjiang Jiang

TL;DR

This paper formally introduces Sequential Search (SS), a learning task that models user behavior across multiple search sessions by accounting for both historical queries and item interactions. The authors propose a hybrid RNN-Attention architecture optimized via a novel reinforcement learning framework (S3DDPG) that significantly improves long-term conversion metrics in large-scale e-commerce environments.

What Problem Does This Paper Address?

While "Sequential Recommendation" (SR) is a mature field, Sequential Search has remained relatively unexplored. In search, the challenge is twofold:

  1. Discontinuity: Changing search queries break the continuous flow of the result stream, making it harder to track latent user interests compared to a recommendation feed.
  2. Personalization vs. Relevance: Search engines must balance a user’s long-term preferences with the immediate semantic relevance of a specific query.

Most existing search models are "myopic"—they focus only on the current session. The authors argue that by treating search as a sequential process over weeks or months, a system can better understand a user’s "shopping theme" and optimize for long-term rewards (like eventual purchases) rather than just immediate clicks.

Methods

The authors implement a three-tiered approach to capture user behavior:

  • DIN-S (Search Ranking Deep Interest Network): An adaptation of the popular DIN model. It uses an attention mechanism to weigh long-term historical items (up to 1 year) against the current query. A key addition is the "zero attention unit," which allows the model to ignore history if the current search intent is entirely unrelated to past actions.
  • RNN Backbone: For near-term interactions (past 30 days), the authors use a Gated Recurrent Unit (GRU). RNNs were chosen over pure attention here because they are more efficient for incremental online updates—the hidden state can be updated forward-only as new events occur.
  • S3DDPG (Sequential Session Search Deep Deterministic Policy Gradient): This is the "brain" of the system. It uses an Actor-Critic reinforcement learning framework:
  • Actor: Predicts the ranking score for items.
  • Critic (Q-Network): Estimates the "maximal cumulative discounted long-term reward." Instead of just predicting if a user will buy an item now, it predicts the value of the current action for the user's entire future trajectory.
  • Greedy Knapsack Packing: To solve the computational inefficiency of training RNNs on variable-length user sequences (which often requires wasteful padding), the authors developed an algorithm to pack multiple short sequences into a single training batch. This resulted in a 20x reduction in compute and a 3x speedup in training time.

Datasets

The model was trained and evaluated using massive, real-world datasets from JD.com:

  • In-house Search Logs: 30 days of data comprising ~3.78 million unique users and ~6 million sessions.
  • Features: Includes 110 features per (query, item) pair, such as item IDs, categories, shop IDs, brand IDs, and user profile information.
  • Evaluation: Models were tested on a hold-out set of one day's data following the 30-day training window.

Key Insights and Ideas

  • Search as a Trajectory: The core "aha" moment is treating the search engine as an agent in a partially observable environment (the user). By using RL, the model learns that a specific ranking choice now might influence a user's behavior several sessions later.
  • The "Weakened" Bellman Equation: In standard RL, the action space is often small. In ranking, the action space is the set of all possible permutations of items (combinatorially explosive). The authors simplify this by dropping the "supremum" operator in the Bellman equation, making it feasible to train on continuous action spaces represented by RNN embeddings.
  • Efficiency Matters: The transition from offline research to online serving is often blocked by latency. By using an RNN for short-term state and a knapsack packing strategy for training, the authors demonstrate that complex sequential models can be deployed at a "billion-example scale."

Key Results

The authors conducted both offline evaluations and live online A/B tests:

  • Offline: The S3DDPG model outperformed standard DNN and RNN baselines, showing a 1% gain in Session AUC and NDCG over the DIN-S baseline.
  • Online A/B Tests: In a two-week live trial, S3DDPG showed substantial improvements in core business metrics over the RNN baseline:
  • +1.91% GMV/user (Gross Merchandise Value)
    • +0.78% CVR (Conversion Rate)
    • +1.94% RPM (Revenue Per Mille)
  • User Segments: The model was particularly effective for "seasoned users" (those with 5+ past sessions), where the gain in Session AUC was nearly 1%.

Limitations and Future Work

  • Static Environment: The authors acknowledge that their offline RL training assumes a static environment (no simulator). While this reduces complexity, it may not capture the full dynamics of user exploration.
  • Exploration: The current model does not explicitly introduce exploration strategies (like epsilon-greedy) in the online setting due to the high cost of "bad" search results in e-commerce.
  • Future Directions: The authors suggest exploring more sophisticated ways to handle the "Category New User" problem, where a user searches for a completely new type of product, rendering their historical data less useful.

Summary updated

BibTeX
@inproceedings{miao2021sequential,
  author = {Dadong Miao and Yanan Wang and Guoyu Tang and Lin Liu and Sulong Xu and Bo Long and Yun Xiao and Lingfei Wu and Yunjiang Jiang},
  title = {{Sequential Search with Off-Policy Reinforcement Learning}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2021},
  url = {https://openreview.net/forum?id=-atUm5b2nD},
}

Loading related content...

Figure