Introduction
Cross-modal retrieval, particularly the task of matching text queries to video content, has seen significant advancement through the adoption of contrastive learning frameworks like CLIP. These models function by learning an embedding space where matching text-video pairs are pulled together and non-matching pairs are pushed apart. However, a persistent issue in these systems is the emergence of "hubs"—certain videos that appear as top results for a disproportionately large number of queries—and "orphans," which are rarely, if ever, retrieved. This paper introduces Normalized Contrastive Learning (NCL), a method that leverages the Sinkhorn-Knopp algorithm to eliminate these representation biases and ensure a more equitable distribution of retrieval probabilities.
The Problem: Normalization Error and Hubness
In an ideal retrieval system, the mapping between text and video should be balanced. Mathematically, in a perfect one-to-one mapping scenario, the probability of a specific video being retrieved, when summed across all possible text queries, should equal one. In practice, standard contrastive learning fails to achieve this balance.
The authors identify a "normalization error" inherent in modern retrieval models. Because the similarity scores are not properly normalized across the entire dataset, the embedding space often develops structural biases. This leads to high false-positive rates for hub videos and high false-negative rates for under-represented videos. While the gradient of standard contrastive loss theoretically attempts to minimize this error, the paper demonstrates that it is insufficient in practice, necessitating a more explicit normalization strategy.
Normalized Contrastive Learning (NCL)
To address these biases, the authors propose NCL, which enforces fairness across all instances without requiring changes to the underlying model architecture.
Sinkhorn-Knopp Biases
The core of NCL involves adding instance-specific biases ($a_i$ for text and $b_j$ for videos) to the similarity scores. By applying the Sinkhorn-Knopp algorithm—a classic method from optimal transport—the model iteratively solves for these biases to ensure the similarity matrix becomes "doubly stochastic." In this state, every row and column in the similarity matrix sums to a uniform value, effectively giving every video and text caption an equal "budget" in the retrieval process.
Test-Time Approximation
A significant challenge with global normalization is that the full distribution of queries is typically unknown at inference time. To overcome this, the authors implement a query queue containing recent training samples. This queue serves as a proxy for the test distribution, allowing the model to calculate the necessary normalization biases on the fly during inference.
Experimental Results
The researchers evaluated NCL using two base architectures—CLIP4Clip and SSB (Support-Set Bottleneck)—across three major benchmarks: ActivityNet, MSVD, and MSR-VTT.
- ActivityNet: NCL achieved a 13% relative gain in Recall@1 (R@1) for text-to-video retrieval over the CLIP4Clip baseline.
- MSVD: The impact was even more pronounced, with R@1 for video-to-text retrieval jumping from 56.6 to 69.6. The authors note that MSVD’s high imbalance (multiple captions per video) makes it particularly sensitive to the normalization improvements provided by NCL.
- Efficiency: Despite the iterative nature of the Sinkhorn-Knopp algorithm, the computational overhead is negligible compared to the standard neural network forward pass, making it a highly efficient addition to existing pipelines.
Key Insights and Future Directions
One of the paper's most compelling findings is the presence of a "modality gap," where video and text embeddings cluster into separate islands. NCL helps bridge this gap by forcing the model to account for the global structure of the embedding space rather than just local pair-wise similarities. Because NCL is architecture-agnostic, it can be treated as a drop-in replacement for the final similarity calculation in virtually any dual-encoder retrieval model.
While highly effective, NCL does rely on the query queue being a representative approximation of the test distribution. Future work may explore dynamic adaptation techniques to update the query queue in real-time, further hardening the model against distribution shifts. Additionally, while this work focused on video, the principles of NCL are likely applicable to other cross-modal tasks, such as image-text or audio-text retrieval.
Summary updated