Transformer Layers

Fundamental building blocks of modern large language models (LLMs), enabling parallel sequence processing through self-attention and feed-forward mechanisms. Each layer consists of:

  • Self-Attention Sublayer: Computes token relationships via query-key-value projections
  • Feed-Forward Network (FFN): Applies non-linear transformations independently per token
  • Residual Connections: Enable gradient flow and mitigate vanishing gradients
  • Layer Normalization: Stabilizes training by normalizing activations

Key Inefficiency Addressed by Recent Research

Recent Developments: Compact Architectures

References