sy/dev

Series

Attention 이해하기

5 posts in this series

  1. 1

    [NLP] Attention 쉽게 이해하기 (Query, Key, Value, Transformer에서의 attention 3종류)

    Study2024-06-24 09:007 min read

    Transformer를 이해하기 위한 첫걸음으로 Attention의 직관, Q·K·V의 역할, Scaled Dot-Product Attention 수식, 그리고 Transformer 내부에 등장하는 3가지 Attention 종류를 정리한다.

  2. 2

    [NLP] Transformer 3가지 Attention 자세히 보기 (Encoder/Decoder Self-Attention, Cross-Attention, Multi-Head)

    Study2024-07-01 09:009 min read

    이전 글에서 등장한 Transformer의 3가지 Attention(Encoder Self-Attention, Decoder Masked Self-Attention, Encoder-Decoder Attention)이 각각 어떻게 동작하는지, 그리고 Multi-Head Attention이 왜 필요한지 정리한다.

  3. 3

    [NLP] Positional Encoding 이해하기 (왜 sin/cos인가?)

    Study2024-07-15 09:009 min read

    Self-Attention은 토큰 순서를 모르기 때문에 위치 정보를 따로 주입해야 한다. Transformer가 사용한 sin/cos Positional Encoding의 수식, 왜 이런 형태인지, 학습 가능한 임베딩과의 차이를 정리한다.

  4. 4

    [NLP] Layer Normalization & Residual Connection — Transformer를 깊게 쌓는 비결 (Pre-LN vs Post-LN)

    Study2024-08-01 09:009 min read

    Transformer가 12층, 24층, 96층까지 깊게 쌓일 수 있는 이유는 Residual Connection과 Layer Normalization 두 컴포넌트 덕분이다. 각각의 역할, BatchNorm과의 차이, 그리고 Pre-LN vs Post-LN 트레이드오프를 정리한다.

  5. 5

    [NLP] Feed-Forward Network — Transformer의 숨은 표현력 (FFN, GELU, SwiGLU, MoE)

    Study2024-08-15 09:0010 min read

    Attention이 토큰끼리 섞는 일을 한다면, FFN은 각 토큰을 변환하는 역할을 한다. 단순한 2층 MLP이지만 모델 전체 파라미터의 약 2/3를 차지하는 이 컴포넌트의 구조, 활성 함수 변천(ReLU → GELU → SwiGLU), key-value memory 해석, MoE까지 정리한다.