[Paper Review] RankT5: Fine-Tuning T5 for Text Ranking with Ranking Losses
This paper introduces RankT5, a method to fine-tune T5 for text ranking by adapting its encoder-decoder and encoder-only architectures to directly output numerical ranking scores. By training with pairwise and listwise ranking losses instead of classification losses, RankT5 achieves significant performance gains on MS MARCO and Natural Question, with listwise losses improving zero-shot generalization to out-of-domain data.
Recently, substantial progress has been made in text ranking based on pretrained language models such as BERT. However, there are limited studies on how to leverage more powerful sequence-to-sequence models such as T5. Existing attempts usually formulate text ranking as classification and rely on postprocessing to obtain a ranked list. In this paper, we propose RankT5 and study two T5-based ranking model structures, an encoder-decoder and an encoder-only one, so that they not only can directly output ranking scores for each query-document pair, but also can be fine-tuned with "pairwise" or "listwise" ranking losses to optimize ranking performances. Our experiments show that the proposed models with ranking losses can achieve substantial ranking performance gains on different public text ranking data sets. Moreover, when fine-tuned with listwise ranking losses, the ranking model appears to have better zero-shot ranking performance on out-of-domain data sets compared to the model fine-tuned with classification losses.
Motivation & Objective
- To address the gap in leveraging powerful sequence-to-sequence models like T5 for text ranking, which traditionally rely on classification or token generation.
- To enable T5 to directly output real-valued ranking scores instead of discrete tokens, allowing end-to-end optimization with ranking-specific objectives.
- To investigate whether fine-tuning with ranking losses (pairwise/listwise) improves both in-domain and zero-shot out-of-domain performance compared to classification-based fine-tuning.
- To evaluate the impact of training list size on model performance when using listwise losses such as Softmax.
- To compare the generalization capability of models fine-tuned with ranking losses versus pointwise classification losses on diverse, out-of-domain benchmarks.
Proposed method
- Propose two RankT5 model variants: an encoder-decoder structure that generates a score token, and an encoder-only structure that regresses to a real-valued score via a head layer.
- Fine-tune the models using ranking losses—specifically PointCE (pointwise), Softmax (listwise), and pairwise losses—instead of standard cross-entropy for classification.
- Structure training data as lists of query-document pairs with one positive and multiple negative documents, varying list sizes from 5 to 36 to study their impact.
- Use the encoder-only variant for inference, applying a regression head to map the [CLS] token representation to a continuous ranking score.
- Apply the fine-tuned models to rerank top-1000 documents retrieved by BM25 in zero-shot evaluation across diverse BEIR benchmark datasets.
- Optimize the models using standard T5 fine-tuning procedures but with loss functions designed to maximize ranking metrics like NDCG.
Experimental results
Research questions
- RQ1Can T5 be effectively adapted to text ranking by outputting continuous ranking scores instead of discrete tokens?
- RQ2Does fine-tuning T5 with listwise ranking losses (e.g., Softmax) lead to better in-domain and zero-shot performance compared to pointwise classification losses?
- RQ3How does the size of the training list (number of documents per query) affect model performance when using listwise losses?
- RQ4Do models fine-tuned with ranking losses generalize better to out-of-domain data than those fine-tuned with classification losses?
- RQ5Is there a performance difference between the encoder-decoder and encoder-only RankT5 architectures under low-data or zero-shot conditions?
Key findings
- RankT5 models fine-tuned with listwise ranking losses, particularly Softmax loss, achieve substantial improvements over classification-based fine-tuning on MS MARCO and Natural Question datasets.
- The Softmax loss outperforms PointCE loss by an average of +2.1% NDCG@10 on 15 BEIR out-of-domain datasets, with a statistically significant improvement (p ≤ 0.05).
- On biomedical datasets like TREC-COVID, BioASQ, and NFCorpus, the Softmax loss achieves an average improvement of +4.6% over PointCE, indicating better domain generalization.
- Model performance improves with larger training list sizes, with saturation observed at list sizes over 30 for NQ and a consistent trend up to 36 on MS MARCO.
- The encoder-only RankT5 variant with a regression head achieves strong performance and enables efficient inference, making it suitable for early ranking stages.
- Fine-tuning with listwise losses results in models that better capture the abstract concept of relevance, reducing reliance on corpus-specific memorization.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.