- Published on
Listwise loss does not consistently makeup for retrieval performance drop induced by InfoNCE loss
- Authors

- Name
- Abdulhakeem Adefioye
- @koko_lamba
Motivation
Tamber et al. argue that conventional InfoNCE contrastive learning often reduces retrieval effectiveness when strong dense retrievers are fine-tuned on corpus-specific synthetic data [1]. Their proposed fix is to combine contrastive learning with cross-encoder listwise distillation, where a stronger reranker provides a richer relevance distribution over the retrieved passages.
This post is a write-up of our replication of that work. The core questions are the following: does contrastive loss always fall short when applied to newer embedding models such as Nomic-Embed [2] and ModernBERT-Embed [3]? We also wanted to test whether combining InfoNCE with a KL/listwise distillation objective would recover the retrieval performance drop caused by InfoNCE loss as observed in the paper.
The short answer is that the result somewhat contradicts the findings of Tamber et al. For ModernBERT-Embed, InfoNCE loss reduced retrieval effectiveness on most datasets, and combined loss was unable to help recover the performance drop. For Nomic-Embed, however, InfoNCE fine-tuning generally improved retrieval effectiveness except MSMARCO contrary to the work of Tamber et al. This is the main reason we think the stronger claim is not that contrastive learning always fails, but that it is fragile and possibly model-dependent.
Methodology and Experiments
The experiments followed the general structure of Tamber et al. We evaluated base retrievers, reranked their retrieved passages with RankT5-3B [4], generated and filtered synthetic training data, and then fine-tuned Nomic-Embed and ModernBERT-Embed with either pure InfoNCE or a combined InfoNCE + KL/listwise loss.
The following procedures were followed:
- We generated and filtered synthetic training data, both queries and passages.
- We retrieved candidate passages for all synthetic queries with dense retrievers(Nomic-Embed and ModernBERT-Embed).
- We reranked retrieved passages with reranker, RankT5-3B.
- We normalized reranker scores.
- We trained retrievers with either InfoNCE or a joint objective.
- We evaluated with NDCG@10 and Recall@100.
For the pure contrastive setting, we used the InfoNCE objective from Tamber et al. Let denote the -th query in a batch of queries, and let denote its positive passage. For another query , denotes that query's positive passage when it is used as an in-batch negative for , while denotes the -th hard-negative passage retrieved for . The dense retriever scoring function is , is the number of hard negatives per query, and is the temperature parameter. The loss is:
For listwise distillation, we followed Tamber et al. by turning dense-retriever scores and cross-encoder scores into relevance distributions over the retrieved list. For a scoring function s(q, p), the normalized score distribution is:
The listwise term then minimizes the KL divergence between the dense retriever distribution and the cross-encoder distribution:
The joint objective combines the contrastive and KL/listwise terms:
The joint loss used the same broad motivation as Tamber et al.: preserve the contrastive signal while also making the retriever imitate the score distribution of a better cross-encoder reranker. In our implementation, the combined loss used a contrastive loss weight of 0.1, with the remaining weight placed on the KL/listwise term.
Results and Discussion
Reranking shows why distillation is worth trying
Before fine-tuning, RankT5-3B substantially improved over the Nomic-Embed retriever when reranking the top 1000 passages as shown in Table 1. This matters because it shows that the teacher model has useful ranking behavior that the dense retriever does not yet capture.
| Dataset | Nomic-Embed | RankT5-3B |
|---|---|---|
| TREC-COVID | 63.9 | 79.6 |
| NFCorpus | 31.4 | 39.3 |
| FiQA | 28.7 | 47.4 |
| SCIDOCS | 12.7 | 18.3 |
| ArguAna | 32.7 | 34.8 |
| Touché-2020 | 31.0 | 38.2 |
| Climate-FEVER | 25.3 | 29.4 |
| SciFact | 53.0 | 72.4 |
Table 1: NDCG@10 for Nomic-Embed and RankT5-3B.
The top-1 relevance numbers tell a similar story. After reranking, the percentage of relevant documents at rank 1 rose across every dataset tested for both ModernBERT-Embed and Nomic-Embed.
| Dataset | ModernBERT-Embed | Nomic-Embed | ||||
|---|---|---|---|---|---|---|
| Q | Before reranking | After reranking | Q | Before reranking | After reranking | |
| TREC-COVID | 266335 | 72.5 | 91.7 | 211340 | 66.8 | 92.2 |
| NFCorpus | 9592 | 85.7 | 95.6 | 8415 | 79.3 | 95.0 |
| FiQA | 280455 | 64.8 | 83.8 | 247284 | 55.4 | 86.6 |
| SCIDOCS | 133052 | 85.7 | 97.0 | 131557 | 78.2 | 97.4 |
| ArguAna | 32807 | 69.5 | 89.2 | 31221 | 57.1 | 89.7 |
| Touché-2020 | 272907 | 50.2 | 72.0 | 216398 | 40.5 | 76.7 |
| SciFact | 19960 | 89.0 | 97.8 | 22249 | 85.4 | 98.1 |
| MSMARCO | 191859 | 59.8 | 74.9 | 176470 | 50.8 | 77.6 |
Table 2: Number of queries and percentage of relevant documents at rank 1 before and after RankT5-3B reranking.
Note: Q = Number of queries evaluated.
Nomic-Embed behaves differently from the Tamber et al.'s main result
The strongest divergence from Tamber et al. appears with Nomic-Embed. InfoNCE reduced performance on MSMARCO DL19 and DL20, but improved the model on SciFact, NFCorpus, FiQA, and ArguAna.
| MSMARCO | SCIFACT | NFCORPUS | FIQA | ARGUANA | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| DL19 | DL20 | |||||||||||
| NDCG | Recall | NDCG | Recall | NDCG | Recall | NDCG | Recall | NDCG | Recall | NDCG | Recall | |
| Nomic-Embed | 65.9 | 57.8 | 65.8 | 66.1 | 53.0 | 83.9 | 31.4 | 28.8 | 28.7 | 59.5 | 32.7 | 88.6 |
| + FT with infonce loss | 61.0 | 56.3 | 60.0 | 63.6 | 67.2 | 92.6 | 32.5 | 29.0 | 30.1 | 62.9 | 53.2 | 98.1 |
| + FT with combined loss | - | - | - | - | 67.1 | 92.7 | 29.3 | 28.3 | - | - | 49.4 | 96.4 |
| ModernBERT-Embed | 66.0 | 60.0 | 65.2 | 65.2 | 62.6 | 89.6 | 30.2 | 28.6 | 35.8 | 67.2 | 32.8 | 84.0 |
| + FT with infonce loss | 59.5 | 55.5 | 57.6 | 62.5 | 59.2 | 87.4 | 27.5 | 25.7 | 34.6 | 65.5 | 43.3 | 94.0 |
| + FT with combined loss | 56.7 | 51.7 | 56.0 | 59.0 | 61.8 | 88.4 | 28.8 | 28.3 | - | - | 46.7 | 94.9 |
Table 3: NDCG@10 and Recall@100 for base and fine-tuned Nomic-Embed and ModernBERT-Embed models. Dashes indicate runs not reported in the current result document.
For Nomic-Embed, InfoNCE improved SciFact NDCG@10 from 53.0 to 67.2, FiQA from 28.7 to 30.1, NFCorpus from 31.4 to 32.5, and ArguAna from 32.7 to 53.2. These are not small changes, especially on SciFact and ArguAna.
However, MSMARCO moved in the opposite direction. DL19 NDCG@10 dropped from 65.9 to 61.0, while DL20 dropped from 65.8 to 60.0. Since Nomic-Embed was originally trained with MSMARCO documents, overfitting might account for the drop in performance.
ModernBERT-Embed supports Tamber et al.'s work on InfoNCE loss
ModernBERT-Embed behaved much closer to the finding described by Tamber et al. InfoNCE reduced NDCG@10 on DL19, DL20, SciFact, NFCorpus, and FiQA. ArguAna was the only exception, where NDCG@10 increased from 32.8 to 43.3.
The combined InfoNCE + KL loss did not recover the lost performance for ModernBERT-Embed. It improved over pure InfoNCE on SciFact, NFCorpus, and ArguAna, but still stayed below the base model on DL19, DL20, SciFact, and FiQA where results were available. This suggests that simply adding a listwise KL term is not automatically enough. New or alternative approaches would be needed to recover retrieval performance and ultimately approach reranker performance.
Combined loss was not a clear win in this replication work
One of the most important findings from Tamber et al. is that combined contrastive and listwise distillation training consistently beat contrastive loss alone across several datasets. Our reproduction did not show the same observation.
For Nomic-Embed, the combined loss was worse than pure InfoNCE on most reported datasets. For ModernBERT-Embed, the combined loss improved over pure InfoNCE on several datasets, but it did not restore the original base model's retrieval effectiveness.
This does not invalidate the usefulness of listwise distillation. The reranking results clearly show that RankT5-3B has ranking knowledge worth distilling. What the result does show is that a naive or lightly tuned hybrid objective is not guaranteed to recover performance. In fact, in this reproduction, rigorous hyperparameter tuning was performed with no significant retrieval recovery.
Conclusion
This reproduction partially supports Tamber et al. but also complicates the main takeaway. For ModernBERT-Embed, contrastive fine-tuning often fell short. For Nomic-Embed, contrastive fine-tuning often helped, especially on SciFact and ArguAna. Therefore, the failure mode seems less like a universal limitation of InfoNCE and more like an interaction between the base retriever, pre-training data, and the fine-tuning objective.
The most useful next step is not to abandon distillation. The reranker clearly improves top-ranked relevance, so there is signal to transfer. We would next look at alternative approaches beyond hyperparameter tuning. One such approach is weighted KL-divergence or contrastively weighted KL loss [5], since it is designed to make the distillation term focus more directly on separating relevant and non-relevant passages.
Code
Available here
Wandb logs here and here and here
References
- Tamber, M. S., Kazi, S., Sourabh, V., & Lin, J. (2025). Conventional contrastive learning often falls short: Improving dense retrieval with cross-encoder listwise distillation and synthetic data. arXiv:2505.19274.
- Nomic AI. Nomic Embed Text v1. https://huggingface.co/nomic-ai/nomic-embed-text-v1
- Nomic AI. ModernBERT Embed Base. https://huggingface.co/nomic-ai/modernbert-embed-base
- RanT5-3B. https://huggingface.co/Soyoung97/RankT5-3b.
- Yang, Y., Qiao, Y., He, S., & Yang, T. (2024). Weighted KL-divergence for document ranking model refinement. arXiv:2406.05977.
Citation
If you find this article useful, please cite it as:
BibTex
@article{abdulhakeem2025listwise-loss,
title={Listwise loss does not consistently makeup for retrieval performance drop induced by InfoNCE loss},
author={Abdulhakeem, Adefioye},
year={2025},
month={November},
url={https://adefioye.github.io/blog/listwise-loss}
}