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

Bobby He, James Martens, Guodong Zhang, Aleksandar Botev, Andrew Brock +2 more
2/20/2023
cs.LGcs.AIcs.CL

No confident code implementation found for this paper. 1 possible match can be shown below.

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{he2023deep,
  title  = {Deep Transformers without Shortcuts: Modifying Self-attention for Faithful Signal Propagation},
  author = {Bobby He and James Martens and Guodong Zhang and Aleksandar Botev and Andrew Brock and Samuel L Smith and Yee Whye Teh},
  year   = {2023},
  eprint = {2302.10322},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2302.10322v1},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2302.10322.svg)](https://codeofpaper.com/paper/2302.10322)

Discussion