DeepNet: Scaling Transformers to 1,000 Layers

Hongyu Wang, Shuming Ma, Li Dong, Shaohan Huang, Dongdong Zhang +1 more
3/1/2022
294 citations
cs.CLcs.LG
transformer-attention

Official code: microsoft/unilm (22,252 stars, Python, MIT, last commit 2026-01-23).

Abstract

In this paper, we propose a simple yet effective method to stabilize extremely deep Transformers. Specifically, we introduce a new normalization function (DeepNorm) to modify the residual connection in Transformer, accompanying with theoretically derived initialization.

Show full abstract

In-depth theoretical analysis shows that model updates can be bounded in a stable way. The proposed method combines the best of two worlds, i.e., good performance of Post-LN and stable training of Pre-LN, making DeepNorm a preferred alternative. We successfully scale Transformers up to 1,000 layers (i.e., 2,500 attention and feed-forward network sublayers) without difficulty, which is one order of magnitude deeper than previous deep Transformers. Remarkably, on a multilingual benchmark with 7,482 translation directions, our 200-layer model with 3.2B parameters significantly outperforms the 48-layer state-of-the-art model with 12B parameters by 5 BLEU points, which indicates a promising scaling direction.

View on arXivView PDF

Code Implementations(1)

microsoft/unilmOfficial100%
MIT

Large-scale Self-supervised Pre-training Across Tasks, Languages, and Modalities

22,2522,699Python, Jupyter NotebookJul 23, 201910 months agoMIT
beitbeit-3bitnetdeepnetdocument-ai+15 more

Similar Papers

Cite this paper

@article{wang2022deepnet,
  title  = {DeepNet: Scaling Transformers to 1,000 Layers},
  author = {Hongyu Wang and Shuming Ma and Li Dong and Shaohan Huang and Dongdong Zhang and Furu Wei},
  year   = {2022},
  eprint = {2203.00555},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2203.00555}
}

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/2203.00555.svg)](https://codeofpaper.com/paper/2203.00555)

Discussion