During training, the model learns to represent variables by backpropagating gradients from a time step where a variable is selected by the decoder, through the key-variable memory, to an earlier time step when the key embedding was computed.
the encoder/decoder learns to generate representations for variables such that they can be used at the right time to construct the correct program.