Soft targets are the continuous, softened probability distributions produced by a teacher model's final softmax layer, typically after applying temperature scaling. Unlike hard, one-hot labels that assign 100% probability to a single class, soft targets encode richer, inter-class similarity information known as dark knowledge. This probabilistic guidance provides a more informative training signal, allowing a smaller student model to learn not just the correct answer, but the teacher's nuanced understanding of how all potential answers relate to each other.
Glossary
Soft Targets

What are Soft Targets?
Soft targets are the probability distributions output by a teacher model, used as training labels for a student model in knowledge distillation.
The primary mechanism for generating soft targets is the temperature-scaled softmax, where a temperature parameter (T > 1) smooths the teacher's output logits. This softening amplifies the non-target class probabilities, revealing which incorrect classes the teacher considers most plausible. The student is then trained using a distillation loss, such as Kullback-Leibler divergence, to mimic this softened distribution. This transfer of relational knowledge is the core of logits distillation and is fundamental to compressing large models into efficient, high-performance smaller versions for edge deployment.
Key Characteristics of Soft Targets
Soft targets are the probability distributions output by a teacher model, containing richer information than simple one-hot labels. Their key characteristics define their utility in knowledge distillation.
Probabilistic Distributions
Unlike hard targets (one-hot encoded vectors), soft targets are continuous probability distributions over all possible classes. Each class is assigned a probability score, typically generated by applying a softmax function to the teacher model's logits. For example, an image of a 'cat' might yield probabilities like: cat: 0.85, dog: 0.12, fox: 0.03. This format is the fundamental data structure for transferring dark knowledge.
Temperature-Scaled Softening
The richness of a soft target is controlled by a temperature parameter (T) applied within the softmax function. A higher temperature (e.g., T > 1) produces a 'softer,' more uniform distribution, amplifying the small probabilities of non-target classes. This makes the inter-class relationships more pronounced and easier for the student to learn. A lower temperature (T = 1) yields a distribution closer to the original model confidence. The optimal T is a hyperparameter tuned for the specific distillation task.
Contain Dark Knowledge
The primary value of soft targets lies in the dark knowledge they encode. This refers to the implicit information about the similarity and relationships between different classes, as learned by the teacher model. For instance, a teacher trained on ImageNet knows that a 'Persian cat' is more similar to a 'Maine Coon' than to a 'school bus'. This relational information, embedded in the probability scores of non-target classes, provides a superior learning signal compared to a simple correct/incorrect label, leading to better student generalization.
Primary Distillation Signal
In the standard knowledge distillation loss function, soft targets serve as the primary supervisory signal for the student. The total loss is often a weighted sum of two components:
- Distillation Loss: Measures the discrepancy (e.g., using Kullback-Leibler Divergence) between the student's softened outputs and the teacher's soft targets.
- Hard Label Loss: The standard cross-entropy loss with the ground-truth labels. This combined objective allows the student to learn both the fine-grained class similarities from the teacher and the definitive task boundaries from the original data.
Contrast with Logits
It is crucial to distinguish soft targets from logits. Logits are the raw, unnormalized scores output by the final linear layer of a neural network. Soft targets are the normalized probability distribution derived from these logits via the (temperature-scaled) softmax. While logits distillation is a valid technique, soft targets are generally more stable for training as they are bounded between 0 and 1. The choice between distilling logits or probabilities depends on the specific distillation framework and loss function used.
Applications Beyond Classification
While foundational to classification tasks, the concept of soft targets extends to other domains:
- Sequence Generation: In sequence-level distillation, the teacher's distribution over entire output sequences (e.g., in machine translation) acts as a soft target.
- Object Detection: Teacher model's softened class probabilities and softened bounding box regressions can be distilled.
- Reinforcement Learning: The value function or policy distribution of a teacher agent can serve as a soft target for a student. This demonstrates the versatility of probabilistic supervision for compressing models across diverse AI tasks.
Soft Targets vs. Hard Targets
A comparison of the supervisory signals used to train machine learning models, highlighting the key differences in information content and training dynamics.
| Feature | Soft Targets | Hard Targets |
|---|---|---|
Definition | A probability distribution (e.g., [0.7, 0.2, 0.1]) output by a teacher model after temperature scaling. | A one-hot encoded vector (e.g., [1, 0, 0]) representing the single ground-truth class label. |
Primary Source | Pre-trained teacher model (in distillation). | Human-annotated dataset. |
Information Content | Rich, containing 'dark knowledge' about inter-class similarities and relative confidences. | Sparse, containing only the identity of the correct class. |
Training Signal | Provides a smoother, more informative gradient landscape for the student model. | Provides a sharp, high-variance gradient focused solely on the correct class. |
Typical Loss Function | Kullback-Leibler Divergence (KL-Div) or Mean Squared Error (MSE) between distributions. | Cross-Entropy Loss between the predicted and true one-hot vector. |
Role in Knowledge Distillation | The core supervisory signal transferred from teacher to student. | Often used alongside soft targets in a weighted combined loss (e.g., student also learns from true labels). |
Model Calibration | Encourages the student model to produce well-calibrated, probabilistic outputs. | Can lead to overconfident, poorly calibrated predictions (overfitting to hard labels). |
Use Case | Essential for knowledge distillation; enables efficient model compression and transfer learning. | Standard supervised learning; used for initial training of the teacher model and for final fine-tuning. |
Handling of Ambiguity | Preserves the teacher's uncertainty, which can be beneficial for noisy or borderline cases. | Ignores ambiguity; all probability mass is assigned to a single class regardless of model certainty. |
Frequently Asked Questions
Answers to common technical questions about Soft Targets, the probability distributions used in Knowledge Distillation to transfer 'dark knowledge' from a teacher model to a student model.
Soft Targets are the probability distributions output by a trained teacher model, which contain richer, inter-class similarity information—often called dark knowledge—compared to traditional hard, one-hot labels. In a classification task, a hard label for an image of a '7' would be the vector [0, 0, 0, 0, 0, 0, 1, 0, 0, 0]. A soft target, however, might be a distribution like [0.01, 0.02, 0.01, 0.02, 0.01, 0.02, 0.85, 0.02, 0.02, 0.02], where the small probabilities assigned to other digits (like '1' or '9', which can resemble '7') encode the teacher's learned understanding of visual similarity. This probabilistic supervisory signal is the fundamental medium for knowledge transfer in distillation, providing a more informative training signal that helps the student model generalize better than it could from hard labels alone.
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
Understanding Soft Targets requires familiarity with the key concepts and techniques that define the knowledge distillation process. These related terms detail the mechanisms, objectives, and frameworks involved in transferring 'dark knowledge' from a teacher to a student model.
Knowledge Distillation (KD)
Knowledge Distillation is the overarching model compression technique where a smaller student model is trained to mimic the predictive behavior of a larger, more complex teacher model. The core mechanism involves using the teacher's output—often as Soft Targets—as a richer training signal than standard one-hot labels. This process transfers not just the correct class prediction but also the teacher's learned understanding of inter-class relationships, enabling the student to achieve higher accuracy than if trained on hard labels alone.
Dark Knowledge
Dark Knowledge is the implicit, relational information encoded within a trained model's softened output distribution. It represents the model's learned understanding of similarities between different classes—for example, that a picture of a 'cat' is more similar to a 'lynx' than to an 'airplane'. This information, which is absent in one-hot labels, is the valuable signal captured in Soft Targets and transferred during knowledge distillation. The term highlights that this nuanced understanding is a hidden byproduct of training that can be explicitly leveraged to teach a more efficient model.
Temperature Scaling
Temperature Scaling is a critical technique used to generate effective Soft Targets. It involves dividing the logits (pre-softmax outputs) of the teacher model by a temperature parameter (T > 1) before applying the softmax function.
- Effect: This 'softens' the output probability distribution, increasing the weights of non-target classes and making the dark knowledge more pronounced.
- Purpose: A softened distribution provides a more informative gradient for the student model to learn from than a peaky, high-confidence distribution.
- Training: The same temperature is applied to the student's logits during distillation, and the standard temperature (T=1) is used for the final inference.
Logits Distillation
Logits Distillation is the most direct form of knowledge transfer, where the student model is trained to match the raw logits or the temperature-scaled softmax outputs of the teacher. This method directly utilizes Soft Targets as the primary supervisory signal. The training objective typically combines a distillation loss (e.g., Kullback-Leibler Divergence) between the teacher and student distributions with a standard cross-entropy loss using true labels. It forms the foundational approach from which more advanced feature- and attention-based distillation techniques have evolved.
Teacher-Student Framework
The Teacher-Student Framework is the foundational paradigm for knowledge distillation. It consists of two primary components:
- Teacher Model: A large, pre-trained, and high-performance model (often an ensemble) that provides the supervisory signals (Soft Targets, features, attention maps).
- Student Model: A smaller, more efficient architecture designed for deployment, which learns to replicate the teacher's behavior. The framework can be offline (static, pre-trained teacher) or online (teacher and student co-trained). This structure is essential for understanding the directional flow of knowledge, where Soft Targets are the most common form of transmitted information.
Kullback-Leibler Divergence Loss
Kullback-Leibler (KL) Divergence Loss is the most commonly used objective function for distilling knowledge from Soft Targets. It quantitatively measures the difference between two probability distributions—in this case, the softened output distribution of the teacher and the student.
- Function: It minimizes the information loss when using the student's distribution to approximate the teacher's.
- Application: In distillation, the loss is calculated on the temperature-scaled softmax outputs. It is often combined with a standard cross-entropy loss against the true labels to ensure the student learns both the dark knowledge and the correct hard targets.

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