Skip to main content
QUICK REVIEW

[Paper Review] An Inverse Scaling Law for CLIP Training

Xianhang Li, Zeyu Wang|arXiv (Cornell University)|May 11, 2023
Advanced Neural Network ApplicationsComputer Science8 citations
TL;DR

The paper uncovers an inverse scaling law in CLIP training: using larger image/text encoders allows training with shorter token sequences while maintaining competitive performance, enabling efficient CLIP training with limited compute via CLIPA.

ABSTRACT

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.

Motivation & Objective

  • Demonstrate that increasing model size allows CLIP training with fewer image/text tokens without large performance loss.
  • Systematically compare token-reduction strategies for images and text on CLIP training across multiple model scales.
  • Identify token-reduction strategies that best preserve semantic information and optimize scaling quality.

Proposed method

  • Evaluate eight token-reduction strategies (four image, four text) for CLIP training.
  • Use ViT visual encoder and non-autoregressive Transformer text encoder with LAION-400M data and 2,000 ImageNet-1k epochs equivalent exposure.
  • Test token-length reductions from full resolution to extreme reductions (e.g., 17 image tokens, 8 text tokens) across S/16, B/16, L/16 models.
  • Compare token-reduction strategies such as image resizing, random masking, grid masking, block masking, truncation, text masking, block masking, and syntax masking.
  • Introduce CLIPA, a framework that trains CLIP efficiently with larger models and reduced input tokens to achieve high zero-shot accuracy with lower compute.
  • Evaluate on zero-shot ImageNet-1k, COCO retrieval, and VTAB benchmarks to assess robustness and generalization.

Experimental results

Research questions

  • RQ1Can larger CLIP models tolerate shorter image/text token sequences during training without substantial performance degradation?
  • RQ2Which token-reduction strategies best preserve semantic information to maximize the inverse scaling effect?
  • RQ3What are the practical compute-time trade-offs when applying the inverse scaling law in CLIP training, and how does CLIPA perform relative to OpenCLIP under limited resources?
  • RQ4Does the inverse scaling law hold across model types (ViT-based and ConvNeXt) and on larger datasets/model scales?

Key findings

  • Larger models require fewer image/text tokens to achieve similar performance drops, evidencing the inverse scaling law for CLIP training.
  • Image token reduction: moving from full 196 tokens to smaller lengths shows smaller performance drops as model size increases (e.g., 6.2% drop for S/16 vs 3.0% for L/16 under certain reductions).
  • Text token reduction exhibits similar inverse scaling behavior, with syntax masking often providing the best performance under short text lengths (e.g., 69.0% zero-shot accuracy with B/16, 8 tokens).
  • Image resizing preserves more semantic information than masking strategies and yields strong performance with far fewer tokens (e.g., 68.9% zero-shot with 112×112 input for L/16).
  • CLIPA achieves competitive or better zero-shot ImageNet-1k accuracy with dramatically fewer GPU hours (e.g., CLIPA-B/16 ~10× fewer hours; CLIPA-L/16 ~17× fewer hours) than OpenCLIP baselines.
  • At scale, CLIPA-H/14 attains ~79.1% IN-1k with ~1/15th the training cost of OpenCLIP-H/14, and CLIPA-G/14 reaches a new record 83.0% IN-1k zero-shot with ~33× less compute.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.