Improves NMT performance
Provides more "human-like" model of the MT process
Solves the bottleneck problem
Helps with the vanishing gradient problem
Provides some interpretability to sequence to sequence model
Variation을 볼 수 있는 주요한 곳은 attention score를 계산하는 부분이다.
🔗 Basic dot-product attention
🔗 Multiplicative attention
배경) Source hidden states와 target hidden states 전체가 모두 어디에 attention해야 하는지에 대한 정보를 가지고 있다고 생각하는 것은 잘못된 것이다. 따라서 attention score를 계산하기 위해 그 안에 있는 정보 중 일부만 사용하려고 한다.
W는 matrix of learnable parameters이다.
Source hidden state와 target hidden state 사이에 있는 W matrix는 similarity를 계산할 때 s의 어떤 part에 pay attention을 해야하고, h의 어떤 part에 pay attention을 해야하는지 알려준다.
문제) W가 많은 parameter를 가지고 있다.
🔗 Reduced rank multiplicative attention
🔗 Additive attention
언제든지 set of vector values, 그리고 a vector query가 주어지면, attention은 query에 따라 값의 weighted sum을 계산하는 기술이다.
Query가 values에 집중한다고도 말한다.
Attention을 memory access mechanism으로 생각할 수도 있다.
Weighted sum은 values에 포함된 정보의 selective summary이며, 여기서 query는 focus on할 values를 결정한다.
Attention은 다른 representation(the query)에 따라 임의의 set of representations(the values)의 fixed-size representation을 얻는 방법이다.
Attention은 deep learning model에서 강력하고 flexible하고 general한 way pointer 및 memory manipulation이 되었다.
Attention은 2010년대의 진정한 진짜 새로운 아이디어이다!
Reference
- CS224n: Natural Language Processing with Deep Learning Lecture at Stanford University