Bigger Text Encoders Can Hurt CLIP Zero-Shot Performance
Organizations: Microsoft · Brown University
Abstract
Contrastive Language-Image Pretraining (CLIP) is a building block of many machine learning applications. Scaling laws have guided resource allocation for large-scale training, yet prior work treats total CLIP model size as a single variable, without exploring how the capacity split between encoders impacts downstream performance. Here, we train multiple CLIP models with different vision and text encoder sizes, revealing that for most vision encoders, there is an optimal text encoder size beyond which zero-shot performance degrades---even as total parameter count increases. Exploiting this behavior yields efficient configurations that match the zero-shot performance of the standard ViT-B/16 architecture with up to 55% fewer parameters. We further show that this degradation stems from overfitting induced by the oversized text encoder, and that using modality-specific weight decay coefficients not only recovers but improves performance across all degraded configurations. A geometric analysis reveals a trade-off in which scaling the text encoder improves embedding uniformity but worsens cross-modal alignment; we further show that these metrics are predictive of zero-shot performance. We hope these findings motivate CLIP architectures and training methods that counteract this degradation, a prerequisite for scaling CLIP reliably and efficiently.
Figures & tables
| Name | Layers | Width | Heads | Params |
|---|---|---|---|---|
| Atto | 12 | 256 | 4 | 10M |
| Tiny | 10 | 640 | 10 | 50M |
| Base | 12 | 768 | 12 | 86M |
| Giant | 20 | 896 | 14 | 194M |
| Colossal | 22 | 1152 | 18 | 352M |
Appendix figures & tables23 assets
Supplementary material from the paper’s appendix.
Appendix
| Task type | Dataset | Task | Test size | Classes | Main metric | ZS | LP |
| Classification | Caltech-101 ( Fei-Fei et al., 2007 ) | Object recognition | 6,085 | 102 | mean per class | ✓ | ✓ |
| CIFAR-10 ( Krizhevsky et al., 2009 ) | Visual recognition | 10,000 | 10 | accuracy | ✓ | ✓ | |
| CIFAR-100 ( Krizhevsky et al., 2009 ) | Visual recognition | 10,000 | 100 | accuracy | ✓ | ✓ | |
| CLEVR Counts ( Johnson et al., 2017 ; Zhai et al., 2019 ) | Counting | 15,000 | 8 | accuracy | ✓ | ||
| CLEVR Distance ( Johnson et al., 2017 ; Zhai et al., 2019 ) | Distance prediction | 15,000 | 6 | accuracy | ✓ | ||
| Country211 ( Radford et al., 2021 ; Thomee et al., 2016 ) | Geolocation | 21,100 | 211 | accuracy | ✓ | ✓ |
| Group | Datasets |
|---|---|
| ImageNet | ImageNet-1k |
| ImageNet Shifts | ImageNet Sketch, ImageNet v2, ImageNet-A, ImageNet-O, ImageNet-R |
| Fine-grained | Stanford Cars, Country211, FGVC Aircraft, Food-101, DTD, |
| Flowers-102, Oxford-IIIT Pets, RESISC45, Diabetic Retinopathy, PatchCamelyon | |
| Retrieval | Flickr30k, MSCOCO |
| Seed | Base–Tiny (%) | Base–Giant (%) | (pp; Tiny Giant) |
|---|---|---|---|
| Mean | |||
| SD |
| Model | Functional form | # params | Adj. | LOOCV | |
|---|---|---|---|---|---|
| linear-log: total params | 2 | 0.336 | 0.312 | 0.240 | |
| linear-log: vision + text | 3 | 0.639 | 0.613 | 0.523 | |
| linear-log: vision + text + interaction | 4 | 0.724 | 0.693 | 0.543 | |
| saturating ceiling | 3 | 0.880 | 0.871 | 0.826 | |
| saturating ceiling with mismatch penalty | 4 | 0.960 | 0.956 | 0.937 |
| Architecture | Avg Performance (%) | ||
|---|---|---|---|
| Base–Giant | 0.5 | 0.5 | 37.0 |
| 0.75 | 0.5 | 38.4 | |
| 1.0 | 0.5 | 39.3 | |
| 0.5 | 0.75 | 36.8 | |
| 0.5 | 1.0 | 36.3 | |
| 0.75 | 0.75 | 38.3 |
| Avg Performance (%) | |||||
|---|---|---|---|---|---|
| Architecture | (pp) | Improved tasks ( ) | -value | ||
| Atto–Giant | 30.3 | 33.0 | +2.7 | 25/30 | <0.001 |
| Tiny–Giant | 35.2 | 37.9 | +2.7 | 27/30 | <0.001 |
| Base–Giant | 37.0 | 39.3 | +2.3 | 24/30 | 0.001 |
| Giant–Giant | 39.8 | 41.5 | +1.7 | 21/29 | 0.024 |
| MSCOCO | Flickr30k | ||||||
|---|---|---|---|---|---|---|---|
| Predictors | # params | Adj. | LOOCV | Adj. | LOOCV | ||
| Image uniformity | 2 | 0.490 | 0.476 | 0.445 | 0.524 | 0.511 | 0.482 |
| Alignment | 2 | 0.150 | 0.127 | 0.022 | 0.098 | 0.072 | -0.047 |
| Text uniformity | 2 | 0.347 | 0.328 | 0.275 | 0.435 | 0.420 | 0.381 |
| Image uniformity + alignment | 3 | 0.847 | 0.838 | 0.810 | 0.901 | 0.895 | 0.877 |
| All three | 4 | 0.848 | 0.835 | 0.794 | 0.901 | 0.893 | 0.867 |
Vision-Language Models
Vision-language models connect visual inputs with text for retrieval, question answering, generation, and grounded multimodal reasoning.
See all 736 papers