[Paper Review] Scaling Vision Transformers
This paper investigates scaling laws for Vision Transformers (ViT) by training models from 5M to 2 billion parameters on datasets ranging from 1M to 3B images, using up to 10,000 TPUv3 core-days. It introduces architectural and training improvements—particularly strong L2 regularization on the final layer—that enable a 2B-parameter ViT to achieve 90.45% top-1 accuracy on ImageNet, setting a new state-of-the-art, and 84.86% with only 10 shots per class.
Attention-based neural networks such as the Vision Transformer (ViT) have recently attained state-of-the-art results on many computer vision benchmarks. Scale is a primary ingredient in attaining excellent results, therefore, understanding a model's scaling properties is a key to designing future generations effectively. While the laws for scaling Transformer language models have been studied, it is unknown how Vision Transformers scale. To address this, we scale ViT models and data, both up and down, and characterize the relationships between error rate, data, and compute. Along the way, we refine the architecture and training of ViT, reducing memory consumption and increasing accuracy of the resulting models. As a result, we successfully train a ViT model with two billion parameters, which attains a new state-of-the-art on ImageNet of 90.45% top-1 accuracy. The model also performs well for few-shot transfer, for example, reaching 84.86% top-1 accuracy on ImageNet with only 10 examples per class.
Motivation & Objective
- To understand how Vision Transformers scale in terms of model size, data, and compute, especially in comparison to NLP Transformers.
- To identify architectural and training recipe improvements that enhance representation quality and few-shot transfer performance.
- To train a large-scale ViT model with 2 billion parameters and evaluate its performance on ImageNet and few-shot transfer benchmarks.
- To characterize the performance-compute frontier and identify bottlenecks in scaling (model size, data, compute).
- To reduce memory consumption of ViT while maintaining or improving accuracy through hardware-aware design and optimizer choices.
Proposed method
- Scaling ViT models from 5M to 2B parameters, training on ImageNet-21k and up to 3B weakly-labeled images using TPUv3 hardware.
- Measuring representation quality via linear 10-shot evaluation and full fine-tuning on ImageNet, CIFAR-100, Oxford IIIT Pets, and Caltech-UCSD Birds.
- Applying strong L2 regularization exclusively to the final linear classification layer to improve few-shot transfer performance.
- Optimizing training hyperparameters, including learning rate, cooldown steps, and weight decay, to improve convergence and generalization.
- Reducing memory consumption via hardware-specific architectural changes and a modified optimizer, enabling training of a 2B-parameter model.
- Using a saturating power-law model to approximate the performance-compute frontier across varying compute, model, and data scales.
Experimental results
Research questions
- RQ1How do ViT models scale in terms of accuracy when increasing model size, training data, and compute budget?
- RQ2What are the primary bottlenecks in ViT scaling—model capacity, dataset size, or compute—under different configurations?
- RQ3How does strong L2 regularization on the final layer affect few-shot transfer performance in ViT models?
- RQ4Can architectural and training recipe improvements reduce memory consumption while enabling larger ViT models?
- RQ5To what extent do scaling laws observed in NLP Transformers generalize to the vision domain?
Key findings
- A 2B-parameter Vision Transformer achieves 90.45% top-1 accuracy on ImageNet, setting a new state-of-the-art.
- With only 10 examples per class, the ViT-G model reaches 84.86% top-1 accuracy on ImageNet in a 10-shot linear evaluation.
- The model achieves 69.52% accuracy with just one example per class, demonstrating strong few-shot transfer capability.
- Larger models benefit significantly from more data, even beyond 1B images; 30-300M images are insufficient to saturate the largest models.
- Smaller models saturate and fall off the performance-compute frontier when trained for too long, indicating overfitting or compute inefficiency.
- Memory consumption is substantially reduced through hardware-specific architecture changes and optimizer modifications, enabling training of a 2B-parameter ViT.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.