In one line: A free long explainer (about 40 minutes, 38 numbered figures, PyTorch code) that derives RoPE pair by pair on one eight-word sentence and checks its relative-offset property in code, then sorts the entries of the author's own LLM Architecture Gallery by position scheme: RoPE in every attention layer is still the most common choice but its share fell from 2025 to 2026, RoPE and NoPE mixes grew, most 2026 RoPE entries rotate only part of each head, and Inkling's learned relative bias is the one new design; the groups are small, as the author says.
How far to trust it: Correct wherever we recomputed it (every worked number, the table sizes, the parameter shares), and the clearest pair-by-pair RoPE derivation with code we know. Read Section 6 as a dated count over one curated gallery, and do not take its verdict on partial RoPE: it weighs only the cosine and sine tables, not the reasons models rotate part of a head. The evidence, judged.
The idea in one sentence: Raschka teaches position on one eight-word sentence: GPT-2 adds a position vector to each token once, RoPE instead rotates each pair of query and key numbers by its position so that a score depends only on how far apart two tokens are, and recent open models have started to rotate only part of each head, to skip RoPE in some layers, or (Inkling) to learn a bias on the score instead.
What this page is for. Everything the article teaches is already owned by Positional Encodings, which derives RoPE, measures five schemes on the tiny GPT and reads 74 configs. So this page does not teach the mechanism again. It follows the article's argument briefly, says what its framing adds (a hand-checkable worked pair, a three-line unit test, a dated census of 2026 models, a toy for how NoPE counts), judges where it is loose or weak, and lists what our owner page should take from it.
You need: what attention computes, scores q · k / √d, a softmax and a weighted sum of values (The transformer from zero); RoPE itself is on Positional Encodings, section 3.
New terms: split-half and interleaved pairing (which two numbers of a head RoPE turns together: i with i + d/2, or neighbours); partial RoPE (only some pairs of each head are rotated); NoPE layer (a layer with no explicit position signal; the causal mask still orders tokens); learned relative position bias (a number added to each score before the softmax that depends on the distance between query and key).
The article opens on two architectures side by side: GPT-2 adds position before the first block, MiniMax-M3 adds it inside attention, in every block. Its running example is "The red fox jumps over the gray fox" against "The gray fox jumps over the red fox": both "fox" tokens get the same embedding, and without positions attention cannot tell which fox jumps. It then makes the point our owner page makes with a permutation test, in one sentence: the causal mask already gives a decoder some order, but in one layer it does not distinguish a separation of one position from a separation of ten. Our page shows the same thing measured (NoPE's first block does not notice a shuffle, its second does) in Positional Encodings, section 1.
The learned table's cost is framed as a share of the model, which is a framing our page lacks. GPT-2 Medium's 1,024 position rows are 0.30% of its weights; stretched to a 100,000-token context they would make up >22% of the total. Recomputed here: 1,024 × 1,024 = 1.05M of about 355M is 0.30%, and 100,000 × 1,024 = 102.4M of 456M is 22.4% (derived, the parameter count from GPT-2 Medium's published size). Our page gives the cost in absolute terms (786,432 parameters in GPT-2) and the hard cap.
On the 2017 sinusoids, the article adds one reason we only measured. The Transformer multiplies token embeddings by √dmodel before adding the sinusoids, which its paper never explains; Raschka's reading is that it is meant to put the token embeddings and sinusoidal positional encodings on comparable scales at initialisation, and that GPT-2 needed no such factor because its code initialises token embeddings at standard deviation 0.02 and position embeddings at 0.01. That is his hypothesis, from a discussion, not a source. Our owner page has the measured consequence (the tiny GPT without the scale ends at 4.29 against 2.29), and Attention Is All You Need draws the sinusoids.
The core of the article is one feature pair worked by hand, small enough to check on paper. Query "the" at position 5 and key "fox" at position 2 both start as the pair (1, 5); at 20° per position the key turns 40° and the query 100°. Both keep length √26, they end 60° apart, and their exact dot product is 26 × cos 60° = 13. Move the key one place closer and the score becomes 26 × cos 40° ≈ 19.92; shift both tokens by three and it is 13 again. Our page's worked example (θ = 0.5, q = k = (1, 0), 0.5403 = cos 1) is the same derivation with numbers that are less memorable: Raschka's 13 and √26 are integers a reader can carry, and the sentence is the one the whole article is about.
The motivation is the system prompt, which is the best one-line answer to "why relative". Put 100 tokens in front of the sentence and "fox" and "the" move to 102 and 105, but a prefix of any length shifts both positions equally, so the pair's contribution stays 13. He adds the caveat our page leaves implicit: this holds for fixed unrotated vectors, and in a real model a new prefix of 100 tokens can change them, by changing what earlier layers attend to. RoPE makes the position part of a score invariant to the shift, not the whole score.
One loose end: after the single pair, the article prints whole eight-number vectors If we rotate all 4 pairs without giving their frequencies. Recomputed here, they use 20°, 2°, 0.2° and 0.02° per position for the four pairs, a base-10 version of the schedule that Section 4 then introduces with base 10,000 (which would give 1, 0.1, 0.01 and 0.001 radians). The numbers are right for that schedule; a reader recomputing them from Section 4 would not get them. Our page draws the whole head as a bank of clocks (its Fig. 4) and the RoFormer page the paper's eight-pair dials.
The code section is short, correct and better than ours in one respect: it ends with a test any implementation can run. rope_params returns two tables, cosine and sine of position × θi with θi = 10,000−2i/d, one row per position and one column per pair (1,024 × 64 for a 128-wide head), computed once and broadcast over the batch and every head; rope_split_half rotates pair (i, i + d/2) with them. Then, adding 3 to each position should change the positions but not the scores: the code recomputes the scores at positions + 3 and checks them with torch.testing.assert_close. Our page tells the reader to check a RoPE setup by comparing loss with a reference; the shift test is cheaper and catches position bugs (queries and keys rotated at mismatched positions, broken cosine and sine tables) before any loss is measured. It does not replace the loss check: a wrong base or pairing applied to both q and k still gives scores that depend only on the offset, so it passes, and convention errors are found only by comparing the loss against a reference.
Split-half against interleaved, shown as a permutation. The original paper and Meta's first LLaMA code pair neighbours (0, 1), (2, 3); most code now pairs i with i + d/2. Reordering the features as [0, 4, 1, 5, 2, 6, 3, 7] before the interleaved rotation gives identical outputs and scores, while applying the two layouts to the original vector gives different ones. Our page has the consequence measured (loading the wrong layout takes the tiny GPT's loss from 1.96 to 3.61 with no error) and Hugging Face's conversion permutation; the article's three asserts are the cleanest proof that the two layouts differ only by a reordering of WQ and WK.
Partial RoPE: MiniMax-M3 rotates 64 of each head's 128 numbers. Its config, read on 27 November 2026, says head_dim 128, rotary_dim 64 (partial_rotary_factor 0.5), rope_theta 5,000,000 and 1,048,576 positions. The article measures the gain by the tables: halving them at a 1M context saves 1,048,576 × 32 pairs × 2 tables × 2 bytes = 128 MiB in BF16, or 36 MiB in NVFP4 with its block scales (both rechecked here), while the KV cache still stores the full key. It cites the Fractional Rotation paper, where rotating around 10% of each head's features matched full RoPE in 1B to 8B models, and concludes that partial RoPE is hardly worth it. The arithmetic is right and the conclusion does not follow; see the next section.
NoPE layers: a toy for how the causal mask becomes a position. Suppose one value feature is 1 for "The" and 0 elsewhere, and a head attends uniformly to everything the mask allows. At "fox" (position 2) it averages three values and outputs 1/3, at "jumps" 1/4: the output feature equals one over the prefix length, which a later layer can read as a position. This is Kazemnejad et al.'s construction made concrete, and it is the mechanism behind what our owner page only measures (its probe finds absolute position in NoPE's middle blocks, R² 0.94 by block 3). The paper's 107M models generalised to longer inputs best with NoPE (NoPE ranked first overall across the ten tasks), but its 1.3B code model's predictions got worse at the longest lengths. Hence mixtures: SmolLM3 applies RoPE in three layers and skips it in the fourth, and its authors report better long context.
A learned relative bias returns, in Inkling. Thinking Machines' Inkling (975B parameters, 41B active, released 15 July 2026) adds a learned number to each score before the softmax that, in Raschka's description, depends on the query token's hidden state and on how far back the key is. T5's 2019 bias depended only on the bucketed distance. Thinking Machines' announcement says only that a relative positional embedding beat RoPE and extrapolated better; the dependence on the hidden state is the article's reading and was not checked here (unconfirmed).
The census, from his own gallery. Sorting the entries of his LLM Architecture Gallery (snapshot of 9 November 2026) by release date: RoPE in every softmax attention layer is still the most common choice, but its share fell from 2025 to the first half of 2026 and again in the second half; RoPE and NoPE mixes grew; every NoPE-only entry is a recurrent hybrid; and among RoPE entries, partial RoPE became more common from 2025 to 2026, from a minority to a majority. He adds that the groups are still small. The exact shares are only in his bar charts, so they are not quoted here. His forecast: RoPE stays dominant and I think this will carry over into 2027, perhaps with more Inkling-like designs.
The mechanics are correct wherever we recomputed them. The rotated pairs (−2.448, 4.473) and (−5.098, 0.117), the dot products 13 and 19.92, the frequencies 1, 0.1, 0.01 and 0.001 for d = 8, the 0.30% and 22% shares, and the 128 MiB and 36 MiB table savings all come out as printed (closed block below). The code is the standard split-half RoPE and its asserts hold by the algebra our owner page derives. For an explainer this is the main test, and it passes.
Where it simplifies or is loose (none of it changes what a reader learns about the mechanism):
The weak spot is the verdict on partial RoPE. The article weighs it only by the cosine and sine tables (point behind partial RoPE? It saves some memory), finds the saving small, and calls the technique hardly worth it. The saving is indeed negligible, and showing that is useful, because the Fractional Rotation paper itself advertises up to 10× savings of the "RoPE cache". But the tables are not why models rotate part of a head:
Read the census as a dated count over one curated gallery. The gallery is Raschka's own selection of notable open models, each card counted once (so each gallery card counts once, so multiple variants of one family can count several times), split into three small groups. The directions (full RoPE falling, mixes and partial RoPE rising) are consistent with the variants our owner page read from configs in October (partial RoPE in GLM-4.5, Qwen3-Next and Gemma 4; NoPE layers in Llama 4, SmolLM3 and Command A), though that page counted no trend; the sizes of the shifts are not a measurement of the field. The Inkling description goes beyond what its maker has published (above).
The appendix (added 19 November) has one wrong attribution. Its 1.3B zero-shot comparison, ALiBi 43.70, rotary 41.46, learned 41.71 on 112B tokens of OSCAR, is credited to the ALiBi paper; it is Table 2 of Le Scao et al. 2022 (BigScience), the study that chose ALiBi for BLOOM. The WikiText-103 numbers beside it (rotary 20.07 at 512 tokens rising to 31.58 at 2,512; ALiBi 19.73 falling to 18.41) are the ALiBi paper's, as stated.
Verdict. Believe it and use it as the gentlest correct derivation of RoPE with code; take the census as one author's dated view of the trend; replace its partial-RoPE verdict with the reasons above.
No rebuttal, replication or Hacker News thread was found (web search, 27 November 2026); for an explainer that is expected. The post's own comment thread had 16 comments, 280 likes and 31 restacks that day (a dated reading). Three comments add something, and the author added an appendix:
Asks whether a quality reason or legacy code explains partial RoPE in 2026 models. The author answers that he knows of no study; two readers then point to MLA, where rotating only a small decoupled key lets the compressed latent stay compressed (the key up-projection can be absorbed into the query). That is the better reason, and the knowledge base already teaches it.
When Llama 3.1 shipped with rope_type llama3, older transformers versions refused it, and a workaround rewrote it as dynamic, which loads but runs a different scaling. The author replies that this scaling took him a long time to get right in LitGPT.
Points to Gopalakrishnan et al.'s polar coordinate positional embedding (arXiv 2509.10534, v3 June 2026), which argues RoPE entangles what and where; another reader notes its code is released. The author did not reply by 27 November.
Adds ALiBi, YaRN and the published comparisons, with each method's numbers. One attribution in it is wrong: the 1.3B zero-shot ablation (ALiBi 43.70, rotary 41.46, learned 41.71) is Table 2 of Le Scao et al. 2022, not of the ALiBi paper.
It contradicts nothing our pages say about the mechanism; it adds a few things our owner page should take, and dates one table.
Read on 27 November 2026: the post (fetched that day; published 15 November 12:10 UTC per its page data, about 9,200 words with code, 40 minutes at 230 words a minute); the appendix page in full; all 16 comments through Substack's comment endpoint; MiniMax-M3's config.json; the abstracts of arXiv 2603.11611 (Fractional Rotation, v2 15 October 2026) and 2509.10534 (PoPE); Thinking Machines' Inkling announcement; Table 2 of arXiv 2210.15424 and the WikiText-103 extrapolation tables of arXiv 2108.12409 (ALiBi, appendix), for the appendix's numbers. Every number in the closed block above was recomputed in Python.
The first archived copy (Wayback, 15 November 12:15 UTC) is a script shell without the post's text, so the post could not be diffed against it; the known change is the 19 November appendix, announced by the author in the comments. No Hacker News or Lobsters thread was found. Commenters are not named here: they are readers, not authors of published responses.
Every link opens in a new tab; links checked 27 November 2026. Reading time of the resources below: 6h 04m.
Sebastian Raschka: The post itself (Ahead of AI (magazine.sebastianraschka.com), published 15 November 2026, updated 19 November 2026). Sections 3 to 5 are the derivation and the code; Section 6 is the survey of 2025 and 2026 models.
(40 min)
Sebastian Raschka: Added 19 November: token lookups and the causal mask worked in numbers (A, B), the published comparisons of learned against sinusoidal, RoPE against ALiBi and the NoPE ranks (C), and YaRN pair by pair (D).
(15 min)
a reader, Substack comments, 16 November 2026, reader comment: Asks whether a quality reason or legacy code explains partial RoPE in 2026 models. The author answers that he knows of no study; two readers then point to MLA, where rotating only a small decoupled key lets the compressed latent stay compressed (the key up-projection can be absorbed into the query). That is the better reason, and the knowledge base already teaches it.
(3 min)
a reader, Substack comments, 16 November 2026, reader comment: When Llama 3.1 shipped with rope_type llama3, older transformers versions refused it, and a workaround rewrote it as dynamic, which loads but runs a different scaling. The author replies that this scaling took him a long time to get right in LitGPT.
(1 min)
a reader, Substack comments, 18 November 2026, reader comment: Points to Gopalakrishnan et al.'s polar coordinate positional embedding (arXiv 2509.10534, v3 June 2026), which argues RoPE entangles what and where; another reader notes its code is released. The author did not reply by 27 November.
(40 min)
Sebastian Raschka, 19 November 2026, author's addendum: Adds ALiBi, YaRN and the published comparisons, with each method's numbers. One attribution in it is wrong: the 1.3B zero-shot ablation (ALiBi 43.70, rotary 41.46, learned 41.71) is Table 2 of Le Scao et al. 2022, not of the ALiBi paper.
(15 min)
Su et al., 2021 (maker): The RoPE paper; the article's Section 3 follows its Section 3.3 with smaller numbers and the split-half layout instead of the paper's interleaved one.
(40 min)
Kazemnejad et al., 2023 (maker): NoPE: the construction behind the article's 1/prefix-length toy in Section 6.2, the ten-task length-generalisation ranking (NoPE first) and the 1.3B code model that degrades at the longest lengths.
(40 min)
Khan, Gummadi, Gupta, Ravichander, 2026 (maker): The paper behind Section 6.1: rotating about 10% of each head converged like full RoPE in their runs; NoPE alone can cause loss spikes, which minimal RoPE or QK-Norm mitigate. It frames the gain as RoPE-cache memory, which the article shows is small.
(35 min)
Barbero et al., 2024 (third-party analysis): The quality argument for partial RoPE the article leaves out: Gemma uses the fastest pairs for positional patterns and prefers the lowest frequencies, which the authors suspect carry semantic information.
(40 min)
Le Scao et al. (BigScience), 2022 (maker): The true source of the appendix's 1.3B zero-shot comparison of learned, rotary and ALiBi positions (Table 2), which chose ALiBi for BLOOM.
(30 min)
Sebastian Raschka: The curated set of model cards that Section 6.4 counts (snapshot of 9 November 2026).
(20 min)
Sebastian Raschka: RoPE inside a complete model with real weights, in the same split-half code as Section 5.
(45 min)
The owner of everything this article teaches, measured on the tiny GPT and read from 74 configs: the four answers, RoPE as a bank of clocks, partial and decoupled RoPE, NoPE layers, what breaks past the trained length and every scaling method.
The RoPE paper page: eight-pair dials, the shift test on trained weights, the long-term decay figure rebuilt.
The sinusoidal encoding of the article's Section 2.2, with a heatmap and a toy retrained without positions.
MLA and why its RoPE key is decoupled: the reason for partial rotation that the article's Section 6.1 misses.
Our page on the gallery the article counts, with Inkling's and MiniMax-M3's entries.
T5's bucketed relative bias, the older form of the bias Inkling learns.
This page is one of the Articles: articles worth a page of their own, each with its argument, its evidence judged and what others replied.