This application relates to a method, apparatus,
computer device, storage medium, and
computer program product for training a knowledge
distillation model. The method includes: adding a first weight matrix and a second weight matrix to the
linear layer of the student model to be trained, based on the original weight matrix of the
linear layer; obtaining a first predicted
label for sample data using a teacher model, and obtaining a second predicted
label for the sample data using the student model to be trained; the sample data carrying sample labels; determining the model loss value of the student model to be trained using the first predicted
label, the second predicted label, and the sample labels; freezing the original weight matrix, and adjusting the first and second weight matrices using the model loss value to
train the model, thereby obtaining the trained student model. This method can improve the training efficiency of the student model and reduce
processing resource consumption.