Soft targets are the probability distributions produced by a teacher model after applying temperature scaling to its logits. Unlike hard targets (one-hot encoded labels), which only indicate the correct class, these softened probabilities reveal the teacher's relative confidence across all classes, encapsulating dark knowledge about class similarities and decision boundaries. This richer supervisory signal allows a student model to learn a more nuanced and generalizable representation.
Glossary
Soft Targets

What are Soft Targets?
In knowledge distillation, soft targets are the probability distributions output by a teacher model, which provide a richer training signal than simple one-hot labels.
The primary use of soft targets is in knowledge distillation for retention within continual learning systems. Here, the current model's predictions on data from previous tasks serve as soft targets, creating a distillation loss (e.g., KL Divergence) that regularizes training on new data. This technique, as seen in algorithms like Learning without Forgetting (LwF), is a core method for mitigating catastrophic forgetting by preserving the plasticity-stability trade-off.
Key Characteristics of Soft Targets
Soft targets are the probability distributions output by a teacher model after temperature scaling. Unlike hard labels, they provide a richer, more nuanced training signal for a student model.
Probabilistic vs. Deterministic
A hard target is a one-hot encoded vector (e.g., [0, 0, 1, 0]) assigning all probability to a single class. A soft target is a probability distribution (e.g., [0.05, 0.15, 0.70, 0.10]) across all classes. This distribution encodes the teacher's relative confidence and class similarities, known as dark knowledge. For instance, an image of a 'husky' might yield high probability for 'dog' but also small, non-zero probabilities for related classes like 'wolf' or 'malamute', which a one-hot label would discard.
Temperature Scaling (τ)
Temperature scaling is the core operation that generates soft targets. A temperature parameter (τ) is applied to the teacher's logits (pre-softmax activations) within the softmax function:
softmax(z_i, τ) = exp(z_i / τ) / Σ_j exp(z_j / τ)
- τ = 1: Standard softmax, producing the model's native confidence distribution.
- τ > 1: 'Softens' the distribution, increasing the entropy and making probabilities more uniform. This amplifies the relative differences between non-true classes, making the dark knowledge more accessible for the student to learn from.
- τ → ∞: All classes approach uniform probability (1/N).
- τ < 1: Sharpens the distribution, making it more peaky, approaching a one-hot encoding.
Information-Theoretic Richness
Soft targets provide a denser training signal by preserving inter-class relationships and the teacher's uncertainty. This richness offers several benefits:
- Regularization: The smoother label distribution acts as a regularizer, preventing the student from overfitting to potentially noisy hard labels.
- Gradient Variance Reduction: Provides more stable, lower-variance gradients compared to the sparse, high-variance signal from hard targets.
- Transfer of Generalization: The student learns the teacher's internal representation of similarity between concepts, often leading to better generalization on unseen data than training on hard labels alone.
Loss Function: KL Divergence
Training a student model with soft targets typically uses the Kullback-Leibler (KL) Divergence loss, which measures how one probability distribution diverges from a second, reference distribution. The student's softened outputs (using the same τ as the teacher) are matched to the teacher's soft targets.
L_KD = τ^2 * KL( P_teacher(τ) || P_student(τ) )
The τ^2 term is used to ensure the magnitude of the gradient remains roughly constant when changing the temperature. This is often combined with a standard cross-entropy loss with true hard labels in a weighted sum: L_total = α * L_CE + β * L_KD.
Role in Mitigating Catastrophic Forgetting
In continual learning, soft targets are a key tool for knowledge retention. When learning a new task (Task B), the model's predictions on data from the old task (Task A) are used as soft targets. By applying a distillation loss between the current model's outputs on old data and its past outputs (or a saved copy of the old model's outputs), the model is penalized for changing its behavior on previous tasks. This technique, central to algorithms like Learning without Forgetting (LwF), helps anchor the model's parameters to preserve old knowledge while adapting to new data.
Contrast with Logits and Features
Soft targets are one form of knowledge transferred from teacher to student. Other forms include:
- Logit Distillation: Directly matching the teacher's logits (pre-softmax activations), often using Mean Squared Error loss. This is closely related to soft target distillation but operates on the unscaled logits.
- Feature/Activation Distillation: Matching intermediate representations (e.g., hidden states or feature maps from convolutional layers). Techniques like FitNets use this to guide the student's internal layers.
- Attention Distillation: Matching the attention maps of transformer-based models.
Soft target distillation is often the most straightforward and effective method for transferring the teacher's final predictive knowledge.
How Soft Targets Work in Knowledge Distillation
Soft targets are the probability distributions output by a teacher model after temperature scaling, which contain relative class similarities and serve as a richer training signal than hard, one-hot encoded labels for the student model.
A soft target is the softened probability distribution output by a teacher model after applying temperature scaling to its logits. Unlike a hard, one-hot label that only indicates the correct class, this distribution encodes the teacher's relative confidence across all classes, including its understanding of inter-class similarities—a concept known as dark knowledge. This richer supervisory signal allows a student model to learn a more nuanced and generalizable decision boundary.
During training, the student model is optimized to match these soft targets, typically using a Kullback-Leibler (KL) Divergence loss. This process, central to logit distillation, transfers not just the teacher's final predictions but its implicit knowledge of data relationships. In continual learning, a model can generate soft targets for past tasks to serve as a regularization signal, a technique used in algorithms like Learning without Forgetting (LwF) to mitigate catastrophic forgetting.
Soft Targets vs. Hard Targets
A comparison of the two primary supervisory signal types used when training a student model in the teacher-student framework.
| Feature | Soft Targets | Hard Targets |
|---|---|---|
Definition | The probability distribution output by a teacher model after temperature scaling (T > 1). | One-hot encoded vectors where the true class is 1 and all others are 0. |
Information Content | Rich, containing relative class similarities and 'dark knowledge'. | Sparse, containing only the identity of the single correct class. |
Primary Use Case | Knowledge distillation for model compression and continual learning. | Standard supervised training of classification models. |
Training Signal | Provides a smoother, more informative gradient by indicating 'this is somewhat like that'. | Provides a sharp, high-variance gradient focused solely on the correct class. |
Effect on Generalization | Typically improves student model generalization and robustness by transferring the teacher's internal representations. | Can lead to overconfidence and poorer calibration if not regularized. |
Loss Function | Kullback-Leibler (KL) Divergence between softened teacher and student distributions. | Cross-Entropy between student predictions and the one-hot label. |
Label Smoothing Relation | Inherently performs a form of adaptive, learned label smoothing. | Often combined with static label smoothing (e.g., epsilon=0.1) as a regularization technique. |
Role in Forgetting Mitigation | Core to distillation-based methods (e.g., LwF); the old model's soft predictions on new data act as targets to preserve knowledge. | Not directly applicable; replaying hard labels from old data is the primary method. |
Frequently Asked Questions
Soft targets are a core concept in knowledge distillation, providing a richer training signal than traditional labels. These FAQs address their technical definition, application, and role in modern machine learning systems.
Soft targets are the probability distributions output by a teacher model after applying temperature scaling to its logits, which contain relative class similarities and serve as a richer, more informative training signal than hard, one-hot encoded labels for a student model.
Unlike a hard target (e.g., [0, 0, 1, 0] for class 3), a soft target looks like [0.05, 0.1, 0.7, 0.15]. This distribution encodes the teacher's dark knowledge—its understanding of which incorrect classes are more or less similar to the correct one. For instance, in image classification, a model classifying a 'Siamese cat' might assign higher probabilities to 'Tabby cat' and 'Egyptian Mau' than to 'truck,' information lost in a one-hot label. The student model is trained using a loss function like Kullback-Leibler (KL) Divergence to match this softened distribution, leading to better generalization and often higher accuracy than training on 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
Soft targets are a core component of knowledge distillation. These related concepts define the broader framework and techniques for transferring and preserving model knowledge.
Knowledge Distillation
Knowledge distillation is a model compression and transfer learning technique where a smaller, more efficient student model is trained to mimic the behavior of a larger, more complex teacher model. The student learns not from hard labels but from the teacher's softened output probabilities (soft targets) or intermediate feature representations, capturing the teacher's "dark knowledge." This process enables the creation of models that are faster, smaller, and more suitable for deployment while retaining much of the original model's performance.
Dark Knowledge
Dark knowledge refers to the rich, non-obvious information contained within the softened probability distribution (logits) of a trained neural network. Unlike a one-hot label that only indicates the correct class, a softened distribution reveals the teacher model's relative confidence across all classes—for example, that a picture of a car is more similar to a truck than to a cat. This relative similarity information between classes is the key training signal transferred via soft targets, providing a more informative gradient for the student model than hard labels alone.
Temperature Scaling
Temperature scaling is the technique used to generate soft targets. A temperature parameter (T) is applied to the softmax function of the teacher model's logits: softmax(logits / T).
- When T = 1, it's the standard softmax.
- When T > 1, the probability distribution is softened, making all classes more uniformly probable and amplifying the dark knowledge in the smaller probabilities.
- This softened distribution is what the student model learns to match, typically using a KL Divergence loss. After training, the student uses a standard softmax (T=1) for inference.
Catastrophic Forgetting
Catastrophic forgetting (or catastrophic interference) is the tendency of a neural network to abruptly and drastically lose performance on previously learned tasks when trained on new data. This is the core problem that techniques using soft targets aim to solve in continual learning. When a model learns Task B, the weights optimized for Task A are overwritten, erasing the old knowledge. Methods like Learning without Forgetting (LwF) use the model's own soft targets from previous tasks as a regularization signal to anchor the parameters, preventing drastic drift and preserving stability.
Learning without Forgetting (LwF)
Learning without Forgetting is a seminal continual learning algorithm that directly employs knowledge distillation to mitigate catastrophic forgetting. When learning a new task:
- The model's predictions on new task data are recorded.
- The model's predictions on data from the old task(s) are recorded before updating weights. These act as soft targets.
- The total loss is a combination of standard cross-entropy loss for the new task and a distillation loss (e.g., KL Divergence) that penalizes the model for changing its outputs on the old tasks. This allows the model to integrate new knowledge while consolidating old knowledge without needing to store raw past data.
Teacher-Student Framework
The teacher-student framework is the foundational architecture for knowledge distillation. It defines the roles of two models:
- The Teacher: A large, accurate, often pre-trained model (e.g., BERT, ResNet-50) that provides supervisory signals.
- The Student: A smaller, more efficient model (e.g., DistilBERT, MobileNet) that learns from the teacher. The framework specifies what knowledge is transferred (logits, features, attention) and how (the loss function). In continual learning, a single model can act as its own teacher from a previous time step, creating a self-distillation loop to preserve knowledge.

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