The Data-efficient Image Transformer (DeiT) is a Vision Transformer architecture and training recipe that achieves high accuracy on ImageNet-1k without external data by using knowledge distillation from a convolutional teacher network. Unlike the original ViT, which required pre-training on JFT-300M, DeiT introduces a novel distillation token that interacts with class and patch tokens through self-attention, allowing the student transformer to learn from a strong teacher's output directly during training.
Glossary
Data-efficient Image Transformer (DeiT)

What is Data-efficient Image Transformer (DeiT)?
A training methodology that enables Vision Transformers to achieve competitive performance on mid-sized datasets without requiring massive pre-training corpora.
DeiT employs hard-label distillation, where the teacher model's hard prediction serves as the target, alongside standard cross-entropy loss with ground-truth labels. This approach, combined with extensive data augmentation and regularization techniques like RandAugment and stochastic depth, enables the transformer to learn convolutional inductive biases implicitly. The resulting model demonstrates that transformers can be trained efficiently on smaller, widely available datasets, making them accessible for domains like medical imaging where large-scale pre-training data is scarce.
Key Features of DeiT
The Data-efficient Image Transformer (DeiT) introduces a training recipe that enables Vision Transformers to achieve competitive performance on mid-sized datasets like ImageNet-1k without requiring massive pre-training corpora. Its core innovation is a knowledge distillation strategy using a convolutional teacher network.
Teacher-Student Distillation
DeiT employs a hard-label distillation approach where a convolutional neural network (typically a RegNet or ConvNet) acts as a teacher. The student ViT is trained with a combined loss: the standard cross-entropy loss with ground-truth labels and a distillation loss that matches the teacher's hard predictions. This transfers the inductive biases of convolutions—locality and translation equivariance—directly into the Transformer, compensating for the lack of these priors in self-attention.
- Distillation token: A dedicated learnable token is added to the input sequence alongside the class token
- The distillation token interacts with the teacher's output, while the class token interacts with the ground truth
- At inference, both tokens can be averaged for a performance boost
Strong Data Augmentation Pipeline
DeiT relies heavily on aggressive data augmentation and regularization to prevent overfitting on smaller datasets. The recipe combines multiple techniques that are critical for ViT convergence without large-scale pre-training:
- Rand-Augment: A learned augmentation policy that randomly applies transformations like rotation, shear, and color jittering
- Mixup and CutMix: Input-level mixing strategies that blend two images and their labels, forcing the model to learn smoother decision boundaries
- Repeated Augmentation: Each image is transformed multiple times within a batch, increasing effective diversity
- Stochastic Depth: Randomly drops entire Transformer blocks during training with a linearly increasing survival probability
Optimization and Regularization Recipe
The DeiT training protocol specifies a precise optimization configuration that stabilizes Transformer training on ImageNet-scale data:
- AdamW optimizer with a cosine learning rate decay schedule and linear warmup
- Weight decay applied only to weights, not biases or layer normalization parameters
- Label smoothing with a factor of 0.1 to prevent overconfidence
- Gradient clipping at a maximum norm of 1.0 to prevent exploding gradients
- Training for 300 epochs with a batch size of 1024, significantly longer than typical CNN schedules
Architecture Variants and Scaling
DeiT provides a family of models at different capacity points, all using the same training recipe. The base architecture mirrors the standard ViT design with 12 Transformer encoder layers, 12 attention heads, and an embedding dimension of 768 for the base variant.
- DeiT-Tiny: 5M parameters, 72% ImageNet top-1 accuracy
- DeiT-Small: 22M parameters, 79.8% top-1 accuracy
- DeiT-Base: 86M parameters, 81.8% top-1 accuracy
- DeiT-Base distilled: 86M parameters, 83.4% top-1 accuracy when using the distillation token
All variants use a patch size of 16×16 pixels and process 224×224 input images.
Distillation Token vs. Class Token
A key architectural innovation in DeiT is the introduction of a distillation token that is processed in parallel with the standard class token. This design choice has important implications:
- The distillation token learns to reproduce the teacher's hard label prediction
- The class token learns from the true ground-truth label
- At inference, the outputs of both tokens can be combined via averaging, providing an ensemble-like effect from a single model
- The distillation token can be fine-tuned separately from the class token on downstream tasks
- This dual-token design enables the model to simultaneously capture both the teacher's inductive biases and the true data distribution
No External Data Requirement
Unlike the original ViT which required pre-training on JFT-300M (a proprietary dataset of 300 million images) to achieve competitive ImageNet results, DeiT trains exclusively on ImageNet-1k (1.28 million images). This democratizes Vision Transformer training by:
- Eliminating dependence on massive proprietary datasets
- Reducing total training compute by orders of magnitude
- Enabling reproducible research with publicly available data
- Making ViT architectures accessible to academic labs and smaller organizations
- Demonstrating that architectural inductive biases can be compensated by better training recipes
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Core questions about the DeiT architecture, its training methodology, and how it enables Vision Transformers to achieve competitive performance without massive pre-training datasets.
A Data-efficient Image Transformer (DeiT) is a Vision Transformer architecture variant and training recipe that achieves competitive image classification performance on mid-sized datasets like ImageNet-1k without requiring external pre-training data. DeiT works by introducing a novel distillation token into the Transformer's input sequence, which interacts with the class token through self-attention. During training, this distillation token learns to mimic the output of a strong convolutional neural network teacher model, typically a RegNet or ConvNet, via a hard-label distillation loss. This teacher-student framework injects the inductive biases of convolutions—such as locality and translation equivariance—directly into the Transformer's learning process, compensating for the lack of these biases in the standard ViT architecture. The result is a pure Transformer model that, at inference time, can operate without the teacher and achieves accuracy comparable to state-of-the-art convolutional networks while requiring significantly less data than the original ViT, which relied on pre-training on the massive, proprietary JFT-300M dataset.
Related Terms
Key concepts and architectural components that interact with or enable the Data-efficient Image Transformer (DeiT) training paradigm.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us