Weight Initialization and Variance Dynamics in Deep Neural Networks and Large Language Models
Han
Weight initialization governs signal propagation and gradient flow at the start of training. This paper offers a theory-grounded and empirically validated study across two regimes: compact ReLU multilayer perceptrons and GPT-2-style transformers. First, a logarithmic sweep of the initial standard deviation maps vanishing and exploding regimes and identifies a broad stability band with standard deviations between 1e-2 and 1e-1. Second, a controlled comparison shows that Kaiming (fan-in) initialization converges faster and more stably than Xavier under ReLU, consistent with variance-preserving theory. Third, in a from-scratch 12-layer GPT-2-style model, this paper tracks layerwise Q/K/V weight variance through pretraining and observe depth-dependent equilibration into narrow bands: shallow layers expand rapidly while deeper layers change more gradually. Together, these results connect classic initialization principles with modern transformer behavior and yield simple, practical recipes for robust training.
가중치 초기화는 훈련 시작 시 신호 전파 및 기울기 흐름을 제어합니다. 본 논문은 두 가지 영역을 포괄하는 이론적 기초가 견고하고 경험적으로 검증된 연구를 제공합니다: 간결한 ReLU 다층 퍼셉트론과 GPT-2 스타일의 Transformer입니다. 첫째, 초기 표준편차에 대한 로그 스캔을 통해 기울기 소실 및 폭발 영역을 매핑하고, 표준편차가 1e-2에서 1e-1 사이의 광범위한 안정 대역을 식별했습니다. 둘째, 제어된 비교를 통해 ReLU 활성화 함수에서 Kaiming(fan-in) 초기화가 Xavier 초기화보다 더 빠르고 안정적으로 수렴함을 보였으며, 이는 분산 보존 이론과 일치합니다. 셋째, 처음부터 구축한 12층 GPT-2 스타일 모델에서 사전훈련 과정 중 각 층의 Q/K/V 가중치 분산 변화를 추적하여, 깊이 관련 균형 현상을 관찰했습니다: 얕은 층은 빠르게 확장되는 반면 깊은 층은 더욱 점진적으로 변화합니다.
전방향 및 역방향 보존 조건은 일반적으로 동시에 만족될 수 없으며, n_in ≈ n_out 및 c_φ ≈ d_φ인 경우를 제외합니다. 실제로는 전방향 신호 안정성을 유지하는 것이 일반적으로 더 중요하며, 이는 fan-in He/Kaiming이 Xavier보다 더 빠르게 수렴하는 이유를 설명합니다.