Abstract
NeighborRetr is a novel training framework designed to mitigate the "hubness problem" in cross-modal retrieval tasks, such as matching text to video. Unlike existing post-hoc normalization methods, NeighborRetr addresses embedding space imbalances during the training phase. By distinguishing between semantically relevant "good hubs" and noisy "bad hubs" and ensuring that "anti-hubs" (rarely retrieved items) are properly integrated, the framework achieves state-of-the-art performance and superior generalization across diverse benchmarks.
Introduction
In high-dimensional embedding spaces used by models like CLIP to align different modalities, a phenomenon called hubness often emerges. A small subset of samples, known as "hubs," frequently appear as the nearest neighbors for a vast number of queries, regardless of their actual semantic relevance. This creates two major issues: Retrieval Bias, where "bad hubs" (irrelevant or noisy samples) dominate search results, and the Anti-hub Problem, where many valid samples are almost never retrieved.
Most existing solutions are post-hoc, relying on pre-defined data distributions during inference, which often fails under distribution shifts. NeighborRetr aims to fix the embedding space structure directly during training to ensure a more "democratic" and robust retrieval system.
Methodology
NeighborRetr introduces a two-level hierarchy framework that utilizes three specific loss functions to balance the embedding space. The model employs a fine-grained alignment approach, matching visual patches to text words before merging them into global tokens for final retrieval.
Core Loss Functions
- Centrality Weighting ($L_{Wti}$): The model maintains a Memory Bank to track how "central" (hub-like) a sample is within its own modality. It then weights the contrastive loss to ensure the model pays sufficient attention to learning these influential samples.
- Neighbor Adjusting ($L_{Nbi}$): This core innovation distinguishes between "good hubs" (semantically rich) and "bad hubs" (noisy). It calculates a "de-centralized" similarity score by subtracting a sample's centrality from its similarity score, adaptively pushing bad hubs away while pulling good hubs closer.
- Uniform Regularization ($L_{Opt}$): To rescue "anti-hubs," a marginal constraint inspired by optimal transport is applied. This forces the model to treat all samples as having an equal prior probability of being retrieved, ensuring that "forgotten" samples are properly integrated into the embedding space.
Experiments and Results
The model was evaluated on major cross-modal benchmarks, including video-text (MSR-VTT, MSVD, ActivityNet) and image-text (ECCV Caption) datasets.
Performance and Hubness Mitigation
NeighborRetr achieved state-of-the-art results, notably a 49.5% Recall@1 on MSR-VTT for text-to-video retrieval, outperforming previous top models like DiffusionRet and HBI. Crucially, the model significantly improved the distribution of retrieval frequencies.
As shown in the frequency distributions, NeighborRetr reduced "skewness" (a measure of hubness) by 46% compared to a vanilla baseline. It also improved the "Robin Hood Index," indicating a more equitable distribution of retrieval frequency across the dataset. In cross-domain tests (e.g., training on MSR-VTT and testing on ActivityNet), NeighborRetr maintained high performance where post-hoc methods failed, proving its structural robustness.
Discussion and Key Insights
A central insight of this work is that hubs are not inherently "bad." Previous methods often penalized all hubs indiscriminately, but NeighborRetr recognizes that some hubs are central because they are semantically "rich" (good hubs). By fixing hubness during the learning phase rather than as a post-processing step, the model learns a balanced embedding space that generalizes better to unseen domains. Furthermore, forcing the model to assume every item could be a valid result (Uniform Regularization) effectively counters the "rich-get-richer" dynamics typical of standard contrastive learning.
Conclusion and Future Work
NeighborRetr demonstrates significant gains in cross-modal retrieval by balancing hub centrality. While the framework adds some computational complexity due to the memory bank and marginal constraints, the performance and generalization benefits are substantial. Future work may explore scaling this approach to web-scale datasets and addressing the fundamental "modality gap" between text and visual clouds within this balanced framework.
Summary updated