Self-attention

Pinned implementation and paper LDLM @ e18c42a, not yet public · arXiv:2605.07933v1 · OpenWebText · 1024 · checkpoint, tokenizer and saved statistics not verified · How to read

Token decoder › 3 blocks › Self-attention

Rotary table

×

no parameters

The cosine and sine of every position’s angle for each pair of head features.

Rt,j=(cos⁡tθj,  sin⁡tθj){\htmlData{light=rotary}{{\htmlClass{vl-stream-context}{R_{t,j}}}}}=\big(\cos t\theta_j,\;\sin t\theta_j\big)
θj=10,000−2j/64\theta_j=10,000^{-2j/64}
out
RR [T positions, 32 pairs, 2 cos, sin]

One table serves every block of the network; it is computed once per sequence length and kept.

Sources2

Direct evidence

The rotary table: angles from positions and inverse frequencies of base 10,000, computed in float32; queries and keys are rotated and values take the identity.

The implementation, pinned at revision e18c42acdfb7, not yet public

Direct evidence

The token decoder: a rotary table, the configured number of blocks, and a linear readout to the vocabulary without bias.

The implementation, pinned at revision e18c42acdfb7, not yet public