DigestAI news desk

Cut through the AI noise.

Generative AI & Models34 min read

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…

1 source HN 227

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.

Full story from Ahead of AI (Sebastian Raschka) · by Sebastian Raschka, PhDOpen source ↗

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
Topics · follow one to build your own front page

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.

Comments

via GitHub Discussions

More in Generative AI & Models

All →

Related stories