본문 바로가기

트렌드 한눈에 보기/학계 트렌드

Transformer 이해를 하기 위해 필요한 것들 [1화]

"Attention is all you need", Transformer 모델을 처음으로 제시한 2017년 논문의 제목이다. [1706.03762] Attention Is All You Need (arxiv.org) 익살스러운 이름이지만, 2023년 11월 현재 97,503 건의 피인용수를 자랑한다. 저자들은 모두 구글 브레인 소속이었지만, 현재는 모두 (!) 퇴사하여 창업을 했다는 점도 인상적이다. 

 

Attention Is All You Need

The dominant sequence transduction models are based on complex recurrent or convolutional neural networks in an encoder-decoder configuration. The best performing models also connect the encoder and decoder through an attention mechanism. We propose a new

arxiv.org

 

Transformer 모델은 유달리 이해하기가 어려운데, 이는 사실 내가 LSTM 조차 제대로 이해하고 있지 못하기 때문일 수도 있다. 하지만 변명하자면, Transformer 모델은 제일 중요한 Attention 개념조차도 과거의 논문(Computational modelling of visual attention, 2001)으로부터 가져오기 때문도 있다. 이해하기 위해 읽어야할 것들이 산더미다.

Computational modelling of visual attention | Nature Reviews Neuroscience

 

아래 Reference들을 순서대로 읽으면 그래도 조금이나마 Transformer의 구조를 이해할 수 있다. 

1. What Is Attention? - MachineLearningMastery.com

2. The Attention Mechanism from Scratch - MachineLearningMastery.com

3. The Transformer Attention Mechanism - MachineLearningMastery.com

4. The Transformer Model - MachineLearningMastery.com

5.  Implementing the Transformer Encoder from Scratch in TensorFlow and Keras - MachineLearningMastery.com

 

물론 실제로 구현하고 데이터를 적용해보는 일은 또 다른 문제이기에, 제우의 대모험이 시작되려는 참이다.