In the paper Neural Programmer-Interpreters, the authors use the teacher forcing technique, but what exactly is it?


1 Answer 1


Consider the task of sequence prediction, so you want to predict the next element of a sequence $e_t$ given the previous elements of this sequence $e_{t-1}, e_{t-2}, \dots, e_{1} = e_{t-1:1}$. Teacher forcing is about forcing the predictions to be based on correct histories (i.e. the correct sequence of past elements) rather than predicted history (which may not be correct). To be more concrete, let $\hat{e}_{i}$ denote the $i$th predicted element of the sequence and let $e_{i}$ be the corresponding ground-truth. Then, if you use teacher forcing, to predict $e_{t}$, rather than using $\hat{e}_{t-1:1}$, you would use $e_{t-1:1}$.

Recall that supervised learning can also be thought of as learning with a teacher. Hence the expression "teacher forcing", i.e. you force the predictions to be based on correct histories (the teacher's labels).

Of course, intuitively, teacher forcing should help to stabilize training, given that the predictions are not based on noisy or wrong histories.

See also the blog post What is Teacher Forcing for Recurrent Neural Networks? by Jason Brownlee.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .