passdrill
AI & LLM Engineering · How LLMs Work: Transformers & Training · Card 009/012 easy

Ba, Kiros and Hinton (2016), "Layer Normalization," introduced a normalization technique widely used in transformer blocks. How does layer normalization compute its statistics, and how does this differ from batch normalization?

  1. It normalizes each feature by computing statistics across every example in the mini-batch, exactly as batch normalization does, but applies the result at a different point in the network
  2. It normalizes activations using running statistics collected only during a separate calibration pass performed after training has finished
  3. It computes the mean and variance across the feature dimension for each individual training example, making it independent of batch size, whereas batch normalization computes statistics across the batch for each feature
  4. It normalizes only the query and key projections used in self-attention, leaving the value projection and feed-forward outputs unnormalized
Next card → Shuffle