NTK-aware Scaling › Comparing NTK to Position Interpolation

Michael BrenndoerferUpdated July 1, 20253 min read
Language AI HandbookAll chapters
Part 18 of 67Long Context
Chapter 128NTK-aware Scaling › Comparing NTK to Position Interpolation
Reading section 8 of 14 · Comparing NTK to Position Interpolation · 3 minSection 8 of 14 · 3 min

Book contents

Section 8 of 14 · 3 min read

NTK-aware Scaling › Comparing NTK to Position InterpolationOne section · Sections in this chapter8 / 14 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Let's directly compare how well each method preserves the relative position encoding properties. The key metric here is how closely the scaled methods track the original RoPE behavior as a function of relative position offset. A method that perfectly preserved all properties would have zero deviation everywhere:

Out[26]:
Visualization
Line plot of dot product values vs relative position for original, Position Interpolation, and NTK-aware methods.
Dot product between rotated vectors as a function of relative position. The original RoPE curve shows strong sensitivity to position differences.
Line plot showing deviation from original dot product values for both scaling methods.
Deviation from original behavior. NTK-aware scaling (triangles) stays closer to zero, especially at small relative positions, indicating better preservation of learned patterns.

The deviation plot (right) makes the advantage clear: NTK-aware scaling maintains smaller deviations from the original behavior, particularly for small relative positions where local attention patterns matter most.

The deviation for NTK-aware scaling starts near zero at relative position 0 and grows slowly, while Position Interpolation's deviation is larger throughout. This quantifies the intuition we built earlier: NTK-aware scaling is more faithful to the original model's behavior for nearby tokens, which is exactly what we need for precise local attention.

One way to think about this: Position Interpolation is like translating a document with Google Translate and then running spell-check. The translation changes every word, and the spell-checker doesn't know which original word each new word was supposed to correspond to. NTK-aware scaling is like translating only the technical jargon while leaving everyday words unchanged, a more targeted intervention that preserves more of the original meaning.