In this paper, we study contrastive learning from an optimization perspective, aiming to analyze and address a fundamental issue of existing contrastive learning methods that either rely on a large batch size or a large dictionary of feature vectors. We consider a global objective for contrastive learning, which contrasts each positive pair with all negative pairs for an anchor point. From the optimization perspective, we explain why existing methods such as SimCLR require a large batch size in order to achieve a satisfactory result. In order to remove such requirement, we propose a memory-efficient Stochastic Optimization algorithm for solving the Global objective of Contrastive Learning of Representations, named SogCLR. We show that its optimization error is negligible under a reasonable condition after a sufficient number of iterations or is diminishing for a slightly different global contrastive objective. Empirically, we demonstrate that SogCLR with small batch size (e.g., 256) can achieve similar performance as SimCLR with large batch size (e.g., 8192) on self-supervised learning task on ImageNet-1K. We also attempt to show that the proposed optimization technique is generic and can be applied to solving other contrastive losses, e.g., two-way contrastive losses for bimodal contrastive learning. The proposed method is implemented in our open-sourced library LibAUC (www.libauc.org).
Stochastic Optimization with Laggard Data Pipelines
Google AI Princeton(谷歌人工智能普林斯顿研究院);Google Research(谷歌研究院);Apple(苹果公司);Microsoft Research(微软研究院);Tel Aviv University(特拉维夫大学);Princeton University(普林斯顿大学);Google Brain(谷歌大脑)
Rethinking Safety in LLM Fine-tuning: An Optimization Perspective
Microsoft Research(微软研究院);KAIST(韩国科学技术院);KAUST(韩国科学技术大学);Université de Montréal(蒙特利尔大学);Mila(蒙特利尔人工智能研究院);WhiteBox(WhiteBox公司);University of Oxford(牛津大学)
On Stochastic Variance Reduced Gradient Method for Semidefinite Optimization
School of Computer and Information Engineering, Jiangxi Normal University(江西师范大学计算机与信息工程学院);Institute of Artificial Intelligence, Jiangxi Normal University(江西师范大学人工智能研究院);Institute of Computing, Chinese Academy of Sciences(中国科学院计算技术研究所);Chemical and Biomolecular Engineering, Hong Kong University of Science and Technology(香港科技大学化学与生物分子工程系)