arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.17683cs.LG
收藏

用于对比学习的无温度损失函数

Temperature-Free Loss Function for Contrastive Learning

Pohang University of Science and Technology(浦项科技大学)

Bum Jun Kim, Sang Woo Kim

AI总结:

针对对比学习中InfoNCE loss需繁琐调节温度超参数的问题,提出用反双曲正切函数替代温度缩放的无温度损失函数,改善了梯度特性并在五个基准上取得优异性能。

摘要:

作为自监督学习中最有前景的方法之一,对比学习在众多领域取得了一系列突破。实现对比学习的一个主要方法是应用 InfoNCE loss:通过捕获成对之间的相似性,InfoNCE loss 能够学习数据的表示。尽管取得了成功,采用 InfoNCE loss 需要调节温度,这是用于校准相似度分数的核心超参数。尽管多项研究强调了其对性能的重要性和敏感性,但寻找有效的温度需要大量基于试错的实验,这增加了采用 InfoNCE loss 的难度。为了解决这一困难,我们提出了一种无温度部署 InfoNCE loss 的新方法。具体而言,我们用反双曲正切函数替代温度缩放,从而得到改进的 InfoNCE loss。除了无超参数部署外,我们观察到该方法在对比学习中甚至产生了性能提升。我们详细的理论分析发现,InfoNCE loss 中当前温度缩放的做法在梯度下降中会导致严重问题,而我们的方法提供了理想的梯度特性。该方法在对比学习的五个基准上得到了验证,无需温度调节即产生了令人满意的结果。

英文摘要:

As one of the most promising methods in self-supervised learning, contrastive learning has achieved a series of breakthroughs across numerous fields. A predominant approach to implementing contrastive learning is applying InfoNCE loss: By capturing the similarities between pairs, InfoNCE loss enables learning the representation of data. Albeit its success, adopting InfoNCE loss requires tuning a temperature, which is a core hyperparameter for calibrating similarity scores. Despite its significance and sensitivity to performance being emphasized by several studies, searching for a valid temperature requires extensive trial-and-error-based experiments, which increases the difficulty of adopting InfoNCE loss. To address this difficulty, we propose a novel method to deploy InfoNCE loss without temperature. Specifically, we replace temperature scaling with the inverse hyperbolic tangent function, resulting in a modified InfoNCE loss. In addition to hyperparameter-free deployment, we observed that the proposed method even yielded a performance gain in contrastive learning. Our detailed theoretical analysis discovers that the current practice of temperature scaling in InfoNCE loss causes serious problems in gradient descent, whereas our method provides desirable gradient properties. The proposed method was validated on five benchmarks on contrastive learning, yielding satisfactory results without temperature tuning.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑