Le teacher forcing est une stratégie d'entraînement couramment utilisée dans le domaine de apprentissage automatique, especially in the context of réseaux neuronaux récurrents (RNNs) and sequence-to-sequence models. In this approach, during training, the model is provided with the true output (the vérité terrain) of the previous time step as input for the current time step. This allows the model to learn from correct context rather than relying solely on its own previous predictions.
Par exemple, dans un de langage that predicts the next word in a sentence, instead of using the model’s previously predicted word to determine the next word, teacher forcing uses the actual previous word from the training dataset. This can help the model converge faster and achieve better performance, as it minimizes the likelihood of propagating errors throughout the sequence.
However, while teacher forcing can improve training efficiency, it also has its drawbacks. One significant issue is that during inference (when the model is actually used), the model does not have access to the true outputs and must rely on its own predictions, which may be less accurate due to the training bias introduced by teacher forcing. This difference between training and inference can lead to a phenomenon known as ‘exposure bias’, where the model performs poorly on unseen data or real-world applications.
To mitigate the adverse effects of exposure bias, researchers have developed techniques such as échantillonnage programmé, where the model gradually shifts from using the true outputs to its own predictions during training. This approach aims to better prepare the model for the conditions it will encounter during inference, improving overall robustness and accuracy.