Partial RoPE: rotating only part of each head
If position helps attention, why give it to only part of each head? What might the remaining coordinates be useful for?
A head is looking for an earlier mention of “Alice”. It might be in the last sentence, or a thousand tokens back.
Distance changes every match
With RoPE, every pair of query and key coordinates turns with position. So the same word, seen from further away, lines up less well with itself.
That is what we want for position. But this head only cares whether it is the same word. Far away, the rotation hides a match that should be perfect.
Leave some pairs still
What if only some of the pairs turned? The rest would compare pure content, the same at any distance, while the rotated pairs still say how far apart the tokens are.
Rotate half the pairs, and a match can never fall below half, however far back it is. This is partial RoPE: each head keeps a share of its coordinates free of position.
Models choose the share
GLM-4.5 and MiniMax-M2 rotate half of each head. Qwen3-Next rotates 64 of its 256 coordinates, a quarter.
Latent attention does the same for another reason. Its compressed keys cannot be rotated per position, so a small separate part of each key carries the rotation. DeepSeek-V4 rotates only the last 64 of 512.
If some coordinates can do without position, could a whole layer? Next, NoPE.
Sources and assumptions
- GPT-J rotates 64 of each head’s 256 coordinates, and GPT-NeoX-20B a quarter of each head (rotary percentage 0.25).
- Shares for GLM-4.5, MiniMax-M2, Qwen3-Next and DeepSeek-V4 come from their
config.jsonfiles, listed on each model’s architecture page. - Round and Round We Go! What makes Rotary Positional Encodings useful?, Barbero and colleagues, 2024, for why some coordinates are better left free of position.
The charts use one 64-wide head (32 pairs) with RoPE’s usual base of 10,000. The query and key are the same vector, with its content spread evenly over the pairs, so their match at a given distance is the average of cos(distance × speed) over the rotated pairs, plus one for every pair left still, divided by the number of pairs. As in implementations, the rotated pairs’ speeds are spread over the rotated width only. Each plotted point averages the match over the next 50 tokens, because the fastest pairs swing on every token; the numbers in the captions and notes are unsmoothed. Real heads need not spread content evenly; a head can also put a match in the slowest pairs, which barely turn.