The encoder RNN transforms the input sequence X into a sequence of hidden states The decoder RNN generates an output sentence Y on the basis of the hidden states.
it predicts the next word at each position by sam- where s t is the decoder state, c t is the context vector, y t−1 is the previous word, and g is a feed-forward neural network.