Skip to main content
QUICK REVIEW

[Paper Review] Deep Transformers without Shortcuts: Modifying Self-attention for Faithful Signal Propagation

Bobby He, James Martens|arXiv (Cornell University)|Feb 20, 2023
Neural Networks and ApplicationsComputer Science5 citations
TL;DR

This paper proposes methods to train deep vanilla transformers without skip connections or normalization layers by modifying self-attention through strategic weight initialization, learnable bias matrices, and location-dependent rescaling. The approach enables faithful signal propagation, achieving training speeds comparable to standard transformers and performance on par with standard models after ~5× more iterations on WikiText-103 and C4.

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.

Motivation & Objective

  • To investigate whether deep vanilla transformers—without skip connections or normalization—can be successfully trained.
  • To address the challenge of signal degradation in self-attention mechanisms, particularly rank collapse in kernel matrices.
  • To develop architectural modifications that ensure stable and faithful signal propagation through deep transformer stacks.
  • To enable training of vanilla transformers at speeds matching standard counterparts while maintaining competitive performance.

Proposed method

  • Introduces U-SPA and E-SPA, two methods that modify self-attention via parameter initialization, learnable bias matrices, and location-dependent rescaling to stabilize signal flow.
  • Uses infinite-width kernel analysis to model signal propagation in attention layers, tracking the evolution of normalized kernel matrices across layers.
  • Applies techniques from Deep Kernel Shaping (DKS) to control the initial kernel behavior in attention mechanisms, despite their high-dimensional recursion.
  • Incorporates positional encoding and causal masking into the signal propagation analysis, ensuring compatibility with standard transformer components.
  • Employs a recursive kernel formulation that captures the high-dimensional dependency of attention kernel matrices on previous layer activations.
  • Designs initialization schemes and bias structures that prevent rank collapse and maintain cosine similarity control across sequence positions.
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

Experimental results

Research questions

  • RQ1Can deep vanilla transformers be trained effectively without skip connections or normalization layers?
  • RQ2How can signal propagation be stabilized in self-attention mechanisms, which resist analysis via standard kernel recursion methods?
  • RQ3What architectural modifications enable faithful signal flow in deep transformers while preserving performance?
  • RQ4Can the training speed of vanilla transformers be matched to that of standard transformers through signal propagation control?
  • RQ5Does the proposed method preserve or recover the inductive bias of positional encoding in deep architectures?

Key findings

  • The proposed methods, especially E-SPA, prevent rank collapse in the normalized kernel matrix, maintaining controlled signal propagation even at extreme depths.
  • Vanilla transformers trained with E-SPA achieve performance comparable to standard transformers on WikiText-103 and C4 after approximately 5 times more training iterations.
  • Training speed of the proposed vanilla transformers matches that of standard transformers, indicating no significant computational overhead.
  • The normalized kernel matrices under E-SPA exhibit a recency bias, where nearby token pairs maintain higher cosine similarities, mimicking the effect of positional encoding.
  • The method successfully handles the intrinsic complexity of self-attention kernel recursion, which resists simplification into lower-dimensional functions.
  • Theoretical analysis confirms that the proposed modifications ensure non-negative signal propagation functions, validating stability in the infinite-width limit.
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.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.