A Hierarchical Recurrent Encoder-Decoder For Generative Context-Aware Query Suggestion

Alessandro Sordoni, Yoshua Bengio, Hossein Vahabi, Christina Lioma, Jakob Grue Simonsen, Jian-Yun Nie

Introduction

Search is inherently a sequential process. When a user interacts with a search engine, their intent often unfolds over a series of queries rather than a single isolated event. Traditional query suggestion systems, however, are largely "pairwise," relying on the current query to predict the next. This approach ignores the rich context provided by previous interactions and struggles with data sparsity and the "long tail" of rare queries.

This paper introduces the Hierarchical Recurrent Encoder-Decoder (HRED), a neural architecture designed to generate context-aware suggestions by modeling the entire search session. By treating search as a sequence of both words and queries, HRED can "invent" synthetic suggestions and maintain performance even when faced with unique or noisy user behavior.

The HRED Architecture

The core innovation of this work is the application of a hierarchical structure to the standard RNN encoder-decoder framework. This allows the model to capture dependencies at two distinct levels: the word level within a query and the query level within a session.

The HRED architecture illustrating the query-level encoder, session-level RNN, and next-query decoder.

The architecture consists of three primary components:

  1. Query-Level Encoder: A Gated Recurrent Unit (GRU) RNN processes each query word-by-word, producing a fixed-length vector embedding that represents the query's semantic content.
  2. Session-Level RNN: This higher-level GRU takes the sequence of query embeddings as input. Its hidden state evolves to represent the cumulative context of the search session, effectively "remembering" the user's trajectory.
  3. Next-Query Decoder: Given the current session state, this RNN generates a new query one word at a time. Unlike retrieval-based systems, this generative approach allows the model to compose "synthetic" queries that may not exist in the training logs but are contextually relevant.

Semantic Mapping and Robustness

A key advantage of HRED is its ability to map topically similar queries into a shared vector space. This semantic mapping allows the model to generalize across synonyms and related concepts, which is crucial for handling the long tail of rare queries.

t-SNE visualization of query embeddings showing how the model clusters semantically related terms.

Furthermore, the use of GRUs allows the model to learn which parts of the session history are relevant. For instance, if a user performs a navigational query (e.g., "google") in the middle of a research task, the session-level RNN can "shut its gates," preventing this noise from corrupting the session memory.

Experimental Results

The researchers evaluated HRED using the AOL search log dataset, comparing it against traditional adjacency models (ADJ) and competitive feature-based rankers.

  • General Performance: HRED achieved a 7.8% relative improvement in Mean Reciprocal Rank (MRR) over the adjacency baseline.
  • Long-Tail Robustness: In scenarios where the current query was entirely unseen in the training data, HRED provided a massive 85.3% improvement over the ADJ model and a 5.6% boost over the feature-based ranker.
  • Noise Filtering: When sessions were intentionally corrupted with irrelevant queries, HRED outperformed baselines by 9.9%, demonstrating its superior context management.
  • Human Evaluation: In a user study, 64% of HRED's synthetic suggestions were rated as "useful" or "somewhat useful," outperforming state-of-the-art retrieval baselines.

Conclusion and Future Directions

The HRED model represents a significant step forward in generative query suggestion. By leveraging a hierarchical structure, it effectively addresses the challenges of context sensitivity and data sparsity. Future work may involve incorporating user click-through data to further refine relevance and exploring ways to generate "orthogonal" suggestions that lead users toward new but related search paths. While computationally more intensive than table lookups, the generative power and robustness of HRED make it a compelling solution for modern search engines.

Summary updated

BibTeX
@inproceedings{sordoni2015hierarchical,
  author = {Alessandro Sordoni and Yoshua Bengio and Hossein Vahabi and Christina Lioma and Jakob Grue Simonsen and Jian-Yun Nie},
  title = {{A Hierarchical Recurrent Encoder-Decoder For Generative Context-Aware Query Suggestion}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2015},
  doi = {10.1145/2806416.2806493},
}
Figure