At every step, the DE selects a document which is related to the current memory state and updates the internal memory.
we adopt an LSTM-RNN with an attention mechanism (Bahdanau et al., 2015) to encode theĥ T to ancestor-aware representations y by attending to [ĥ 1,...,T −1 ].