techlist.io
OpenAI2020-06-164 min read

Curated summary

Image GPT

Read original(opens in new tab)

Image GPT shows that a transformer trained on pixel sequences, using the same architecture as GPT-2 for language, can generate coherent image completions and samples without any human-labeled data. The authors show that generative quality tracks feature quality, and their best model's features compete with top unsupervised convolutional networks on classification benchmarks. The approach needs far more compute than contrastive methods, so the authors frame it as a proof of concept for domain-agnostic learning rather than a practical vision method.

Motivation: Bridging the Gap Between Language and Vision

  • Transformers such as BERT, GPT-2, RoBERTa, and T5 have set top results across language tasks, but the same class of models has not produced strong image classification features.
  • Language tasks naturally appear inside text (questions followed by answers, passages followed by summaries), while pixel sequences carry no explicit labels.
  • The authors rely on the "Analysis by Synthesis" idea: a model that learns to generate realistic images should also learn object categories.

Image GPT (iGPT) Architecture and Training

  • The authors use the GPT-2 transformer unchanged, feeding it images unrolled into pixel sequences, and deliberately avoid image-specific components such as convolutions, relative or sparse attention, and 2-D position embeddings.
  • Three model sizes were trained on ImageNet: iGPT-S (76M parameters), iGPT-M (455M), and iGPT-L (1.4B). A 6.8B-parameter iGPT-XL was trained on ImageNet plus web images.
  • Training used low resolutions (32x32, 48x48, 64x64) because dense attention over long sequences is expensive.
  • A custom 9-bit color palette shortens the input sequence to one-third the length of a standard RGB encoding while preserving color.

Evaluation Methods and Feature Behavior

  • Linear probe: features are extracted from a frozen model, average-pooled over the sequence, and fed to logistic regression.
  • Full fine-tune: the entire model is trained on the downstream dataset.
  • Feature quality rises and then falls slightly with depth. The authors read this as two phases: early layers build contextual image features, and later layers serve next-pixel prediction. This resembles a bottleneck autoencoder.
  • Larger models and longer training improve generative quality, which in turn improves feature quality.

Results

  • Linear probes: iGPT-L (32x32) reaches 96.3% on CIFAR-10, 82.8% on CIFAR-100, and 95.5% on STL-10, beating the best listed supervised and unsupervised transfer methods on those datasets.
  • ImageNet linear probe: iGPT-L at 48x48 reaches 65.2% top-1, above AlexNet. Concatenating features from five layers of iGPT-XL reaches 72.0%, ahead of AMDIM, MoCo, and CPC v2 but behind SimCLR's 76.5%.
  • Full fine-tune: iGPT-L matches GPipe at 99.0% on CIFAR-10 and scores 66.3% on ImageNet at 32x32.
  • BERT-style masked pixel training: linear probe accuracy is notably worse, but fine-tuning results are strong.
  • Semi-supervised CIFAR-10: a logistic regression on iGPT-L features, with no augmentation or fine-tuning, beats Mean Teacher and MixMatch but trails FixMatch.

Limitations

  • Compute cost is very high. iGPT-L took roughly 2,500 V100-days, while a similarly performing MoCo model needs about 70 V100-days.
  • Transformers on low-resolution pixels lack the easy high-resolution scaling of convolutional encoders, so a new architecture may be needed.
  • Generative models can absorb dataset biases. The authors give the example of a "scientist" concept skewed toward men.

Conclusion

The authors argue that trading hand-coded 2-D image knowledge for scale, and taking features from middle layers, lets a plain sequence transformer compete with convolutional networks in unsupervised image classification. Given enough compute, they suggest, this simple and general approach could learn strong features in many domains. The paper positions the work as proof of concept, since the compute and resource costs keep it from practical vision applications today.

Continue with another curated summary.