Layer Normalization

Asked at TikTok · ML Fundamentals & Algorithms · Difficulty: Medium · Last asked Dec 3, 2025

Layer Normalization normalizes each sample independently across its feature dimension, so it does not depend on batch statistics and behaves the same in training and inference. It is the standard normalization layer in Transformers. In this problem you implement its forward and backward passes by hand with NumPy, as you would when writing a small neural-network library without autograd.

Loading the problem…