AIToday
Large Language ModelsQiita 機械学習Published: Dec 2, 2026, 01:00 JST

RealFormer adds attention-score residuals, beats Post-LN and Pre-LN

Send on LINE
RealFormer adds attention-score residuals, beats Post-LN and Pre-LN

3 Key Points

  1. What happened

    Ruining He and co-authors at Google Research proposed RealFormer, which adds residual connections to attention scores, and reported gains over Post-LN and Pre-LN baselines in BERT pretraining across 30M to 1B parameters, machine translation, and long-document modeling.

  2. Why it matters

    The reported gap over Post-LN and Pre-LN widened as models grew, supporting the authors' hypothesis that the method regularizes and stabilizes training, which they suggest may explain why larger models benefit more.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

By signing up you agree to the Terms of Service and Privacy Policy.

Context & Analysis

The paper places itself against a design debate: image models generally prefer ResNet v2 (analogous to Pre-LN) over ResNet v1 (analogous to Post-LN), yet NLP has not shown a clear preference for Pre-LN. The authors take that discrepancy as a hint that self-attention models may suit a slightly different design, and they add a residual path for attention scores on top of a Post-LN base. They note that the idea lacks a motivating prior study or preliminary analysis in the paper; regularization and stabilization are offered as hypotheses after seeing results. The cumulative sum of scores grows linearly with depth, which may be suboptimal for very deep models, and they report cumulative averaging worked better empirically in that case. Beyond BERT, they applied it to machine translation with Admin and to ETC, reporting gains in both settings.

FAQ
Does RealFormer add new parameters or hyperparameters?
No. The authors state it adds neither, and that implementation requires only a few lines of change.
Where was RealFormer published?
A preprint appeared on arXiv in 2020, and the paper was accepted to Findings of ACL (ACL-IJCNLP 2021), pp. 929-943.
What did the attention analysis find?
In a pretrained BERT-Base, RealFormer was clearly sparser in the top three layers and had lower Jensen-Shannon divergence between adjacent layers' same-head attention, especially in middle layers, though the authors note these are observations, not direct proof of regularization.
Qiita 機械学習Read Original Article
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

By signing up you agree to the Terms of Service and Privacy Policy.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleBen's Bites: AI's real barrier is the 'cone of shame', not skills