# ResiDual: Transformer with Dual Residual Connections

- **ID:** 548
- **Kind:** paper
- **URL:** https://arxiv.org/abs/2304.14802
- **Authors:** Shufang Xie, Huishuai Zhang, Junliang Guo, Xu Tan, Jiang Bian, Hany Hassan Awadalla, Arul Menezes, Tao Qin, Rui Yan
- **Venue:** arXiv / Microsoft Research / Microsoft Azure Translation / Renmin University of China
- **Published:** 2023
- **Tags:** residual, pre-ln, post-ln, ppln, machine-translation, microsoft, fairseq
- **Topics:** Transformer architecture, residual connections, layer normalization
- **Added:** 2026-10-01
- **Research status:** done
- **Page:** https://papers.projxon.ai/entries/548

## Summary

PPLN keeps a Post-LN path (diverse hidden states) plus a Pre-LN dual residual (lower-bounded gradients). Theory: Post-LN grads decay ~O((1/2)^{(N-k)/2}); Pre-LN |Δh|~O(1/√k) collapse; ResiDual inherits the better of each. IWSLT-14 E6D6 BLEU 35.63 vs Post-LN 35.37 / Pre-LN 35.12; E12D12 36.09 vs Pre-LN 35.18 (Post-LN fails). WMT DE→EN E18D18 27.65 vs Pre-LN 26.57 / B2T 27.30. OPUS-100 E18D18 ALL 31.0 vs Pre-LN 30.3, matching a 100-layer DeepNet 31.1. Trains without LR warmup on IWSLT. Code https://github.com/microsoft/ResiDual.

## Attributes

- **Purpose:** Fuse Pre-LN and Post-LN residuals so deep Transformers avoid both gradient vanishing and representation collapse
- **Scale:** IWSLT-14 EN→DE 140k (E6D6/E12D12); WMT DE→EN 1.4M (E6D6/E18D18); OPUS-100 ~55M pairs / 100 langs (E18D18). Fairseq Adam, inverse-sqrt, 4000 warmup unless ablated
- **Time period:** 2023-04-28 (arXiv 2304.14802 v1). HF has no paper page (API 404).

## From the source (fetched 2026-10-03)

- **Published:** Apr 28, 2023 (arXiv)
- **arXiv categories:** cs.CL, cs.AI, cs.LG, cs.NE (arXiv)
- **Citations:** 48 (2 influential) (Semantic Scholar)
- **References:** 44 (Semantic Scholar)
- **Published in:** Artificial Intelligence (Semantic Scholar)

## Abstract

Transformer networks have become the preferred architecture for many tasks due to their state-of-the-art performance. However, the optimal way to implement residual connections in Transformer, which are essential for effective training, is still debated. Two widely used variants are the Post-Layer-Normalization (Post-LN) and Pre-Layer-Normalization (Pre-LN) Transformers, which apply layer normalization after each residual block's output or before each residual block's input, respectively. While both variants enjoy their advantages, they also suffer from severe limitations: Post-LN causes gradient vanishing issue that hinders training deep Transformers, and Pre-LN causes representation collapse issue that limits model capacity. In this paper, we propose ResiDual, a novel Transformer architecture with Pre-Post-LN (PPLN), which fuses the connections in Post-LN and Pre-LN together and inherits their advantages while avoids their limitations. We conduct both theoretical analyses and empirical experiments to verify the effectiveness of ResiDual. Theoretically, we prove that ResiDual has a lower bound on the gradient to avoid the vanishing issue due to the residual connection from Pre-LN. Moreover, ResiDual also has diverse model representations to avoid the collapse issue due to the residual connection from Post-LN. Empirically, ResiDual outperforms both Post-LN and Pre-LN on several machine translation benchmarks across different network depths and data sizes. Thanks to the good theoretical and empirical performance, ResiDual Transformer can serve as a foundation architecture for different AI models (e.g., large language models). Our code is available at https://github.com/microsoft/ResiDual.

## Research notes

- Primary: arxiv abs (cs.CL; also cs.AI, cs.LG, cs.NE). License not stated on abs/HTML at check. Correspondence Xu Tan xuta@microsoft.com and Rui Yan ruiyan@ruc.edu.cn. Microsoft Research / Azure Translation / Renmin University. Code https://github.com/microsoft/ResiDual (98 stars at check; MIT; archived). HF has no paper page (API 404). Discord posted PDF. Uses public IWSLT/WMT/OPUS; no new corpus, so no datasets_local row. License field left blank per catalog convention.

## Similar entries

- [Hyper-Connection Factory](https://papers.projxon.ai/entries/1231) (code, #1231)
- [Differential Transformer](https://papers.projxon.ai/entries/906) (paper, #906)
- [Bridging the Gap Between Latent and Explicit Reasoning with Looped Transformers](https://papers.projxon.ai/entries/476) (paper, #476)
- [DepthBench: Measuring How Residual Connections Enable More Computational Depth](https://papers.projxon.ai/entries/789) (paper, #789)
- [Attention Residuals](https://papers.projxon.ai/entries/1254) (paper, #1254)
- [Is One Layer Enough? Training A Single Transformer Layer Can Match Full-Parameter RL Training](https://papers.projxon.ai/entries/446) (paper, #446)
