Guide explains positional embeddings in modern LLMs
The article walks through how large language models add token position information, covering classic absolute embeddings, sinusoidal encodings, and the newer rotary positional encoding (RoPE). It compares GPT‑2, which adds a learned position vector to each token embedding before the first transformer block, with MiniMax‑M3, which injects RoPE inside each attention layer. Visual examples, a small…
Key points
- GPT‑2 adds a learned position vector to token embeddings before the first transformer block.
- MiniMax‑M3 uses RoPE inside attention layers for each transformer block.
- Extending GPT‑2 context from 1,024 to 100k tokens would increase positional weight share from 0.30% to 22%.
It also lists the positional‑embedding choices used in open‑weight models released in 2026, noting that GPT‑2’s 1,024 learned position vectors occupy only 0.30% of total weights, but expanding to a 100k context window would raise that share to 22%. Fixed sinusoidal encodings from the 2017 "Attention Is All You Need" paper are explained, as are the scaling factors applied to token embeddings. The piece is technical and assumes familiarity with transformer internals, and it points readers to related tutorials on tokenizers and self‑attention.
Understanding Positional Embeddings in Modern LLMs
Ahead of AI (Sebastian Raschka) · 15 November 2026
Loading the full article…
This text was published by Ahead of AI (Sebastian Raschka) and written by Sebastian Raschka, PhD. It is reproduced here with attribution so you can read it in full; the rights remain with the publisher. Read it at the source ↗
Coverage and discussion
1source- Hacker News discussion · 227 pointsnews.ycombinator.com
The headline, key points and digest above were generated by Digest AI's editorial model from the linked sources. Automated summaries can contain errors: the sources are the record. Spotted a mistake? Tell us. Published by Martin K., who runs Digest AI and handles corrections.
More in Generative AI & Models
All →- Cao: VAST's Tripo P2.0 Removes Topology Barrier · 1 src
- Huawei chip optimization: AscendGYM benchmark · 1 src
- Z.ai introduces GLM-5.4 with iterative depth for reasoning tasks · 2 src
- GPT-6.2 Astra and Sol score lower on transparency than Claude · 2 src
- OpenAI releases GPT-6.2 Astra and Sol; Google launches Gemini 4 Neon and free Gemini Tasks · 5 src
Comments
via GitHub Discussions