Skip to the gist
aiBytes_

← Back to Sun, Nov 15

Hacker NewsFirst covered 15 Nov 2026HN front page

Understanding Positional Embeddings in Modern LLMs

Source

Sebastian Raschka walks through how LLMs encode token order, from GPT-2's learned position vectors to RoPE, with PyTorch code and a survey of what 2026 open-weight models use.

Stats

(As of 17 Nov 2026)
Points
245
Comments
27
Submitted by
vismit2000
Posted
1d
  • Attention with no position signal treats reordered words the same; a causal mask adds some implicit order but says nothing about distance.
  • GPT-2 adds a learned position vector to each token embedding, which caps its context at the 1,024 positions in that table.
  • Growing that table to around 100k positions would make it over 22% of GPT-2 Medium's weights, one reason newer models drop the approach.
  • The original 2017 transformer used fixed sine and cosine encodings, an idea that returns as the basis for RoPE.
  • Recent models such as MiniMax-M3 apply RoPE inside every attention layer rather than once at the input; the piece also covers NoPE.

Appeared in

15 Nov 202616 Nov 2026

More from Sun, Nov 15

HiringNow

Polls 247,000+ company career sites every 5 minutes, tailors your resume and cover letter per job, and applies on the employer's own site only after you approve.