ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Rotate paired query coordinates using a position-dependent angle

rotate_half maps a pair of coordinate blocks(x 1,x 2) to(−x 2,x 1). Multiplication by cosine and addition of the sine-weighted rotated vector implements a two-dimensional rotation for each coordinate pair. The surrounding interleave-to-block reshape determines which…

Donor architecture mathematicshistorical source recovered; expression not executed in this website audit
Learn with the Atlas

Learn to read this model

Start with the symbols, follow the operations, and check what the result means.

Open guided lesson
donor-deepseek-rotary-querydocumented formula or resource estimate
qout=q∗cos+rotatehalf(q)∗sinq_out = q*cos + rotate_half(q)*sin

Read the equation

rotate_half maps a pair of coordinate blocks(x 1,x 2) to(−x 2,x 1). Multiplication by cosine and addition of the sine-weighted rotated vector implements a two-dimensional rotation for each coordinate pair. The surrounding interleave-to-block reshape determines which coordinates are paired. Norm is preserved when the paired sine/cosine coefficients have unit squared sum.

Terms & definitions

TermMeaning in this source
q

Query vector after source-prescribed pairing

cos

Cosines for the token position

sin

Sines for the token position

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
APPLICATION
      rotate_half(x) splits the last dim in half and returns concat(-x2, x1).
      apply_rotary_pos_emb indexes cos/sin by position_ids and computes
          q_out = q*cos + rotate_half(q)*sin
      after an interleave-to-blocked reshape: (b, h, d) -> (b, h, d/2, 2)
      -> transpose(4,3) -> reshape back. Get that reshape wrong and the model
      produces fluent nonsense rather than an obvious error.
Exact original notation
q_out = q*cos + rotate_half(q)*sin

Related builds

Sources & provenance

01
DEEPSEEK_R1_COMPLETE.txt
lines 969–969 · Aug 5, 2026
q_out = q*cos + rotate_half(q)*sin
02
DEEPSEEK_R1_COMPLETE.txt
lines 969–969 · Aug 5, 2026
q_out = q*cos + rotate_half(q)*sin

Search equations, builds, manuscript text, and recovered sources.