Learning to Rank in Generative Retrieval

Yongqi Li, Nan Yang, Liang Wang, Furu Wei, Wenjie Li

Abstract

Generative retrieval models have emerged as a promising alternative to traditional dual-encoder architectures, treating document retrieval as a sequence-to-sequence task. However, these models typically optimize for identifier generation rather than final ranking order, creating a performance gap. This paper presents LTRGR (Learning-To-Rank for Generative Retrieval), a framework that introduces a dedicated learning-to-rank training phase. By explicitly optimizing for passage ranking using a margin-based loss while maintaining a generative anchor, LTRGR achieves state-of-the-art results on Natural Questions, TriviaQA, and MSMARCO without increasing inference latency.

Introduction

Text retrieval has long been dominated by dense retrieval models that utilize dual-encoders to map queries and documents into a shared vector space. Recently, a new paradigm called generative retrieval has emerged. Instead of calculating vector similarities, an autoregressive language model directly generates the "identifier" of a relevant document (e.g., its title or a unique substring) token-by-token.

Despite their potential, current generative retrieval models suffer from a fundamental disconnect: they are trained purely on a generation objective (maximizing the likelihood of the identifier text), but the ultimate goal of a search engine is to rank documents. Because the model only learns to generate intermediate identifiers—which are later converted to a ranked list via a heuristic scoring function—there is a "learning gap." Even if the model becomes great at generating valid identifiers, it doesn't necessarily know how to rank the best passages at the very top of the list.

Methodology: The LTRGR Framework

To bridge this gap, the authors propose LTRGR (Learning-To-Rank for Generative Retrieval), which consists of two distinct training phases.

The two-phase training framework of LTRGR: (a) initial generative training and (b) the proposed learning-to-rank phase.

1. Learning to Generate

The model (based on BART-large) is first trained using a standard sequence-to-sequence loss. Following recent baselines, it learns to generate "multiview identifiers" (titles, random substrings, and pseudo-queries) for target passages.

2. Learning to Rank

The core novelty of LTRGR is the second training phase. The authors use the model from Phase 1 to retrieve a list of passages for training queries. This list naturally contains both positive (relevant) and negative (irrelevant) passages. They then apply a margin-based rank loss to explicitly train the model to assign higher scores to positive passages than negative ones.

Crucially, the final loss function in Phase 2 combines this ranking loss with the original generation loss. During inference, the system operates exactly like a standard generative retriever, meaning the improved ranking capabilities come with zero extra latency.

Key Results and Analysis

The models were evaluated on the full corpus sets of three widely used benchmarks: Natural Questions (NQ), TriviaQA, and MSMARCO.

State-of-the-Art Performance

LTRGR achieved the best performance among all generative retrieval methods across all three datasets. On MSMARCO—a notoriously difficult dataset for generative models due to noisy, title-less web data—LTRGR improved MRR@10 by a massive 28.8% over the previous best generative method. On the Natural Questions dataset, LTRGR outperformed the classic dense retriever (DPR) across all metrics (Hits@5, 20, 100).

Hyperparameter Sensitivity

The effectiveness of the ranking phase is influenced by the margin $m$ and the weight of the ranking loss relative to the generation loss.

Impact of the margin $m$ (a) and loss weight (b) on retrieval performance (Hits@k).

As shown in the sensitivity analysis, performance improves as the margin and loss weight increase, eventually reaching a plateau. This indicates that explicit ranking optimization is robust and significantly enhances the model's ability to distinguish between relevant and irrelevant documents.

Discussion

Ablation studies revealed that the generation loss is an essential anchor; if only the ranking loss is used, the model collapses. Quantitative analysis further showed that the ranking loss specifically pushes positive passages from lower down the list into the top positions (e.g., Hits@5), directly addressing the weakness of pure seq2seq training.

While LTRGR marks a major milestone for generative retrieval, limitations remain. The authors found that list-wise losses (like infoNCE) performed worse than margin-based losses, likely due to the unnormalized nature of passage scores in generative retrieval. Future work will focus on developing more suitable list-wise learning methods and exploring advanced negative sample mining strategies.

Summary updated

BibTeX
@inproceedings{li2024learning,
  author = {Yongqi Li and Nan Yang and Liang Wang and Furu Wei and Wenjie Li},
  title = {{Learning to Rank in Generative Retrieval}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i8.28717},
}
Figure