DeiT (Data-efficient Image Transformer) is a vision transformer architecture designed to achieve state-of-the-art image classification performance using only the publicly available ImageNet-1k dataset, without the massive private datasets typically required for training transformers. Its core innovation is a distillation token and a teacher-student training strategy that uses a high-performance convolutional neural network (CNN) like RegNet as a teacher to provide soft labels, enabling the transformer-based student to learn effectively from limited data.
Glossary
DeiT (Data-efficient Image Transformer)

What is DeiT (Data-efficient Image Transformer)?
DeiT is a vision transformer model that achieves competitive image classification performance without requiring massive, proprietary datasets by using a teacher-student distillation strategy with a convolutional neural network (CNN) teacher during training.
The training procedure employs a distillation loss, specifically a hard distillation technique where the model's distillation token learns to match the teacher's hard class prediction, combined with a standard cross-entropy loss. This approach allows DeiT to match the accuracy of much larger models while being more parameter-efficient, establishing a blueprint for training performant vision transformers without extreme data scaling. It is a foundational example of applying knowledge distillation to bridge architectural paradigms.
Key Features and Innovations
DeiT (Data-efficient Image Transformer) introduced several key innovations that enabled Vision Transformers (ViTs) to achieve state-of-the-art image classification performance without relying on massive, proprietary datasets like JFT-300M.
Distillation Token
DeiT introduces a learnable [class] distillation token that flows through the transformer encoder alongside the patch tokens and the standard class token. This token's purpose is to specifically aggregate the information needed to match the teacher's predictions. The model is trained with a combined loss function:
- A cross-entropy loss between the class token's output and the ground-truth label.
- A Kullback-Leibler (KL) divergence loss between the distillation token's output and the softened predictions from the CNN teacher. This dual-token architecture cleanly separates the two learning objectives.
Hard Label Distillation
DeiT employs a specific form of distillation called hard-label distillation. While it uses the teacher's soft predictions (with temperature scaling) to compute the KL divergence loss, the final training objective treats the teacher's predicted class as a true label. This means the student learns to match both the ground truth and the teacher's top-1 prediction. This method proved more effective for ViTs than traditional soft distillation, providing a strong, direct learning signal that complements the standard cross-entropy loss.
Data Efficiency & No JFT Pre-training
Prior to DeiT, high-performing Vision Transformers required pre-training on enormous, often private datasets like JFT-300M (300 million images). DeiT's distillation strategy eliminated this dependency. By learning from a CNN teacher pre-trained on ImageNet-1k (1.2 million images), the DeiT model achieved competitive top-1 accuracy (e.g., 83.1% for DeiT-Base) using only the publicly available ImageNet data. This democratized high-performance vision transformer research and deployment.
Strong Augmentation & Regularization
DeiT's training recipe heavily utilizes aggressive data augmentation and regularization strategies to prevent overfitting on the mid-sized ImageNet dataset, which is critical when training a high-capacity transformer. Key techniques include:
- RandAugment and MixUp for data augmentation.
- CutMix for combining images.
- Random Erasing.
- Stochastic Depth (DropPath) and Repeated Augmentation. This robust training schedule is as crucial to DeiT's success as the distillation mechanism itself.
Architectural Simplicity (ViT-Base)
DeiT demonstrated that a standard Vision Transformer (ViT) architecture, without convolutional stems or hierarchical designs, was sufficient for top-tier image classification when trained properly. The flagship DeiT-Base model uses the same configuration as ViT-Base:
- Patch size: 16x16 pixels.
- Hidden size: 768.
- Transformer layers: 12.
- Attention heads: 12.
- Parameters: 86 million. This proved the viability of the pure transformer paradigm for vision, provided an effective training strategy like distillation is used.
DeiT vs. Original Vision Transformer (ViT)
A technical comparison of the Data-efficient Image Transformer (DeiT) and the original Vision Transformer (ViT), highlighting the key innovations that enable DeiT to train effectively on the ImageNet-1k dataset without massive proprietary data.
| Feature / Component | Original Vision Transformer (ViT) | Data-efficient Image Transformer (DeiT) |
|---|---|---|
Primary Training Objective | Supervised learning with hard labels (cross-entropy loss). | Distillation token with a combined loss: hard label cross-entropy + distillation loss (KL divergence) from a CNN teacher. |
Teacher Model | Pre-trained RegNetY-16GF (a convolutional neural network). | |
Distillation Strategy | Not applicable; no distillation used. | Hard distillation: The student's distillation token is trained to match the teacher's hard class prediction (argmax). |
Dataset Requirement | Massive dataset (JFT-300M, 300M images) for pre-training. | ImageNet-1k (1.28M images) only; no external pre-training data required. |
Training Efficiency | Extremely data-hungry; requires large-scale pre-training. | Data-efficient; achieves competitive accuracy with standard academic-scale datasets. |
Class Token | One learnable [class] token for final classification. | Two learnable tokens: one [class] token and one [distillation] token. |
Inference Mode | Uses the [class] token output for prediction. | Averages the predictions from the [class] and [distillation] token outputs. |
Key Innovation | Proved pure transformer architecture could achieve SOTA on vision tasks. | Introduced a distillation token and CNN teacher strategy to overcome the transformer's data hunger. |
Frequently Asked Questions
DeiT (Data-efficient Image Transformer) is a vision transformer model that achieves competitive performance without massive datasets by using a novel distillation strategy during training.
DeiT (Data-efficient Image Transformer) is a vision transformer architecture designed to achieve state-of-the-art image classification performance using only the publicly available ImageNet-1k dataset, without the massive proprietary datasets typically required for training vision transformers. Its core innovation is a teacher-student distillation strategy where a convolutional neural network (CNN) teacher, like a RegNet, provides soft labels during training. The transformer student model learns by minimizing a combined loss function: a standard cross-entropy loss with the true labels and a distillation loss (typically Kullback-Leibler divergence) that aligns its predictions with the softened outputs of the CNN teacher. This allows the transformer to learn effective representations efficiently from a limited data budget.
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 core innovation is its distillation strategy. These related concepts define the techniques and components used to transfer knowledge from a large model to a smaller, more efficient one.
Knowledge Distillation (KD)
Knowledge Distillation (KD) is the overarching model compression technique where a compact student model is trained to replicate the behavior of a larger, pre-trained teacher model. The student learns not just from hard ground-truth labels but from the teacher's softened output probabilities, which contain dark knowledge about inter-class relationships. This process enables the creation of models that are faster and require less memory while preserving much of the teacher's accuracy.
- Core Mechanism: Uses a distillation loss (e.g., KL Divergence) to align the student's predictions with the teacher's soft targets.
- DeiT Context: DeiT employs a convolutional neural network (CNN) as a teacher model to distill visual inductive biases into the Vision Transformer student.
Teacher Model
A teacher model is a large, high-accuracy, and typically pre-trained neural network whose knowledge is transferred to a smaller student during distillation. In feature-based distillation, the student may learn from the teacher's intermediate attention maps or feature representations. The teacher's role is to provide a rich, informative training signal beyond simple dataset labels.
- DeiT's Choice: DeiT famously uses a RegNetY-16GF CNN as its teacher, proving that a strong CNN can provide effective supervisory signals to a transformer student, eliminating the need for massive, proprietary image datasets like JFT-300M.
- Output: The teacher provides soft targets via temperature-scaled logits.
Hard Label vs. Soft Target
This distinction is fundamental to distillation's effectiveness.
- Hard Label: A one-hot encoded vector (e.g.,
[0, 0, 1, 0]) representing the single, ground-truth class from the dataset. It contains no information about similarity between classes. - Soft Target: A probability distribution (e.g.,
[0.05, 0.15, 0.75, 0.05]) produced by applying a softmax function (with temperature scaling) to the teacher model's logits. It reveals the teacher's "certainty" and relational understanding—for instance, that a "tabby cat" is somewhat similar to a "lynx" but very different from a "truck." This dark knowledge is what the student model learns to mimic.
Distillation Loss (KD Loss)
The distillation loss is the objective function that trains the student to mimic the teacher. It is typically a weighted combination of two components:
- Standard Cross-Entropy Loss: Computed between the student's predictions and the ground-truth hard labels. This ensures basic task correctness.
- Mimicry Loss: Measures the discrepancy between the student's and teacher's soft targets. The most common mimicry loss is the Kullback-Leibler Divergence (KL Divergence) Loss, which quantifies how one probability distribution differs from another.
- DeiT's Formula:
L_global = (1 - λ) * L_CE(student, hard_label) + λ * τ² * L_KL(student_soft, teacher_soft)whereλbalances the two losses andτis the temperature parameter.
Attention Transfer
Attention Transfer is a feature-based distillation method where the student is trained to replicate the attention maps generated by the teacher model's intermediate layers. In Vision Transformers, these maps indicate which spatial regions of an image the model deems most important for making a prediction. By forcing the student to adopt similar attention patterns, it learns the teacher's spatial reasoning and focus.
- Mechanism: A loss function (e.g., Mean Squared Error) minimizes the distance between teacher and student attention maps.
- Relation to DeiT: While DeiT's primary distillation uses output logits, subsequent vision transformer distillation research often incorporates attention transfer to improve student performance further, capturing intermediate representational knowledge.
Data-Free Distillation
Data-Free Distillation is a technique to train a student model using only a pre-trained teacher model, without access to the original training data. This is critical for privacy, licensing, or when the original dataset is unavailable. The method typically involves generating synthetic samples that effectively "probe" the teacher's knowledge.
- Common Approaches:
- Using Batch Normalization statistics stored in the teacher to generate representative inputs.
- Adversarial generation where a generator creates samples that maximize the student's mimicry loss.
- Contrast with DeiT: DeiT relies on the ImageNet dataset for its distillation. Data-free methods represent a more extreme and challenging scenario for knowledge transfer, highlighting the value of the data-efficient, but not data-free, approach used in DeiT.

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