Skip to main content
QUICK REVIEW

[논문 리뷰] Deep Transformers without Shortcuts: Modifying Self-attention for Faithful Signal Propagation

Bobby He, James Martens|arXiv (Cornell University)|2023. 02. 20.
Neural Networks and Applications인용 수 5
한 줄 요약

이 논문은 자기주의 주의를 통해 전략적 가중치 초기화, 학습 가능한 편향 행렬, 위치 기반 재스케일링을 통해 자기주의 주의를 수정함으로써, 스킵 연결이나 정규화 층 없이 딥 밸런스 트랜스포머를 훈련시키는 방법을 제안한다. 이 방법은 충실한 신호 전파를 가능하게 하며, 위키텍스트-103과 C4에서 표준 트랜스포머와 동등한 성능을 내기 위해 약 5배 더 많은 반복을 거쳐도 훈련 속도가 표준 트랜스포머와 유사하다.

ABSTRACT

Skip connections and normalisation layers form two standard architectural components that are ubiquitous for the training of Deep Neural Networks (DNNs), but whose precise roles are poorly understood. Recent approaches such as Deep Kernel Shaping have made progress towards reducing our reliance on them, using insights from wide NN kernel theory to improve signal propagation in vanilla DNNs (which we define as networks without skips or normalisation). However, these approaches are incompatible with the self-attention layers present in transformers, whose kernels are intrinsically more complicated to analyse and control. And so the question remains: is it possible to train deep vanilla transformers? We answer this question in the affirmative by designing several approaches that use combinations of parameter initialisations, bias matrices and location-dependent rescaling to achieve faithful signal propagation in vanilla transformers. Our methods address various intricacies specific to signal propagation in transformers, including the interaction with positional encoding and causal masking. In experiments on WikiText-103 and C4, our approaches enable deep transformers without normalisation to train at speeds matching their standard counterparts, and deep vanilla transformers to reach the same performance as standard ones after about 5 times more iterations.

연구 동기 및 목표

  • 스킵 연결이나 정규화가 없는 딥 밸런스 트랜스포머가 성공적으로 훈련될 수 있는지 조사하는 것.
  • 특히 커널 행렬의 랭크 붕괴 문제로 인한 신호 열화 문제를 해결하는 것.
  • 깊이 있는 트랜스포머 스택을 통해 안정적이고 충실한 신호 전파를 보장하는 아키텍처 수정을 개발하는 것.
  • 표준 트랜스포머와 동등한 속도로 밸런스 트랜스포머를 훈련시킬 수 있도록 하는 것과 동시에 경쟁 가능한 성능를 유지하는 것.

제안 방법

  • 신호 흐름을 안정화하기 위해 매개변수 초기화, 학습 가능한 편향 행렬, 위치 기반 재스케일링을 통해 자기주의 주의를 수정하는 U-SPA 및 E-SPA 두 가지 방법을 도입한다.
  • 무한한 너비 커널 분석을 사용하여 주의 레이어 내의 신호 전파를 모델링하고, 레이어 간에 정규화된 커널 행렬의 변화를 추적한다.
  • 깊은 커널 형태 조정(DKS)의 기법을 활용하여, 고차원적 재귀 구조를 가진 자기주의 주의 메커니즘의 초기 커널 행동을 제어한다.
  • 신호 전파 분석에 위치 인코딩과 캐주얼 마스킹을 통합하여 표준 트랜스포머 구성 요소와의 호환성을 확보한다.
  • 이전 레이어 활성화에 대한 고차원적 의존성을 포괄하는 재귀적 커널 공식을 도입한다.
  • 랭크 붕괴를 방지하고 시퀀스 위치 간 코사인 유사도 제어를 유지하기 위한 초기화 기법과 편향 구조를 설계한다.
Figure 1: Normalised kernel matrices $\text{diag}(\Sigma_{l})^{-\frac{1}{2}}\cdot\Sigma_{l}\cdot\text{diag}(\Sigma_{l})^{-\frac{1}{2}}$ (which are like kernel matrices except with cosine similarities instead of inner-products) at various depths for standard attention-only vanilla transformers and tw
Figure 1: Normalised kernel matrices $\text{diag}(\Sigma_{l})^{-\frac{1}{2}}\cdot\Sigma_{l}\cdot\text{diag}(\Sigma_{l})^{-\frac{1}{2}}$ (which are like kernel matrices except with cosine similarities instead of inner-products) at various depths for standard attention-only vanilla transformers and tw

실험 결과

연구 질문

  • RQ1스킵 연결이나 정규화 층 없이 딥 밸런스 트랜스포머를 효과적으로 훈련시킬 수 있는가?
  • RQ2표준 커널 재귀 분석 방법으로는 분석이 어려운 자기주의 주의 메커니즘에서 신호 전파를 어떻게 안정화할 수 있는가?
  • RQ3어떤 아키텍처 수정이 깊이 있는 트랜스포머에서 충실한 신호 흐름을 가능하게 하면서도 성능을 유지할 수 있는가?
  • RQ4신호 전파 제어를 통해 밸런스 트랜스포머의 훈련 속도를 표준 트랜스포머와 동일하게 맞출 수 있는가?
  • RQ5제안된 방법이 깊이 있는 아키텍처에서 위치 인코딩의 인덕티브 바이어스를 유지하거나 복구하는가?

주요 결과

  • 제안된 방법, 특히 E-SPA는 정규화된 커널 행렬의 랭크 붕괴를 방지하여 극도로 깊은 깊이에서도 제어된 신호 전파를 유지한다.
  • E-SPA로 훈련된 밸런스 트랜스포머는 위키텍스트-103과 C4에서 약 5배 더 많은 훈련 반복 후 표준 트랜스포머와 동등한 성능를 달성한다.
  • 제안된 밸런스 트랜스포머의 훈련 속도는 표준 트랜스포머와 동일하여 유의미한 계산 오버헤드가 없다.
  • E-SPA 하에서 정규화된 커널 행렬은 최근성 편향을 보이며, 가까운 토큰 쌍 간에 더 높은 코사인 유사도를 유지하여 위치 인코딩의 효과를 모방한다.
  • 자기주의 주의 커널 재귀의 내재적 복잡성을 성공적으로 다루었으며, 이는 저차원 함수로 단순화하기 어려운 문제임을 확인한다.
  • 이론적 분석을 통해 제안된 수정 사항이 비음수 신호 전파 함수를 보장함으로써, 무한한 너비 근사에서의 안정성을 검증한다.
Figure 2: Comparison of skipless transformers. Vanilla transformers are not trainable without our modifications. All curves average over 3 seeds.
Figure 2: Comparison of skipless transformers. Vanilla transformers are not trainable without our modifications. All curves average over 3 seeds.

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.