DeiT (Data-efficient image Transformers) is an image classification model that keeps the ViT architecture unchanged, improves the training recipe, and adds knowledge distillation through a Transformer-specific "distillation token", matching CNN accuracy using only ImageNet (about 1.3 million images). It was published in 2020 by Touvron et al. at Facebook AI and Sorbonne University.
The ViT paper assumed pretraining on 300 million private images (JFT-300M) and concluded that Transformers "do not generalize well when trained on insufficient amounts of data". ViT-B/16 trained on ImageNet alone reached only 77.9% accuracy, falling short even of a ResNet of similar size. Handling images with Transformers was therefore thought to require huge datasets and compute.
DeiT overturned this assumption with two ideas:
- Training recipe: it combines strong data augmentation (RandAugment, Mixup, CutMix, Random Erasing, repeated augmentation) with regularization (Stochastic Depth, Label Smoothing) and trains with AdamW for 300 epochs. DeiT-B, whose architecture is identical to ViT-B, rose to 81.8%.
- Distillation token: separately from the [class] token, a "distillation token" whose target is the CNN teacher's prediction is added to the input. DeiT-B reached 83.4%, and 85.2% with longer training at higher resolution.
Training takes 2–3 days on a single machine with 8 GPUs (53 hours for DeiT-B pretraining). DeiT became the standard recipe for training image Transformers on ImageNet alone, and it underlies the training recipes of many later models (such as ConvNeXt and ResMLP).

![Architecture of DeiT. The left panel shows the overall flow of DeiT-B with distillation (the image is split into 196 patches of 16×16 and embedded, a [class] token and a distillation token are added, position embeddings are added, the sequence passes through 12 encoder layers, and the [class] output feeds the class head while the distillation-token output feeds the distillation head). The right panel shows training (a loss that uses the CNN teacher's prediction y_t as the target of the distillation head) and inference (adding the softmax outputs of the two heads)](/note/images/articles/architectures/deit.en.png)