Teacher Forcing › Teacher Forcing
Language AI HandbookAll chapters Teacher Forcing › Teacher ForcingOne section · Sections in this chapter1 / 16 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
When you train a sequence-to-sequence model to translate "The cat sat on the mat" into French, the decoder must generate one token at a time: first "Le", then "chat", then "était assis", and so on. At each step, the decoder needs to know what it generated previously. This raises an immediate question: during training, do you feed the decoder its own (potentially wrong) previous predictions, or do you hand it the correct tokens from the reference translation?
Teacher forcing answers this question by always providing the correct previous token during training. The name comes from the analogy of a strict teacher who corrects students at each step rather than letting errors compound. Instead of waiting for the student to figure out their mistakes through experience, the teacher intervenes immediately to put them back on track. The student never practices recovering from their own errors; they always move forward from the correct starting point.
This seemingly simple decision has enormous practical consequences. Teacher forcing makes training dramatically faster and more stable, but it also creates a subtle mismatch between how a model is trained and how it is used at inference time. Understanding this mismatch, called exposure bias, and the strategies developed to mitigate it is central to building reliable sequence generation systems. The history of these mitigations tracks some of the most important ideas in sequence modeling research over the past decade.
As we established in the Encoder-Decoder Framework chapter, seq2seq models process input through an encoder that produces a context vector, then use a decoder that generates output tokens one at a time. Teacher forcing is specifically about how the decoder receives its input at each time step during training. The choice matters deeply because it directly affects training stability, convergence speed, and final model quality, and because it determines whether the model ever learns to handle the kinds of mistakes it will inevitably make when running on its own at inference time.