<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wikibase.ronzz.org/index.php?action=history&amp;feed=atom&amp;title=Residual_connection_%28Transformer%29</id>
	<title>Residual connection (Transformer) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wikibase.ronzz.org/index.php?action=history&amp;feed=atom&amp;title=Residual_connection_%28Transformer%29"/>
	<link rel="alternate" type="text/html" href="https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;action=history"/>
	<updated>2026-11-24T06:01:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16150&amp;oldid=prev</id>
		<title>Rongzhou at 10:47, 12 November 2026</title>
		<link rel="alternate" type="text/html" href="https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16150&amp;oldid=prev"/>
		<updated>2026-11-12T10:47:14Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;amp;diff=16150&amp;amp;oldid=16149&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Rongzhou</name></author>
	</entry>
	<entry>
		<id>https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16149&amp;oldid=prev</id>
		<title>RonzzWikiCowriterAI: Link the attention sub-layer map; AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16149&amp;oldid=prev"/>
		<updated>2026-11-12T10:38:50Z</updated>

		<summary type="html">&lt;p&gt;Link the attention sub-layer map; AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:38, 12 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l10&quot;&gt;Line 10:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 10:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$$&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The sum is defined only if $\operatorname{SL}$ returns a matrix of the same shape, which is why every sub-layer of a Transformer outputs width $d$.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The sum is defined only if $\operatorname{SL}$ returns a matrix of the same shape, which is why every sub-layer of a Transformer outputs width $d$&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;; for attention this is the work of the output projection, see [[self-attention#Sub-layer map]]&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>RonzzWikiCowriterAI</name></author>
	</entry>
	<entry>
		<id>https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16137&amp;oldid=prev</id>
		<title>RonzzWikiCowriterAI: AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16137&amp;oldid=prev"/>
		<updated>2026-11-12T10:12:14Z</updated>

		<summary type="html">&lt;p&gt;AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:12, 12 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l29&quot;&gt;Line 29:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$$&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;where $\vec\gamma,\vec\beta\in\mathbb{R}^{d}$ are [[model parameters (ANN)|parameters]] (a gain and a bias, $2d$ &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;of each &lt;/del&gt;per LN), $\epsilon\approx10^{-5}$ guards the division, and $\odot$ is the elementwise product.&amp;lt;ref&amp;gt;{{#cite:Q3264}}&amp;lt;/ref&amp;gt; Applied to a sequence it acts row by row,&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;where $\vec\gamma,\vec\beta\in\mathbb{R}^{d}$ are [[model parameters (ANN)|parameters]] (a gain and a bias, $2d$ &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;parameters in total &lt;/ins&gt;per LN), $\epsilon\approx10^{-5}$ guards the division, and $\odot$ is the elementwise product.&amp;lt;ref&amp;gt;{{#cite:Q3264}}&amp;lt;/ref&amp;gt; Applied to a sequence it acts row by row,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$$&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>RonzzWikiCowriterAI</name></author>
	</entry>
	<entry>
		<id>https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16134&amp;oldid=prev</id>
		<title>RonzzWikiCowriterAI: AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16134&amp;oldid=prev"/>
		<updated>2026-11-12T10:11:53Z</updated>

		<summary type="html">&lt;p&gt;AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:11, 12 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l219&quot;&gt;Line 219:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 219:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$$&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;j^{10}=1\cdot10^{-10},&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;\begin{cases}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;\&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;qquad&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;\text{plain stack: } &lt;/ins&gt;j^{10}=1\cdot10^{-10},&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;\\&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;\left(1+j\right)^{10}\approx2.59&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;,&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;\&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;text{with residuals: } &lt;/ins&gt;\left(1+j\right)^{10}\approx2.59&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;\end{cases}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$$&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;which is the factor that multiplies a gradient on its way from block 10 back to block 0.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;which is the factor that multiplies a gradient on its way from block 10 back to block 0.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{End hidden}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{End hidden}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>RonzzWikiCowriterAI</name></author>
	</entry>
	<entry>
		<id>https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16133&amp;oldid=prev</id>
		<title>RonzzWikiCowriterAI: AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16133&amp;oldid=prev"/>
		<updated>2026-11-12T10:11:51Z</updated>

		<summary type="html">&lt;p&gt;AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:11, 12 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l132&quot;&gt;Line 132:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 132:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;Consequence&#039;&#039;&#039;: at initialisation Post-LN produces large expected gradients for the parameters near the output, so a large learning rate there is unstable and a warm-up phase is needed; Pre-LN keeps those gradients bounded and trains without &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1&lt;/del&gt;.&amp;lt;ref&amp;gt;{{#cite:Q3281}}&amp;lt;/ref&amp;gt; The original Transformer is Post-LN, trained with a warm-up phase.&amp;lt;ref&amp;gt;{{#cite:Q3130}}&amp;lt;/ref&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;Consequence&#039;&#039;&#039;: at initialisation Post-LN produces large expected gradients for the parameters near the output, so a large learning rate there is unstable and a warm-up phase is needed; Pre-LN keeps those gradients bounded and trains without &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a warm-up phase&lt;/ins&gt;.&amp;lt;ref&amp;gt;{{#cite:Q3281}}&amp;lt;/ref&amp;gt; The original Transformer is Post-LN, trained with a warm-up phase.&amp;lt;ref&amp;gt;{{#cite:Q3130}}&amp;lt;/ref&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>RonzzWikiCowriterAI</name></author>
	</entry>
	<entry>
		<id>https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16132&amp;oldid=prev</id>
		<title>RonzzWikiCowriterAI: AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16132&amp;oldid=prev"/>
		<updated>2026-11-12T10:11:48Z</updated>

		<summary type="html">&lt;p&gt;AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:11, 12 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;With $\operatorname{SL}\equiv\mathbf{0}$ the connection is the identity, $\operatorname{Res}(\mathbf{X})=\mathbf{X}$, so a deeper stack can reproduce a shallower &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1 &lt;/del&gt;exactly. That is the reason depth does not hurt in principle.&amp;lt;ref&amp;gt;{{#cite:Q3269}}&amp;lt;/ref&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;With $\operatorname{SL}\equiv\mathbf{0}$ the connection is the identity, $\operatorname{Res}(\mathbf{X})=\mathbf{X}$, so a deeper stack can reproduce a shallower &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;model &lt;/ins&gt;exactly. That is the reason depth does not hurt in principle.&amp;lt;ref&amp;gt;{{#cite:Q3269}}&amp;lt;/ref&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>RonzzWikiCowriterAI</name></author>
	</entry>
	<entry>
		<id>https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16131&amp;oldid=prev</id>
		<title>RonzzWikiCowriterAI: AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16131&amp;oldid=prev"/>
		<updated>2026-11-12T10:11:46Z</updated>

		<summary type="html">&lt;p&gt;AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:11, 12 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Transformer]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Transformer]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A &#039;&#039;&#039;residual connection&#039;&#039;&#039; adds the input of a sub-layer to the output of that sub-layer, so that the sub-layer only has to learn a correction to its input. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Each of the 2 &lt;/del&gt;sub-layers of a [[Transformer]] block, [[self-attention]] and the [[Feed-Forward Network (FFN) Sub-Layer (Transformer)|FFN]], &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;is &lt;/del&gt;wrapped in &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1, together with &lt;/del&gt;a layer normalisation.&amp;lt;ref&amp;gt;{{#cite:Q3130}}{{#cite:Q3269}}&amp;lt;/ref&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A &#039;&#039;&#039;residual connection&#039;&#039;&#039; adds the input of a sub-layer to the output of that sub-layer, so that the sub-layer only has to learn a correction to its input. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Both &lt;/ins&gt;sub-layers of a [[Transformer]] block, [[self-attention]] and the [[Feed-Forward Network (FFN) Sub-Layer (Transformer)|FFN]], &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;are &lt;/ins&gt;wrapped in &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a residual connection and &lt;/ins&gt;a layer normalisation.&amp;lt;ref&amp;gt;{{#cite:Q3130}}{{#cite:Q3269}}&amp;lt;/ref&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Definition ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Definition ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikibase:diff:1.41:old-16126:rev-16131:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>RonzzWikiCowriterAI</name></author>
	</entry>
	<entry>
		<id>https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16126&amp;oldid=prev</id>
		<title>RonzzWikiCowriterAI: AI-assisted (RonzzWikiCowriter) (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wikibase.ronzz.org/index.php?title=Residual_connection_(Transformer)&amp;diff=16126&amp;oldid=prev"/>
		<updated>2026-11-12T10:10:51Z</updated>

		<summary type="html">&lt;p&gt;AI-assisted (RonzzWikiCowriter) (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Transformer]]&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;residual connection&amp;#039;&amp;#039;&amp;#039; adds the input of a sub-layer to the output of that sub-layer, so that the sub-layer only has to learn a correction to its input. Each of the 2 sub-layers of a [[Transformer]] block, [[self-attention]] and the [[Feed-Forward Network (FFN) Sub-Layer (Transformer)|FFN]], is wrapped in 1, together with a layer normalisation.&amp;lt;ref&amp;gt;{{#cite:Q3130}}{{#cite:Q3269}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Definition ==&lt;br /&gt;
&lt;br /&gt;
Let $\mathbf{X}\in\mathbb{R}^{T\times d}$ be the input of a sub-layer, and let $\operatorname{SL}$ be the map that sub-layer computes. The &amp;#039;&amp;#039;&amp;#039;residual connection&amp;#039;&amp;#039;&amp;#039; replaces $\operatorname{SL}$ by&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\operatorname{Res}(\mathbf{X})=\mathbf{X}+\operatorname{SL}(\mathbf{X}).&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
The sum is defined only if $\operatorname{SL}$ returns a matrix of the same shape, which is why every sub-layer of a Transformer outputs width $d$.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
With $\operatorname{SL}\equiv\mathbf{0}$ the connection is the identity, $\operatorname{Res}(\mathbf{X})=\mathbf{X}$, so a deeper stack can reproduce a shallower 1 exactly. That is the reason depth does not hurt in principle.&amp;lt;ref&amp;gt;{{#cite:Q3269}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Layer normalisation ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Layer normalisation&amp;#039;&amp;#039;&amp;#039; (LN) normalises the $d$ components of 1 position to zero mean and unit variance, then rescales and shifts them with 2 learned vectors,&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\operatorname{LN}(\vec x)&lt;br /&gt;
=\vec\gamma\odot\frac{\vec x-\mu\,\mathbf{1}}{\sqrt{\sigma^{2}+\epsilon}}+\vec\beta,&lt;br /&gt;
\qquad&lt;br /&gt;
\mu=\frac{1}{d}\sum_{i=1}^{d}x_i,&lt;br /&gt;
\qquad&lt;br /&gt;
\sigma^{2}=\frac{1}{d}\sum_{i=1}^{d}\left(x_i-\mu\right)^{2},&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
where $\vec\gamma,\vec\beta\in\mathbb{R}^{d}$ are [[model parameters (ANN)|parameters]] (a gain and a bias, $2d$ of each per LN), $\epsilon\approx10^{-5}$ guards the division, and $\odot$ is the elementwise product.&amp;lt;ref&amp;gt;{{#cite:Q3264}}&amp;lt;/ref&amp;gt; Applied to a sequence it acts row by row,&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\operatorname{LN}(\mathbf{X})&lt;br /&gt;
=\begin{pmatrix}&lt;br /&gt;
\operatorname{LN}\left(\vec x_1\right)^{\top}\\&lt;br /&gt;
\vdots\\&lt;br /&gt;
\operatorname{LN}\left(\vec x_T\right)^{\top}&lt;br /&gt;
\end{pmatrix},&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
so the statistics are taken over the features of 1 position. They do not depend on the other examples of the batch, and are the same during training and at inference, which is not the case for batch normalisation.&lt;br /&gt;
&lt;br /&gt;
=== Invariance to shift and scale ===&lt;br /&gt;
&lt;br /&gt;
Setting $\epsilon=0$ for clarity, the mean and the variance of $\alpha\vec x+c\mathbf{1}$ are&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\frac{1}{d}\sum_{i=1}^{d}\left(\alpha x_i+c\right)=\alpha\mu+c,&lt;br /&gt;
\qquad&lt;br /&gt;
\frac{1}{d}\sum_{i=1}^{d}\left(\alpha x_i+c-\alpha\mu-c\right)^{2}=\alpha^{2}\sigma^{2},&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
hence, for $\alpha&amp;gt;0$,&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\operatorname{LN}\left(\alpha\vec x+c\mathbf{1}\right)&lt;br /&gt;
=\vec\gamma\odot\frac{\alpha\left(\vec x-\mu\mathbf{1}\right)}{\alpha\sqrt{\sigma^{2}}}+\vec\beta&lt;br /&gt;
=\operatorname{LN}\left(\vec x\right).&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
So the scale $\alpha$ and the offset $c$ produced by the layer before LN are erased by it, and $\vec\gamma,\vec\beta$ are the only quantities that set the scale and the offset of the normalised output.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gradient path ==&lt;br /&gt;
&lt;br /&gt;
Write the representation after block $l$ as $\mathbf{Y}_l$, so that&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\mathbf{Y}_l=\mathbf{Y}_{l-1}+F_l\left(\mathbf{Y}_{l-1}\right),&lt;br /&gt;
\qquad l=1,\cdots,L,&lt;br /&gt;
\qquad \mathbf{Y}_0=\mathbf{X},&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
where $F_l$ is the sub-layer of block $l$. Treating $\partial\mathbf{Y}_l/\partial\mathbf{Y}_{l-1}$ as the linear map it induces on the flattened matrix,&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\frac{\partial\mathbf{Y}_l}{\partial\mathbf{Y}_{l-1}}&lt;br /&gt;
=\mathbf{I}+\frac{\partial F_l}{\partial\mathbf{Y}_{l-1}}&lt;br /&gt;
=\mathbf{I}+\mathbf{J}_l,&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
so by the chain rule the gradient that reaches the input is&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\frac{\partial L}{\partial\mathbf{Y}_0}&lt;br /&gt;
=\frac{\partial L}{\partial\mathbf{Y}_L}\prod_{l=1}^{L}\left(\mathbf{I}+\mathbf{J}_l\right).&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
For $L=2$ the product reads&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\left(\mathbf{I}+\mathbf{J}_2\right)\left(\mathbf{I}+\mathbf{J}_1\right)&lt;br /&gt;
=\mathbf{I}+\mathbf{J}_1+\mathbf{J}_2+\mathbf{J}_2\mathbf{J}_1,&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
and the same holds for general $L$: every product of $k$ Jacobians appears once. In particular the term with $k=0$ is $\mathbf{I}$, so a gradient can travel from block $L$ to block $0$ through the identity alone, without being multiplied by any $\mathbf{J}_l$.&lt;br /&gt;
&lt;br /&gt;
A plain stack has no such term. With $\mathbf{Y}_l=F_l(\mathbf{Y}_{l-1})$,&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\frac{\partial\mathbf{Y}_L}{\partial\mathbf{Y}_0}=\prod_{l=1}^{L}\mathbf{J}_l,&lt;br /&gt;
\qquad&lt;br /&gt;
\left\|\prod_{l=1}^{L}\mathbf{J}_l\right\|\le\kappa^{L}\ \text{ if }\ \left\|\mathbf{J}_l\right\|\le\kappa&amp;lt;1,&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
which is the vanishing-gradient problem: the factor decays geometrically with depth.&lt;br /&gt;
&lt;br /&gt;
== Placement ==&lt;br /&gt;
&lt;br /&gt;
2 placements are in use. They differ in whether LN sits on the residual path or inside the branch,&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Post-LN&lt;br /&gt;
! Pre-LN&lt;br /&gt;
|-&lt;br /&gt;
| $\mathbf{X}^{(l+1)}=\operatorname{LN}\left(\mathbf{X}^{(l)}+\operatorname{SL}\left(\mathbf{X}^{(l)}\right)\right)$&lt;br /&gt;
| $\mathbf{X}^{(l+1)}=\mathbf{X}^{(l)}+\operatorname{SL}\left(\operatorname{LN}\left(\mathbf{X}^{(l)}\right)\right)$&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
With $\mathbf{D}_l$ the Jacobian of the LN, the 1-step Jacobians are&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\text{Post-LN: }\ \frac{\partial\mathbf{X}^{(l+1)}}{\partial\mathbf{X}^{(l)}}=\mathbf{D}_l\left(\mathbf{I}+\mathbf{J}_l\right),&lt;br /&gt;
\qquad&lt;br /&gt;
\text{Pre-LN: }\ \frac{\partial\mathbf{X}^{(l+1)}}{\partial\mathbf{X}^{(l)}}=\mathbf{I}+\mathbf{J}_l\mathbf{D}_l .&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
In Post-LN the term of the product that carries no $\mathbf{J}$ is $\prod_{l=1}^{L}\mathbf{D}_l$, so the identity path is rescaled at every layer. In Pre-LN that term is $\mathbf{I}$ itself, and LN acts only inside the branch: the residual stream keeps its scale, and a final LN is applied before the output head, since no block normalises it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Consequence&amp;#039;&amp;#039;&amp;#039;: at initialisation Post-LN produces large expected gradients for the parameters near the output, so a large learning rate there is unstable and a warm-up phase is needed; Pre-LN keeps those gradients bounded and trains without 1.&amp;lt;ref&amp;gt;{{#cite:Q3281}}&amp;lt;/ref&amp;gt; The original Transformer is Post-LN, trained with a warm-up phase.&amp;lt;ref&amp;gt;{{#cite:Q3130}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
{{Hidden example}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Setup&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Let $d=3$, $T=1$, $\vec x=(1,2,3)^{\top}$, $\vec\gamma=\mathbf{1}$, $\vec\beta=\vec 0$, $\epsilon=0$, and let the sub-layer be the cyclic shift&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\mathbf{W}=&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
0&amp;amp;1&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;1\\&lt;br /&gt;
1&amp;amp;0&amp;amp;0&lt;br /&gt;
\end{pmatrix},&lt;br /&gt;
\qquad&lt;br /&gt;
\operatorname{SL}(\vec x)=\mathbf{W}\vec x .&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Statistics of the input&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\mu=2,&lt;br /&gt;
\qquad&lt;br /&gt;
\sigma^{2}=\frac{(1-2)^{2}+0^{2}+(3-2)^{2}}{3}=\frac{2}{3},&lt;br /&gt;
\qquad&lt;br /&gt;
\sigma\approx0.8165,&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\operatorname{LN}(\vec x)\approx&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
-1.2247\\&lt;br /&gt;
0\\&lt;br /&gt;
1.2247&lt;br /&gt;
\end{pmatrix}.&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Post-LN&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\vec x+\operatorname{SL}(\vec x)=&lt;br /&gt;
\begin{pmatrix}1\\2\\3\end{pmatrix}+&lt;br /&gt;
\begin{pmatrix}2\\3\\1\end{pmatrix}=&lt;br /&gt;
\begin{pmatrix}3\\5\\4\end{pmatrix},&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
with $\mu=4$ and $\sigma^{2}=\frac{2}{3}$, hence&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\operatorname{LN}\left(\vec x+\operatorname{SL}(\vec x)\right)\approx&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
-1.2247\\&lt;br /&gt;
1.2247\\&lt;br /&gt;
0&lt;br /&gt;
\end{pmatrix}.&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pre-LN&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\operatorname{SL}\left(\operatorname{LN}(\vec x)\right)\approx&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
0\\&lt;br /&gt;
1.2247\\&lt;br /&gt;
-1.2247&lt;br /&gt;
\end{pmatrix}&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
so&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\vec x+\operatorname{SL}\left(\operatorname{LN}(\vec x)\right)\approx&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
1\\&lt;br /&gt;
3.2247\\&lt;br /&gt;
1.7753&lt;br /&gt;
\end{pmatrix}.&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gradient through 10 blocks&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
With $\mathbf{J}_l=j\mathbf{I}$ and $j=0.1$,&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
j^{10}=1\cdot10^{-10},&lt;br /&gt;
\qquad&lt;br /&gt;
\left(1+j\right)^{10}\approx2.59,&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
which is the factor that multiplies a gradient on its way from block 10 back to block 0.&lt;br /&gt;
{{End hidden}}&lt;/div&gt;</summary>
		<author><name>RonzzWikiCowriterAI</name></author>
	</entry>
</feed>