EVA-CLIP: Improved Training Techniques for CLIP at Scale

Quan Sun, Yuxin Fang, Ledell Wu, Xinlong Wang, Yue CaoarXiv 2023

Abstract

Contrastive language-image pre-training, CLIP for short, has gained increasing attention for its potential in various scenarios. In this paper, we propose EVA-CLIP, a series of models that significantly improve the efficiency and effectiveness of CLIP training. Our approach incorporates new techniques for representation learning, optimization, and augmentation, enabling EVA-CLIP to achieve superior performance compared to previous CLIP models with the same number of parameters but significantly smaller training costs. Notably, our largest 5.0B-parameter EVA-02-CLIP-E/14+ with only 9 billion seen samples achieves 82.0 zero-shot top-1 accuracy on ImageNet-1K val. A smaller EVA-02-CLIP-L/14+ with only 430 million parameters and 6 billion seen samples achieves 80.4 zero-shot top-1 accuracy on ImageNet-1K val. To facilitate open access and open research, we release the complete suite of EVA-CLIP to the community.

Introduction

Training CLIP models at scale is notoriously difficult and resource-intensive. Standard training procedures often require massive datasets, enormous batch sizes, and significant computational time. Furthermore, as models scale to billions of parameters, training stability becomes a major concern. EVA-CLIP addresses these challenges by introducing a "feasible, efficient, and effective" recipe for scaling CLIP without requiring the prohibitive compute budgets typically associated with state-of-the-art vision-language models.

Methods: The EVA-CLIP Recipe

The success of EVA-CLIP is built upon four key technical pillars designed to maximize training efficiency and stability:

  1. Better Initialization (The EVA Factor): The vision encoder is initialized with weights from EVA, a model pre-trained using Masked Image Modeling (MIM). This provides a strong geometric and structural understanding of images from the start, which significantly stabilizes the contrastive learning process.
  2. LAMB Optimizer: Unlike the standard AdamW optimizer, EVA-CLIP utilizes LAMB, which is specifically designed for very large batch sizes (up to 100k+). LAMB employs adaptive, layer-wise learning rates that accelerate convergence and prevent training divergence.
  3. FLIP (Fast Language-Image Pre-training): To optimize compute, 50% of image tokens are randomly masked during training. This reduces computational complexity by half, allowing for a 2x increase in batch size with virtually no penalty to final accuracy.
  4. Flash Attention: The integration of Flash Attention kernels further speeds up Transformer layers and reduces memory overhead.
Table 1: Detailed training configurations and zero-shot performance for various EVA-CLIP model sizes compared to baselines.

Key Results and Efficiency Gains

EVA-CLIP sets new benchmarks for performance and efficiency. The flagship EVA-02-CLIP-E/14+ (5.0 billion parameters) achieved a record-breaking 82.0% zero-shot accuracy on ImageNet-1K.

Perhaps more impressive is the efficiency of the smaller variants. For instance, EVA-02-CLIP-L/14+, with only 430 million parameters, achieved 80.4% accuracy, outperforming the much larger 2.5B-parameter OpenCLIP-G/14 while using a fraction of the parameters and training data.

Figure 1: Zero-shot ImageNet-1K accuracy vs. model parameters. EVA-02-CLIP (blue) demonstrates superior scaling efficiency compared to OpenCLIP (grey).

Beyond standard classification, EVA-CLIP demonstrates superior robustness. It shows a significantly smaller performance gap when moving from standard ImageNet to out-of-distribution versions like ImageNet-Adversarial. Additionally, the models achieve state-of-the-art results in zero-shot video classification, such as 83.1% on UCF-101.

Limitations and Future Work

While EVA-CLIP dominates in classification tasks, its zero-shot retrieval performance on datasets like MS-COCO and Flickr30K is occasionally lower than some competitors. This is likely due to the relatively smaller text encoders used in several EVA-CLIP variants to conserve compute. Future research will explore scaling the text encoder to match the massive vision encoders, potentially unlocking even higher performance in complex retrieval and reasoning tasks.

Summary updated

BibTeX
@misc{sun2023eva,
  author = {Quan Sun and Yuxin Fang and Ledell Wu and Xinlong Wang and Yue Cao},
  title = {{EVA-CLIP: Improved Training Techniques for CLIP at Scale}},
  year = {2023},
  eprint = {2303.15389},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.15389},
}
Figure