What is teacher forcing and its main pitfall?
mediumAnswer
- During training, feed the ground-truth previous token as input to the decoder at each step (instead of the model's own previous prediction).
- Speeds training and avoids compounding errors from incorrect early predictions.
- Pitfall: exposure bias — inference behavior differs from training (model has never seen its own errors).
- Fixes: scheduled sampling (mix true vs predicted with a schedule) or reinforcement fine-tuning.
Check yourself — multiple choice
- Feed model's own output during training
- Feed ground-truth previous token during training — fast but exposure bias at inference
- Only used in classification
- Removes decoder
Teacher forcing: ground-truth input during training → fast but exposure bias.
#rnn#training#transformers
Practise Deep Learning
214 interview questions in this topic.
Related questions
- Why did transformers replace RNNs for sequence modeling?
- What causes exploding gradients and how do you handle them?
- When do you use truncated BPTT and what's the trade-off?
- What is scheduled sampling?
- How does beam search work and what is its main failure mode?
- Why is length normalization needed in beam search?