

C : encoded sequence와 decoded sequence 사이의 정보를 전딜하는 과정
문제 : input sequence bottlenecked through fized-sized vector. What if T=1000?
C (context vector)는 input sequence의 모든 관련 정보를 캡처하여 decoder를 초기화하는 데 사용된다. 입력 시퀀스 T가 길어지면 single fixed size vector로 sequence의 모든 정보를 효과적으로 요약하는 것이 어려워진다.
해결 : use new context vector at each step of decoder! (provide different context vector at each decoding step)

h4에만 의존하는 대신, attention mechanism은 decoder가 output sequence의 각 token을 생성할 때 encoder의 모든 hidden states(h1, h2, h3, h4)를 고려한다.

repeat : use to compute new context vector
Use a different context vector in each timestep of decoder
1. input sequence not bottlenecked through single vector
2. at each timestep of decoder, context vector "looks at" different parts of the input sequence

: how much do we want to emphasize the vector
: summing over all position in the image i,j
output sequence를 생성하는 각 시간 단계마다, 입력 이미지의 grid of features를 가중합하여 모델이 새로운 context vector를 생성할 수 있도록 한다.
Changes :

one query for input vector

-> 네트워크에 의해 결정된 비선형적인 방식으로 입력의 각 벡터를 다른 모든 벡터와 비교하는 것
근데 self-attention layer is Permutation Equivariant
따라서 positional encoding 사용
Don't let vectors "look ahead" in the sequence

H개의 독립적인 Attention Head를 병렬적으로 사용함


근데 "Attention is all you need"
self-attention : vector들 사이에 상호작용 유일함
layer norm, MLP : vector들 사이에서 독립적으로 작동함
