Distillation temperature: Soft target and gradient scale
Knowledge distillation is not only a new label for the highest categories of teachers, but also a soft distribution of teachers to monitor students.
Learning objectives and first steps2 objectives 2 first fixes
Try to do it after reading
- Compute thermostatic teacher distribution
- Explain the relationship between temperature and weight of loss
Suggested first
- Vector and Matrix Operations
- Counts and chain rules
Let teachers provide relative information between categories
Knowledge distillation is not only a new label for the highest categories of teachers, but also a soft distribution of teachers to monitor students. Temperature T works on logits and divides them by T before being regularized. Higher temperatures give more quality to non-highest categories, but “softer” does not in itself guarantee that the right knowledge is provided, and teacher errors and data deviations are passed on.
Pick up the teacher logits [2,0]. T = approximately 1 probability [0.880797, 0.119203]; T = 2 = unicoded for [101] and obtained [0.731059,0.268941]. The highest categories have not changed, but the relative quality of the second category has increased. Temperatures do not directly divide the original probability by two, which would destroy the sum of the sum and would not be equal to the logit variant.
If a student also calculates the soft distribution at the same temperature, the guide for the soft cross entropy to the original student logit contains a factor of 1/T. The distribution of teachers and students varies with T, and the gradient differences are also related to specific logit. (a) For some high temperature affinities analysis and distillation formulas, by T2, for the purpose of adjusting the scale; It cannot therefore be assumed that any random temperature, any random mix of targets would require the mechanical use of exactly the same weight.
Hard label losses are monitored differently from soft label losses, which usually have a combination factor. When comparing distillation experiments, temperature, soft target sources, whether detach teachers are recorded, and authority is re-established. If teachers are inadvertently updated in the same inverted chart, the experiment is no longer a fixed teacher-directional setting.
The normal output temperature is usually used by students at the time of reasoning and the distillation temperature at the time of training does not automatically become the temperature for decision-making on-line. If probabilistic calibration is required, it should be dealt with in an independent agreement, and the softening of distillation cannot be directly called certified calibration. The size of teachers, data coverage and student capacity also limit the information that can be transmitted.
The soft targets for teachers should normally be regarded as fixed supervision to avoid students losing their teachers in reverse. In the case of joint training or online distillation, the objectives of both parties must be defined separately and the rules must be updated, and the interpretations of the fixed teachers cannot be followed. A minimum example of error is to fix two groups of teachers logits, confirming that the temperature changes soft distribution, that the teacher parameters remain intact and that the student gradient is limited.
Why can't [0.88,0.12] be separated directly from T as a soft target?
Temperature is defined on logits and the probability divided by T is neither properly normalized nor in accordance with the change in the index value.
Does the higher T mean the better for the students?
No, excessiveness tends to be even and to lose distinction, with specific results depending on teacher information, student capacity and lost weight.
Sources and reconciliations
Definitions, methods and interfaces are available.
- Distilling the Knowledge in a Neural Network
- Rethinking the Inception Architecture for Computer Vision
Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.