A computer implemented method of training a model, the method comprising: acquiring a recognition result of a teacher model and a recognition result of a student model for an input sequence; and training the student model to minimize a distinction between the recognition result of the teacher model and the recognition result of the student model, based on an objective that the recognition result of the teacher model and the recognition result of the student model are not distinguishable from each other, and wherein the training of the student model comprises: determining an adversarial loss based on a degree to which the recognition result of the teacher model and the recognition result of the student model are distinguished from each other; and training the student model to reduce the adversarial loss, and wherein the determining of the adversarial loss comprises: determining the adversarial loss based on a degree to which an output sequence of the teacher model and an output sequence of the student model that are respectively output as recognition results for the input sequence are distinguished from each other, and wherein input sequence includes data including a plurality of elements and includes speech data including a plurality of frames, wherein the determining of the adversarial loss comprises: determining the adversarial loss by applying a Gumbel-max algorithm, based on a probability of an output sequence and by further applying a Gumbel-max algorithm, based on probabilities of a number of candidate sequences that are likely to correspond to the output sequence. acquiring a recognition result of a teacher model and a recognition result of a student model for an input sequence; and training the student model to minimize a distinction between the recognition result of the teacher model and the recognition result of the student model, based on an objective that the recognition result of the teacher model and the recognition result of the student model are not distinguishable from each other, and wherein the training of the student model comprises: determining an adversarial loss based on a degree to which the recognition result of the teacher model and the recognition result of the student model are distinguished from each other; and training the student model to reduce the adversarial loss, and wherein the determining of the adversarial loss comprises: determining the adversarial loss based on a degree to which an output sequence of the teacher model and an output sequence of the student model that are respectively output as recognition results for the input sequence are distinguished from each other, and wherein input sequence includes data including a plurality of elements and includes speech data including a plurality of frames, wherein the determining of the adversarial loss comprises: determining the adversarial loss by applying a Gumbel-max algorithm, based on a probability of an output sequence and by further applying a Gumbel-max algorithm, based on probabilities of a number of candidate sequences that are likely to correspond to the output sequence. determining an adversarial loss based on a degree to which the recognition result of the teacher model and the recognition result of the student model are distinguished from each other; and training the student model to reduce the adversarial loss, and wherein the determining of the adversarial loss comprises: determining the adversarial loss based on a degree to which an output sequence of the teacher model and an output sequence of the student model that are respectively output as recognition results for the input sequence are distinguished from each other, and wherein input sequence includes data including a plurality of elements and includes speech data including a plurality of frames, wherein the determining of the adversarial loss comprises: determining the adversarial loss by applying a Gumbel-max algorithm, based on a probability of an output sequence and by further applying a Gumbel-max algorithm, based on probabilities of a number of candidate sequences that are likely to correspond to the output sequence. determining the adversarial loss based on a degree to which an output sequence of the teacher model and an output sequence of the student model that are respectively output as recognition results for the input sequence are distinguished from each other, and wherein input sequence includes data including a plurality of elements and includes speech data including a plurality of frames, wherein the determining of the adversarial loss comprises: determining the adversarial loss by applying a Gumbel-max algorithm, based on a probability of an output sequence and by further applying a Gumbel-max algorithm, based on probabilities of a number of candidate sequences that are likely to correspond to the output sequence. determining the adversarial loss by applying a Gumbel-max algorithm, based on a probability of an output sequence and by further applying a Gumbel-max algorithm, based on probabilities of a number of candidate sequences that are likely to correspond to the output sequence.