[论文解读] An Inverse Scaling Law for CLIP Training
该论文在 CLIP 训练中揭示了反向缩放定律:使用更大的图像/文本编码器可以在缩短标记序列的同时保持竞争性能,从而通过 CLIPA 用有限算力实现高效的 CLIP 训练。
CLIP, one of the pioneering foundation models that connect images and text, has enabled many recent breakthroughs in computer vision. However, its associated training cost is prohibitively high, imposing a significant barrier to its widespread exploration. In this paper, we present a surprising finding that there exists an inverse scaling law for CLIP training, whereby the larger the image/text encoders used, the shorter the sequence length of image/text tokens that can be applied in training. Moreover, we showcase that the strategy for reducing image/text token length plays a crucial role in determining the quality of this scaling law. As a result of this finding, we are able to successfully train CLIP even with limited computational resources. For example, using 8 A100 GPUs, our CLIP models achieve zero-shot top-1 ImageNet-1k accuracies of 63.2% in ~2 days, 67.8% in ~3 days, and 69.3% in ~4 days. Our method also works well when scaling up -- with G/14, we register a new record of 83.0% ImageNet-1k zero-shot accuracy, and meanwhile accelerate the training by ~33x compared to its OpenCLIP counterpart. By reducing the computation barrier associated with CLIP, we hope to inspire more research in this field, particularly from academics. Our code is available at https://github.com/UCSC-VLAA/CLIPA.
研究动机与目标
- 证明增大模型规模可以在较少的图像/文本标记下进行 CLIP 训练而不产生较大性能损失。
- 系统性比较多模型尺度下图像和文本的标记缩减策略在 CLIP 训练中的效果。
- 识别在保留语义信息并优化缩放质量方面表现最好的标记缩减策略。
提出的方法
- 评估八种标记缩减策略(四种图像、四种文本)用于 CLIP 训练。
- 使用 ViT 视觉编码器和非自回归 Transformer 文本编码器,使用 LAION-400M 数据并达到相当于 2,000 个 ImageNet-1k 轮次的曝光。
- 在 S/16、B/16、L/16 模型上测试从全分辨率到极限缩减的标记长度(如 17 个图像标记、8 个文本标记)。
- 比较如图像重采样、随机掩蔽、网格掩蔽、块掩蔽、截断、文本掩蔽、块掩蔽和句法掩蔽等标记缩减策略。
- 引入 CLIPA,这是一个框架,通过在输入标记减少的同时使用更大模型实现高效训练,以达到更低计算成本下的高零-shot 精度。
- 在零-shot ImageNet-1k、COCO 检索和 VTAB 基准上进行评估,以评估鲁棒性和泛化能力。
实验结果
研究问题
- RQ1更大规模的 CLIP 模型是否能够在训练时容忍较短的图像/文本标记而不造成显著性能下降?
- RQ2哪些标记缩减策略能最好地保留语义信息以最大化反向缩放效应?
- RQ3在将反向缩放定律应用于 CLIP 训练时的实际计算时间权衡是什么,以及在资源受限下 CLIPA 相对于 OpenCLIP 的表现如何?
- RQ4该反向缩放定律在不同模型类型(基于 ViT 与 ConvNeXt)和更大数据集/模型尺度下是否成立?
主要发现
- 更大模型在达到相似性能时需要的图像/文本标记更少,证明了 CLIP 训练的反向缩放定律。
- 图像标记缩减:从 full 196 标记到更小长度时,模型规模越大,性能下降越小(例如在某些缩减下,S/16 的下降为 6.2%,而 L/16 为 3.0%)。
- 文本标记缩减呈现类似的反向缩放行为,句法掩蔽在短文本长度下通常提供最佳性能(例如 B/16、8 标记时零-shot 精度 69.0%)。
- 图像重采样比掩蔽策略保留更多语义信息,在显著减少标记数量时仍能获得强劲性能(例如 L/16 使用 112×112 输入的零-shot 精度为 68.9%)。
- CLIPA 在零-shot ImageNet-1k 精度方面具备可比或更好表现,同时在 GPU 小时数上显著低于 OpenCLIP 基线(如 CLIPA-B/16 约低 10× GPU 小时;CLIPA-L/16 约低 17×)。
- 在尺度化情境下,CLIPA-H/14 的 IN-1k 约为 79.1%,训练成本约为 OpenCLIP-H/14 的 1/15;CLIPA-G/14 达到新纪录 83.0% IN-1k 零-shot,计算量约为 33× 更低。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。