When Softmax Fails at the Top: Extreme‑Value Corrections for InfoNCE
Abstract
InfoNCE is the standard contrastive learning objective, but its softmax form is not only a computational convenience: it also encodes a statistical assumption about how the top-scoring example is selected. Using extreme value theory, we show that this assumption is often misaligned with the normalized embedding setting used in modern contrastive learning. Motivated by this mismatch, we propose \textsc{WEINCE}, a simple modification of InfoNCE that uses anchor-wise online batch statistics to blend the usual softmax logits with an endpoint shortfall correction, adding no trainable parameters. Across five vision benchmarks, \textsc{WEINCE} yields consistent improvements in frozen-feature evaluation. These results show that a more faithful statistical treatment of hard negatives can improve contrastive objectives.\footnote{Code: \href{https://github.com/hsme98/weince}{github.com/hsme98/weince}.}
Lay Summary
Many modern AI systems learn useful features by comparing examples. Related examples should be treated as similar, while unrelated examples should be pushed apart. A key part of this training is deciding which “wrong” examples are most important to learn from. The widely used approach for doing this can place too much or too little emphasis on the hardest wrong examples, especially when similarity scores have a fixed upper limit. We show why this mismatch happens and propose a simple correction that better accounts for this limit. The correction can be added to existing training methods without adding new learned components. In experiments on several image datasets and a sentence-understanding task, it improved the quality of the learned features. These results suggest that carefully modeling the hardest comparisons can make AI systems learn more reliable representations from unlabeled data.