Read the equation
Add the block input saved in residual to the output of the intervening transformation. Both operands must have the same residual-stream shape. The same expression appears around attention and feed-forward transformations; source occurrences identify which transformation produced hidden_states.
Terms & definitions
The recovered passage does not supply a separate symbol table. Read the source context for the notation used in this version; familiar letters may carry different meanings in other builds.
How it works
Read the definition from its right-hand expression to the quantity on the left. Its surrounding source records the intended input, state, or parameter context. Where the source leaves an operation unspecified, this page preserves that gap.
Assumptions & limits
Source recovery establishes that the expression appears in this record. Its mathematical validity, implementation behavior, and interpretation must be assessed separately. See the linked source and research notes for the checks available for this version.
Original context
Read the surrounding source passage
hidden_states = self.attention_qkvpacked(hidden_states, cu_seqlens,
max_seqlen, rope_freqs_cis)
hidden_states = residual + hidden_states
residual = hidden_states
hidden_states = self.norm1(hidden_states)Exact original notation
hidden_states = residual + hidden_states