DeiT (Data-efficient Image Transformer) is a vision transformer model that achieves competitive accuracy without massive pre-training datasets by integrating a native distillation token and a teacher-student training strategy directly into its transformer architecture. Unlike standard Vision Transformers (ViTs) that rely on hundreds of millions of JFT-300M images, DeiT is trained efficiently on ImageNet-1k alone. Its key innovation is a distillation token that flows through the transformer blocks alongside the class and patch tokens, learning to replicate the output of a convolutional neural network (CNN) teacher model through a distillation loss.
Glossary
DeiT (Data-efficient Image Transformer)

What is DeiT (Data-efficient Image Transformer)?
DeiT is a vision transformer architecture designed to achieve state-of-the-art image classification performance using only the ImageNet-1k dataset, eliminating the dependency on massive, privately curated datasets required by earlier ViT models.
The training employs hard-label distillation, where the DeiT student model learns to match the predicted class label of a strong CNN teacher (like RegNetY) in addition to the true image labels. This distillation-aware design allows the transformer to inherit inductive biases and data-efficient learning capabilities from CNNs. The result is a high-performance ViT that is practical to train and serves as a foundational model for subsequent research into efficient transformers and on-device model compression via distillation.
Key Features and Innovations
DeiT (Data-efficient Image Transformer) introduced several architectural and training innovations to enable Vision Transformers to achieve competitive performance without the massive datasets required by their predecessors.
Native Distillation Token
DeiT's most significant innovation is the introduction of a dedicated distillation token. This is a learnable vector prepended to the input sequence alongside the standard class token and patch tokens. During training, it interacts with other tokens via self-attention and is trained via a distillation loss to mimic the output of a pre-trained teacher model (e.g., a CNN like RegNet). This allows the transformer to directly learn from the teacher's predictions as an additional supervisory signal, effectively combining hard labels with soft targets.
Teacher-Student Strategy
DeiT employs a hard-label distillation strategy. Unlike traditional knowledge distillation that uses softened output probabilities (soft targets), DeiT's student model is trained to match the teacher's predicted hard label (the argmax class). The total loss is a weighted sum:
- Cross-Entropy Loss with ground-truth labels.
- Distillation Loss (also cross-entropy) with the teacher's hard labels. This approach simplifies the training pipeline and proves highly effective, allowing the transformer student to learn inductive biases from a CNN teacher trained on the same dataset.
Training Efficiency & Data Regime
DeiT was designed for data efficiency. It demonstrates that Vision Transformers can be trained effectively on a single node with 4 GPUs in just 3 days using only the ImageNet-1k dataset (1.3 million images). This was a breakthrough, as prior Vision Transformers (ViT) required large-scale pre-training on private datasets like JFT-300M (300 million images). DeiT achieves this through its distillation framework and strong data augmentation (RandAugment, MixUp, CutMix, Random Erasing) and regularization strategies.
Architecture & Optimization
DeiT uses a standard Transformer encoder architecture. Key optimizations include:
- Relative Position Embeddings: Instead of absolute 1D position embeddings, DeiT uses learned relative position biases added to attention scores, which improves generalization to higher-resolution images at inference.
- Optimizer & Scheduling: Trained with AdamW optimizer and a cosine learning rate decay schedule.
- Stochastic Depth: Employs stochastic depth (drop layers) for regularization, with a higher drop rate for deeper layers.
- No Convolutions: The architecture remains purely based on self-attention, with no convolutional inductive biases built into the model itself.
DeiT Variants & Performance
The paper introduced three main variants, balancing model size and accuracy:
- DeiT-Ti (Tiny): 5M parameters, 72.2% top-1 accuracy on ImageNet.
- DeiT-S (Small): 22M parameters, 79.8% top-1 accuracy.
- DeiT-B (Base): 86M parameters, 81.8% top-1 accuracy. Crucially, DeiT-S outperformed the similarly sized ViT-B trained on ImageNet-only by over 4 percentage points, validating the distillation approach. The models also showed strong performance on transfer learning tasks.
Distinction from Standard Knowledge Distillation
DeiT's distillation differs from classic methods in important ways:
- Token vs. Output Distillation: Knowledge is transferred through a dedicated token's interactions, not just by matching final outputs.
- Hard vs. Soft Labels: Uses the teacher's hard class predictions, not softened probability distributions.
- Joint Training: The distillation signal is present from the beginning of training, not applied to a pre-trained student.
- CNN Teacher: Leverages a convolutional teacher (e.g., RegNet) to impart spatial inductive biases that are not native to the transformer architecture, effectively "teaching" it how to see.
How DeiT Works: The Distillation Mechanism
DeiT's core innovation is a native distillation mechanism that enables a Vision Transformer to learn from a convolutional teacher without requiring massive datasets.
The Data-efficient Image Transformer (DeiT) introduces a distillation token, a learnable vector prepended to the input sequence alongside the class token. During training, this token is trained via a distillation loss—typically Kullback-Leibler divergence—to match the output predictions of a pre-trained teacher model, such as a RegNet or ConvNet. This allows the transformer-based student to directly ingest the teacher's "dark knowledge," including softened class probabilities, which provides richer supervisory signals than hard labels alone.
This teacher-student framework operates in a single forward pass. The class token is supervised by the true label, while the distillation token is supervised by the teacher's output, creating a dual-objective optimization. The final prediction is an average of both heads. This native, token-based design integrates distillation seamlessly into the transformer architecture, enabling competitive ImageNet accuracy with far less data and computational pre-training than standard Vision Transformers.
DeiT vs. Vision Transformer (ViT) vs. EfficientNet
A technical comparison of three seminal vision models, highlighting their core architectural innovations, data requirements, and performance characteristics.
| Feature / Metric | DeiT (Data-efficient Image Transformer) | Vision Transformer (ViT) | EfficientNet |
|---|---|---|---|
Core Architectural Paradigm | Transformer with Native Distillation | Pure Transformer | Compound-Scaled CNN |
Primary Innovation | Distillation Token & Teacher-Student Pre-training | Patch-based Image Sequence Processing | Neural Architecture Search (NAS) & Compound Scaling |
Typical Pre-training Dataset Size | 1.3M images (ImageNet-1k) | 300M images (JFT-300M) recommended | 1.3M images (ImageNet-1k) |
Native Distillation Support | |||
Requires Massive External Dataset | |||
Key Efficiency Mechanism | Knowledge Distillation | Global Attention | Depth/Width/Resolution Scaling |
Inductive Bias | Weak (Learned via distillation) | Weak (Minimal) | Strong (Convolutional) |
Peak ImageNet-1k Top-1 Accuracy (approx.) | 83.1% (DeiT-B) | 88.55% (ViT-H/14) | 84.7% (EfficientNet-B7) |
Inference Speed (Relative) | Medium | Slow (Large models) | Fast |
Parameter Efficiency | High | Low (without large data) | Very High |
Frequently Asked Questions
DeiT (Data-efficient Image Transformer) is a vision transformer architecture designed to achieve high performance without the massive pre-training datasets typically required. It pioneered the use of a native distillation token within the transformer block.
DeiT (Data-efficient Image Transformer) is a vision transformer model that achieves competitive performance on ImageNet without requiring the massive, JFT-300M-scale datasets used by its predecessors. It works by integrating a native distillation token into the transformer architecture alongside the standard class token. During training, this distillation token is trained to match the output of a pre-trained teacher model (like a CNN), allowing the transformer to learn both from true labels and the teacher's softened predictions (soft labels) simultaneously via a distillation loss. This teacher-student training strategy enables effective knowledge transfer, making the transformer data-efficient.
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.
Related Terms
DeiT's efficiency is achieved through a specialized application of knowledge distillation. These related terms define the core techniques and concepts that enable this training paradigm.
Teacher-Student Framework
The teacher-student framework is the foundational architecture for knowledge distillation. It consists of a pre-trained, often cumbersome teacher model that provides supervisory signals to a trainable student model.
- Teacher Role: Provides softened labels (logits) or intermediate feature maps as training targets. In DeiT, this is a convolutional neural network (CNN) like RegNet.
- Student Role: The model being compressed (e.g., the Vision Transformer in DeiT) that learns to replicate the teacher's predictions.
- Training Dynamics: The student's loss function is a weighted combination of the standard cross-entropy loss with ground truth and a distillation loss (e.g., KL Divergence) that measures discrepancy from the teacher.
Distillation Token
The distillation token is a novel, learnable embedding introduced by DeiT that enables native transformer-based distillation. It is prepended to the input sequence alongside the class token.
- Function: Interacts with the image patches through self-attention and is trained specifically to reproduce the output of the teacher model.
- Architectural Innovation: Allows the Vision Transformer to distill knowledge from a CNN teacher during pre-training, without requiring a separate distillation stage or modifying the transformer's core architecture.
- Output: At the final layer, the class token predicts the true label, while the distillation token's output is used to compute the distillation loss against the teacher's prediction.
Hard Label vs. Soft Target
This distinction is central to how knowledge is transferred. A hard label is a one-hot vector (e.g., [0, 0, 1, 0]), while a soft target is a probability distribution (e.g., [0.05, 0.1, 0.8, 0.05]).
- Hard Label: Contains minimal information, only indicating the correct class.
- Soft Target: Generated by applying a softmax function to the teacher's logits. Contains dark knowledge—the relative probabilities for incorrect classes, revealing similarities (e.g., that a 'tabby cat' is more similar to a 'tiger' than to a 'truck').
- Temperature Scaling: A temperature parameter (T) is used to soften the distribution further (higher T = softer), making the relative differences between classes more pronounced and easier for the student to learn.
Distillation Loss
Distillation loss is the specialized objective function that quantifies the difference between the teacher and student models' outputs or features, guiding the student's learning.
- Primary Form: For logit distillation, it is typically the Kullback-Leibler (KL) Divergence between the softened outputs of the teacher and student.
- Combined Loss: In practice, the total loss is a weighted sum:
L_total = α * L_CE(hard_labels, student) + β * L_KL(teacher_soft_targets, student_soft_targets). - Variants: Can also be applied to intermediate features (feature distillation), attention maps (attention transfer), or relational structures between samples (relational knowledge distillation).
Online Distillation
Online distillation is a training paradigm where the teacher and student models are co-trained simultaneously from scratch, rather than using a static, pre-trained teacher.
- Contrast with DeiT: DeiT uses a static teacher (a pre-trained CNN). Online distillation methods update the teacher's weights alongside the student's during training.
- Benefits: Can be more flexible and avoid the need for a large, pre-existing teacher model. The teacher can adapt and improve as the student learns.
- Example: In Deep Mutual Learning, multiple peer student models teach each other in a collaborative, online fashion without a predefined superior teacher.

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