r/MachineLearning • • 16d ago

Discussion Why are ViTs so popular? Because Large-Scale Pretraining Trumps Inductive Biases. [D]

To begin, we note that SOTA performance on CIFAR-10 is a ViT. It is the pretrained ViT described in the paper quoted below.

When trained on mid-sized datasets such as ImageNet without strong regularization, these models yield modest accuracies of a few percentage points below ResNets of comparable size. This seemingly discouraging outcome may be expected: Transformers lack some of the inductive biases inherent to CNNs, such as translation equivariance and locality, and therefore do not generalize well when trained on insufficient amounts of data.

.

However, the picture changes if the models are pre-trained on larger datasets (14M-300M images). ☝️We find that large scale training trumps inductive bias. Our Vision Transformer (ViT) attains excellent results when pre-trained at sufficient scale and transferred to tasks with fewer datapoints. When pre-trained on the public ImageNet-21k dataset or the in-house JFT-300M dataset, ViT approaches or beats state of the art on multiple image recognition benchmarks. In particular, the best model reaches the accuracy of 88.55% on ImageNet, 90.72% on ImageNet-ReaL, 94.55% on CIFAR-100, and 77.63% on the VTAB suite of 19 tasks

The paper above has been cited in the literature no less than 113 thousand times.


"AN IMAGE IS WORTH 16X16 WORDS: TRANSFORMERS FOR IMAGE RECOGNITION AT SCALE"

  • Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, Neil Houlsby.
  • Google Research; Brain Team; arXiv:2010.11929v2 [cs.CV] 3 Jun 2021

Images are broken into patches , such that patches are treated as "tokens" for a transformer to perform self-supervised prediction, and then regenerate the masked patches. The process is described intimately in "Masked Autoencoders Are Scalable Vision Learners". (Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li Piotr Dollar, Ross Girshick). Facebook AI Research. arXiv:2111.06377v3 [cs.CV] 19 Dec 2021.

This self-supervised token-izing methodology is substantively worse than traditional CNNs, or CNNS w/ attention. But at scale, the reverse is true.

ping /u/terrrp

0 Upvotes

5 comments sorted by

2

u/parlancex 16d ago

Wow... so if you have way more data than you should reasonably need and you're willing waste a lot of money in "large scale" pretraining you can approach SoTA. Did you even bother to test a CNN / ResNet / hybrid against the same data and compute budget?

If method A needs more data to achieve the same results as method B it is by definition less able to generalize, and therefore less intelligent.

2

u/moschles 15d ago

One wonders why the ResNet and CONVnets which were used as baselines were not also pre-trained. It seems like that would be a fair comparison.

1

u/dl827634 9d ago

To isolate architecture, pretrain the CNNs too with matched data, objective, compute, and fine-tuning. Otherwise the result confounds architecture with the training recipe.

2

u/PeterIanStaker 16d ago

I mean, it’s a different, less proscriptive inductive bias, right? It’s not like the SOTA is a giant MLP.