Equation 19 · How Llama's Architecture Actually Works, Generation by Generation
What does this equation mean?
Read the formula alongside the article passage below. Each part has a deeper page with its role in the equation, the supporting passage and nearby citations.
This equation states an equality: the expressions on both sides have the same value under the article’s assumptions. Read the equation part by part below; each part has a contextual explanation and a link to its mathematical background.
Read it piece by piece
Symbol x
x is an argument of the function-like quantity on the left; its role is set by that function’s stated inputs.
Symbol j
j occurs above the fraction bar. The numerator is divided by the entire denominator below it.
Symbol x_j
occurs above the fraction bar. The numerator is divided by the entire denominator below it.
Symbol g_j
is one of the signed contributions combined to compute the quantity on the left.
Symbol d
d occurs below the fraction bar. The quantity above the bar is divided by this expression; zero is excluded as a denominator.
Symbol k
k appears in the bound of this sum. The bound states where the repeated operation starts, ends, or which values it includes.
Symbol x_k^2
is one of the signed contributions combined to compute the quantity on the left.
Symbol epsilon
epsilon is one of the signed contributions combined to compute the quantity on the left.
=
The expressions on both sides represent the same quantity under the stated assumptions.
See an illustrated explanation →subscript
The lower label selects a particular version, component, or indexed member of the quantity. For example, x₀ and xₜ can be values at different positions.
superscript
A raised number can be a power. When it is a label or bound, it selects a case or the upper limit of a sum; the formula’s structure distinguishes these uses.
See an illustrated explanation →Denominator: RMS(x)
The complete quantity below the fraction bar; it must be nonzero for this division.
Starting index or lower bound: k=1
This label says where the repeated addition, multiplication, or accumulation starts. Read its value or condition together with the article’s description of the index.
Ending index or upper bound: d
This label says where the repeated addition, multiplication, or accumulation stops. It sets the last term or end of the range.
How to interpret it
With a fixed numerator, increasing a nonzero denominator reduces the fraction. Read it with the definitions, units, and assumptions supplied by the article.
What the article says around this equation
RMSNorm, from Zhang and Sennrich, made a narrower and more surgical change to normalization. Standard LayerNorm re-centres a layer’s inputs to zero mean and rescales to unit variance before applying a learned gain. Zhang and Sennrich’s hypothesis, tested empirically, was that the re-centring step is not doing useful work — that rescaling invariance alone accounts for LayerNorm’s benefit — and their RMSNorm drops the mean-subtraction entirely: . Their reported result was performance comparable to LayerNorm at a running-time reduction of roughly seven to sixty-four percent depending on the model, purely from removing the mean and its gradient computation [ 7 ] . Llama 2’s…
Read the full surrounding passage
RMSNorm, from Zhang and Sennrich, made a narrower and more surgical change to normalization. Standard LayerNorm re-centres a layer’s inputs to zero mean and rescales to unit variance before applying a learned gain. Zhang and Sennrich’s hypothesis, tested empirically, was that the re-centring step is not doing useful work — that rescaling invariance alone accounts for LayerNorm’s benefit — and their RMSNorm drops the mean-subtraction entirely: . Their reported result was performance comparable to LayerNorm at a running-time reduction of roughly seven to sixty-four percent depending on the model, purely from removing the mean and its gradient computation [ 7 ] . Llama 2’s architecture section lists RMSNorm as the pre-normalization scheme applied before each attention and feed-forward sublayer, and it has not been revisited in any subsequent generation’s public documentation [ 1 ] .
Sources cited in the surrounding passage
These citations give research context. Read each source to check which claims it supports.
Return to How Llama's Architecture Actually Works, Generation by Generation