Temperature controls the softness of the probabilities in the output distribution, affecting the smoothness of the knowledge transferred from teacher to student.