Contrastive learning is a powerful self-supervised learning method, but we have a limited theoretical understanding of how it works and why it works. In this paper, we prove that contrastive learning with the standard InfoNCE loss is equivalent to spectral clustering on the similarity graph. Using this equivalence as the building block, we extend our analysis to the CLIP model and rigorously characterize how similar multi-modal objects are embedded together. Motivated by our theoretical insights, we introduce the Kernel-InfoNCE loss, incorporating mixtures of kernel functions that outperform the standard Gaussian kernel on several vision datasets. The code is available at https://github.com/yifanzhang-pro/Kernel-InfoNCE.
翻译:对比学习是一种强大的自监督学习方法,但我们在理论上对其工作原理及有效性认识有限。本文证明,采用标准InfoNCE损失的对比学习等价于在相似图上进行谱聚类。以此等价性为基础,我们将分析拓展至CLIP模型,并严格刻画了多模态对象如何协同嵌入。受理论洞见驱动,我们提出了Kernel-InfoNCE损失函数,该损失融合了多种核函数,在多个视觉数据集上的表现优于标准高斯核。代码开源于https://github.com/yifanzhang-pro/Kernel-InfoNCE。