Deep Transformers without Shortcuts: Modifying Self-attention for Faithful Signal Propagation

Bobby He, James Martens, Guodong Zhang, Aleksandar Botev, Andrew Brock, Samuel L Smith, Yee Whye Teh

Standard deep learning wisdom dictates that to train a deep Transformer, you must use skip connections (residuals) and normalization layers (like LayerNorm). Without these architectural "crutches," signal propagation fails, and the model's internal representations collapse into a useless, low-rank mess.

In their ICLR 2023 paper, researchers from Oxford and DeepMind challenge this status quo. They demonstrate that it is possible to successfully train deep "vanilla" Transformers—those without a single skip connection or normalization layer—by carefully re-engineering how self-attention behaves at the start of training.

This paper introduces Signal Preserving Attention (SPA), a method that uses specific parameter initializations and bias matrices to prevent representational collapse. The authors show that vanilla Transformers can eventually match the performance of standard models, opening new doors for architectural exploration.

The Problem: Rank Collapse

In deep networks, "signal propagation" refers to how information and gradients travel through layers. In standard Transformers, skip connections and LayerNorm ensure that the signal doesn't vanish or explode.

Without them, Transformers suffer from a fatal flaw called rank collapse. As the input passes through many self-attention layers, the "kernel" (the matrix representing similarities between different positions) converges to a rank-1 matrix. Essentially, every token starts looking identical to every other token, making it impossible for the model to learn complex relationships. While previous techniques fixed this for simpler networks like MLPs and CNNs, the complex, data-dependent nature of self-attention made it incompatible until now.

Cosine similarity of representations across layers. Standard vanilla networks suffer from rank collapse (becoming uniform yellow), while SPA methods preserve signal diversity even at 100 layers.

The Solution: Signal Preserving Attention (SPA)

The authors propose "reverse engineering" the self-attention mechanism so that, at initialization, it produces a well-behaved kernel that resists collapse. Key components of SPA include:

  • Initial Weight Scaling: The Query weights ($W^Q$) are set to zero at the start. This ensures the initial attention is determined entirely by a fixed bias, not by unlearned, random data.
  • Bias Matrices ($B$): A non-trainable bias is injected into the softmax operation to control initial attention distributions.
  • U-SPA (Uniform): Every token attends to every other token equally.
  • E-SPA (Exponential): Tokens have a "recency bias," attending more heavily to nearby tokens. This effectively mimics positional encoding.
  • Location-Dependent Rescaling ($D$): A diagonal matrix compensates for causal masking (where tokens can't look at the future), which naturally reduces the norm of representations for tokens at the beginning of a sequence.

(Note: The authors also introduce a baseline "Value-SkipInit" approach that adds a small skip connection specifically around the Value computation, though their primary focus remains strictly skipless SPA.)

Key Insights and Results

The researchers evaluated their methods on two standard large-scale language modeling benchmarks: WikiText-103 and the Colossal Clean Crawled Corpus (C4).

Breaking the Depth Barrier: The most striking result is that the authors successfully trained vanilla Transformers with up to 108 layers. Without SPA modifications, these models fail to train entirely.

Positional Encoding is Built-in: Interestingly, the E-SPA method (which uses an exponential decay bias) performs better than the uniform version. This suggests that a "recency bias" is not just helpful for signal propagation, but serves as a powerful inductive bias for language, functioning similarly to traditional positional encodings.

Performance Parity and the "Skipless Tax": On the C4 dataset, a vanilla E-SPA Transformer reached a validation perplexity of 24.7, matching the performance of a standard Pre-LN Transformer. However, there is a "training speed tax." While the authors prove you can train without skips, purely vanilla Transformers need about 5 times more iterations to reach the same loss as a standard Transformer.

Training curves on WikiText-103 showing that while SPA methods successfully train without skips, they require more iterations to match standard models with skip connections and LayerNorm. Pure skipless models fail entirely.

Normalization is Optional: With SPA, LayerNorm becomes largely unnecessary for training stability, as the method naturally controls the growth of activation norms. When combining E-SPA with normalized skip connections (but still no LayerNorm), the model matched the training speed of standard Transformers perfectly, suggesting SPA is a viable alternative to normalization even in residual networks.

Limitations and Future Work

While a theoretical breakthrough, the 5x training time requirement for purely skipless models is a significant hurdle for practical use. The authors suggest that more sophisticated second-order optimizers (like K-FAC) might close this gap, as they have for CNNs in the past.

Furthermore, the current theory focuses heavily on the attention layers. While the authors provide a workaround for the MLP blocks in Transformers, a more unified theory that treats both equally is still needed. Ultimately, now that we know skip connections aren't strictly mandatory for deep Transformers, it opens the door to searching for entirely new architectures that might be more efficient or powerful than the standard residual block design.

Summary updated

BibTeX
@inproceedings{he2023deep,
  author = {Bobby He and James Martens and Guodong Zhang and Aleksandar Botev and Andrew Brock and Samuel L Smith and Yee Whye Teh},
  title = {{Deep Transformers without Shortcuts: Modifying Self-attention for Faithful Signal Propagation}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=NPrsUQgMjKK},
}
Figure