Introduction
Generative retrieval (GR) has emerged as a promising new search paradigm that deviates from traditional keyword matching or dual-encoder architectures. Instead of mapping queries and documents into a shared vector space, GR models utilize large language models (LLMs) to directly generate document "identifiers"—such as titles or unique strings—associated with relevant content. However, a significant "learning gap" persists in current GR systems: while they are trained to predict strings (language modeling), their ultimate goal is to rank documents.
This disconnect means that a model might be highly proficient at generating likely identifier strings but mediocre at ordering them by relevance. LTRGR (Learning to Rank in Generative Retrieval) addresses this by introducing a training framework that directly optimizes the model for the final ranking task.
The LTRGR Framework
The authors propose a two-stage training process designed to bridge the gap between generation and ranking without increasing inference-time complexity.
- Stage 1: Learning to Generate: The model is initially trained as a standard GR system, specifically adopting the MINDER architecture. It learns to generate "multiview identifiers," which include document titles, random substrings, and "pseudo-queries" associated with a passage.
- Stage 2: Learning to Rank: This novel stage continues training using a multi-task loss. The model retrieves a list of candidate passages and applies a margin-based rank loss ($L_{rank}$). This loss penalizes the model if the score of an irrelevant passage is too close to or exceeds the score of a relevant one.
Crucially, the passage score is calculated as the sum of the language model's scores for its generated identifiers. By backpropagating through this sum, the model adjusts its token-level probabilities to favor truly relevant documents. Because these adjustments are baked into the model weights, the inference speed remains identical to standard GR models.
Experimental Results and Key Insights
LTRGR was evaluated on three major benchmarks: Natural Questions (NQ), TriviaQA, and MSMARCO. The results demonstrate that "learning to rank" is a critical missing piece for the generative paradigm.
- State-of-the-Art Performance: LTRGR achieved the best performance among all generative retrieval methods across all tested datasets. On the NQ dataset, it achieved a Hits@5 of 68.8, outperforming the dominant dense retrieval baseline, DPR (68.3).
- The MSMARCO Breakthrough: Generative retrieval has historically struggled with the messy, real-world web data of MSMARCO. LTRGR showed a massive 28.8% improvement in MRR@10 on this dataset, suggesting that explicit rank optimization allows GR to handle documents that lack clean metadata.
- Multi-tasking Necessity: The researchers found that maintaining the original generation loss ($L_{gen}$) during Stage 2 is vital. Without it, the model tends to "forget" how to generate valid identifier strings while attempting to optimize their rank.
Analysis and Hyperparameter Sensitivity
The effectiveness of LTRGR is influenced by two primary hyperparameters: the margin ($m$) used in the ranking loss and the balancing weight ($\lambda$) between the ranking and generation losses.
As shown in the sensitivity analysis, performance tends to stabilize once the margin and loss weight reach optimal thresholds. While the model is robust, improper tuning can lead to performance dips. Interestingly, the authors found that a simpler pairwise margin-based loss outperformed more complex list-wise losses like InfoNCE in this specific generative context.
Conclusion
LTRGR demonstrates that the heuristic used to rank documents at test time can be successfully integrated into the training loop as a differentiable loss function. By closing the loop between generation and ranking, LTRGR sets a new standard for generative retrieval, proving that LLMs can be trained to not only "hallucinate" relevant identifiers but to order them with high precision. Future work may explore more sophisticated list-wise ranking methods and strategies to scale this ranking phase to even larger corpora.
Summary updated