Under the the hood, seq2seq model is composed of encoder and decoder.
The encoder processes each item in the input sequence, it compiles the information it captures into a vector (called the context). After processing the entire input sequence, the encoder sends the context over to the decoder, which begins producing the output sequence item by item.
Let the dive to a rabbit hole begin!
http://jalammar.github.io/illustrated-transformer/
points to
which leads to
https://www.youtube.com/watch?v=UNmqTiOnRfg and https://www.youtube.com/watch?v=BR9h47Jtqyw that lead to https://www.youtube.com/watch?v=WCUNPb-5EYI
https://www.youtube.com/watch?v=WCUNPb-5EYI
The context vector is basically the number of hidden units in the encoder RNN.
The last hidden state of the enocder is the context we pass along to the decoder! In the models without attention!!
. An attention model differs from a classic sequence-to-sequence model in two main ways:
First, the encoder passes a lot more data to the decoder. Instead of passing the last hidden state of the encoding stage, the encoder passes all the hidden states to the decoder:
http://jalammar.github.io/illustrated-transformer/
http://nlp.seas.harvard.edu/2018/04/03/attention.html