RoPE and context extension: the math of Position Interpolation, NTK-aware scaling and YaRN

How can a language model trained on 4096 tokens read a text of 64 thousand? A derivation of Rotary Position Embedding (RoPE), frequencies and wavelengths, why extrapolation fails, Position Interpolation, NTK-aware scaling, Dynamic NTK, NTK-by-parts, YaRN’s attention temperature, and experiments with a small Transformer. Keywords: RoPE, Rotary Position Embedding, context extension, context window, Position Interpolation, PI, NTK-aware scaling, NTK-by-parts, Dynamic NTK, YaRN, attention temperature, positional encoding, extrapolation, interpolation, long context, Code Llama, DeepSeek-V3, large language models, deep learning

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-12-02
DOI
https://doi.org/10.5281/zenodo.24762261
Primary Topic
Topic Modeling
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

RoPE and context extension: the math of Position Interpolation, NTK-aware scaling and YaRN

Mehmet Emin YAYLA
Zenodo (CERN European Organization for Nuclear Research)
Topic Modeling
article

RoPE and context extension: the math of Position Interpolation, NTK-aware scaling and YaRN

Mehmet Emin YAYLA
article en

Abstract

How can a language model trained on 4096 tokens read a text of 64 thousand? A derivation of Rotary Position Embedding (RoPE), frequencies and wavelengths, why extrapolation fails, Position Interpolation, NTK-aware scaling, Dynamic NTK, NTK-by-parts, YaRN’s attention temperature, and experiments with a small Transformer. Keywords: RoPE, Rotary Position Embedding, context extension, context window, Position Interpolation, PI, NTK-aware scaling, NTK-by-parts, Dynamic NTK, YaRN, attention temperature, positional encoding, extrapolation, interpolation, long context, Code Llama, DeepSeek-V3, large language models, deep learning

Zenodo (CERN European Organization for Nuclear Research)
Topic Modeling
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon