Stability of Transformers under Layer Normalization
Kan, Li, Zhang et al.
Despite their widespread use, training deep Transformers can be unstable. Layer normalization, a standard component, improves training stability, but its placement has often been ad-hoc. In this paper, we conduct a principled study on the forward (hidden states) and backward (gradient) stability of Transformers under different layer normalization placements. Our theory provides key insights into the training dynamics: whether training drives Transformers toward regular solutions or pathological behaviors. For forward stability, we derive explicit bounds on the growth of hidden states in trained Transformers. For backward stability, we analyze how layer normalization affects the backpropagation of gradients, thereby explaining the training dynamics of each layer normalization placement. Our analysis also guides the scaling of residual steps in Transformer blocks, where appropriate choices can further improve stability and performance. Our numerical results corroborate our theoretical findings. Beyond these results, our framework provides a principled way to sanity-check the stability of Transformers under new architectural modifications, offering guidance for future designs.
제목: Stability of Transformers under Layer Normalization
저자: Kelvin Kan (UCLA), Xingjian Li (UT Austin), Benjamin J. Zhang (UNC Chapel Hill), Tuhin Sahai (SRI International), Stanley Osher (UCLA), Krishna Kumar (UT Austin), Markos A. Katsoulakis (UMass Amherst)
Transformer가 광범위하게 사용되고 있음에도 불구하고, 깊은 Transformer의 훈련은 불안정할 수 있습니다. 레이어 정규화(Layer Normalization)는 표준 구성 요소로서 훈련 안정성을 개선할 수 있지만, 그 위치 선택은 종종 임시적입니다. 본 논문은 서로 다른 레이어 정규화 위치 하에서 Transformer의 전방향 안정성(은닉 상태)과 후방향 안정성(기울기)에 대한 원리적 연구를 수행합니다. 이론적 분석은 훈련 동역학의 핵심 통찰력을 드러냅니다: 훈련이 Transformer를 규칙적인 해로 이끌어가는지 또는 병적 행동으로 이끌어가는지 여부입니다. 전방향 안정성 측면에서, 훈련 후 Transformer의 은닉 상태 증가에 대한 명시적 경계를 도출했습니다. 후방향 안정성 측면에서, 레이어 정규화가 기울기 역전파에 미치는 영향을 분석하여 각 레이어 정규화 위치의 훈련 동역학을 설명합니다. 분석은 또한 Transformer 블록의 잔차 스텝 크기 조정을 지도하며, 적절한 선택은 안정성과 성능을 더욱 개선할 수 있습니다.
종합 평가: 이는 이론과 실제가 잘 결합된 고품질 논문으로, Transformer 안정성 분석을 위한 새로운 수학적 프레임워크를 제공하며 중요한 학술적 가치와 실용적 의의를 지닙니다. 이론적 분석은 엄밀하고 심도 있으며, 실험 검증은 충분하고, 심층 학습 아키텍처 설계에 가치 있는 지침을 제공합니다.