Equation 18 · 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 mathematical expression combines the displayed quantities; its precise role follows from the surrounding article text. 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 d
d is a part of this expression. Its role is fixed by the surrounding article and by the operations shown in the formula.
How to interpret it
Read this expression with the definitions, units, and assumptions supplied by the article.
What the article says around this equation
Two independent linear projections of the residual stream are formed; one is passed through the gate and multiplied element-wise ( ) against the other; the product is projected back down. Shazeer’s own results reported the gated variants outperforming the plain ReLU feed-forward block across the language modelling and fine-tuning tasks tested, at matched parameter and compute budgets [ 6 ] . Because the gate consumes an extra weight matrix, Llama’s feed-forward hidden dimension is set below the naive 4d multiplier used in the original transformer, to hold total parameters roughly constant against a non-gated block of the same width — an accounting detail visible in the hyperparameter…
Read the full surrounding passage
Two independent linear projections of the residual stream are formed; one is passed through the gate and multiplied element-wise ( ) against the other; the product is projected back down. Shazeer’s own results reported the gated variants outperforming the plain ReLU feed-forward block across the language modelling and fine-tuning tasks tested, at matched parameter and compute budgets [ 6 ] . Because the gate consumes an extra weight matrix, Llama’s feed-forward hidden dimension is set below the naive 4d multiplier used in the original transformer, to hold total parameters roughly constant against a non-gated block of the same width — an accounting detail visible in the hyperparameter tables of Meta’s own papers rather than a claim requiring independent verification here.
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