Using Image Captions and Multitask Learning for Recommending Query Reformulations

Gaurav Verma, Vishwa Vinay, Sahil Bansal, Shashank Oberoi, Makkunda Sharma, Prakhar Gupta

TL;DR

This paper proposes a novel approach to query reformulation for image search by training sequence-to-sequence models to predict the captions of clicked images rather than just the user's next query. By combining this with a multitask learning framework that jointly optimizes for result ranking using a pairwise loss, the authors generate suggestions that are more descriptive, relevant, and diverse than standard baselines.

What Problem Does This Paper Address?

Search is an iterative process. Users often start with short, ambiguous queries (e.g., "friends") and refine them (e.g., "group of friends enjoying outdoors") based on the results they see. While modern search engines provide query suggestions, traditional models rely on historical logs of query-to-query transitions.

The authors identify two main limitations in current systems:

  1. Linguistic Poverty: User-generated reformulations are often just as brief and keyword-heavy as the original queries.
  2. Missing Context: Standard models often ignore the implicit feedback provided by which images a user actually clicked during their session.

The goal is to move beyond simple keyword transitions toward "descriptive reformulations" that help users articulate their intent more effectively.

The core idea: using clicked image captions and joint ranking to improve reformulations.

Methods

The researchers build upon the Hierarchical Recurrent Encoder-Decoder (HRED) architecture. This model uses three main parts:

  • Query Encoder: A bidirectional LSTM that turns individual queries into vector representations ($V_{q_i}$).
  • Session Encoder: A unidirectional LSTM that tracks the sequence of queries in a session to maintain context ($V_S^{q_i}$).
  • Query Decoder: An LSTM that generates the suggested reformulation word-by-word.
The HRED architecture consisting of query encoder, session encoder, and decoder.

The Novel Twists:

  1. Captions as Supervision: Instead of training the decoder to predict the next query ($q_{i+1}$), they train it to predict the caption of the image the user clicked ($C_i^{clicked}$). Captions are typically written by professionals and are linguistically richer, containing attributes and relationships (e.g., "A beautiful girl wearing a yellow shirt...").
  2. Multitask Learning (Ranker Component): They add a secondary task: ranking the $m$ images shown to the user. The model learns to maximize the similarity between the session/query embedding and the embeddings of clicked images.
  3. Pairwise Ranking Loss (RO): Instead of simple binary classification (clicked vs. not clicked), they use a pairwise loss function. This forces the model to learn why a user preferred image A over image B, which the authors show leads to more diverse query suggestions.
The multitask architecture adding a Ranker component to the HRED base.

Datasets

The study uses a massive real-world dataset from Adobe Stock:

  • Scale: 1,301,888 sessions and 2,122,079 queries.
  • Content: Over 10 million unique images, each with professional captions.
  • Logs: The data includes impression logs (what was shown) and interaction logs (what was clicked).
  • Preprocessing: Queries were segmented into sessions using a 30-minute window.

Key Insights and Ideas

  • Captions are Better Targets: Because captions are descriptive, models trained on them learn to suggest "novel" words that weren't in the original query but add useful detail.
  • Multitasking is a Regularizer: Jointly training for ranking and generation improves both tasks. The ranking signal helps the encoder create better representations of user intent, which in turn helps the decoder generate better text.
  • Pairwise > Pointwise: Using a pairwise ranking loss (RO) significantly improves the diversity of suggestions. It prevents the model from collapsing into suggesting the same "safe" popular queries for every user.
  • Relevance-Diversity Trade-off: As you increase the number of suggestions (beam width $K$), diversity increases, but average relevance (similarity to the ground truth) tends to drop. The authors found $K=3$ to be the "sweet spot."
The trade-off between relevance (sim_emb) and diversity as the number of candidates (K) increases.

Key Results

  • Ranking Performance: The best multitask model (HREDCap + Ranker (RO)) achieved a Mean Reciprocal Rank (MRR) of 0.41, a 32% improvement over the baseline observed MRR of 0.31.
  • Descriptiveness: Models trained on captions inserted significantly more "novel" words (2.56 words on average) compared to models trained on subsequent queries (1.04 words).
  • Semantic Similarity: While caption-based models had slightly lower semantic similarity to the next query (because they were being more descriptive and "creative"), they scored higher on BLEU and Diversity metrics.

Limitations and Future Work

  • Simple Image Representation: Currently, images are represented by the average of their caption's word embeddings. The authors suggest that using richer visual features (from CNNs) could further improve the ranker.
  • Fixed Impression Size: The model assumes a fixed number of results ($m=10$) for the ranking task, which may not reflect dynamic scrolling behavior in real apps.
  • Generalization: While tested on image search, the authors believe this could work for textual documents if "content properties" (like summaries or titles) are integrated into the training signal.

Summary updated

BibTeX
@inproceedings{verma2020using,
  author = {Gaurav Verma and Vishwa Vinay and Sahil Bansal and Shashank Oberoi and Makkunda Sharma and Prakhar Gupta},
  title = {{Using Image Captions and Multitask Learning for Recommending Query Reformulations}},
  booktitle = {ECIR},
  year = {2020},
  url = {https://openreview.net/forum?id=5I2ksIxVcPK},
}
Figure