YaRN ("Yet another RoPE extensioN", Peng et al. 2023) is the most successful technique in production for extending RoPE-based models to long context. Both Llama 3 and many community fine-tunes use YaRN or YaRN-shaped recipes.
The insight YaRN exploits
RoPE encodes position via sinusoids at many frequencies. The high-frequency dimensions (small θ) wrap around quickly — they're the ones that distinguish nearby positions. The low-frequency dimensions wrap slowly — they're the ones that distinguish far-apart positions, and therefore the ones that go off-distribution when you extend context.
Naive Position Interpolation rescales all frequencies uniformly, which works but compresses the local patterns the model already learned. NTK-aware scaling rescales only the low-frequency dimensions, leaving high-frequency dimensions alone. YaRN refines this further with a temperature-scaled attention modification that improves the result.
The receipts
YaRN demonstrated that LLaMA models could be extended from 4K → 128K context with about 10× fewer fine-tuning tokens than full retraining and 2.5× fewer training steps than prior interpolation methods. Llama 3 used a YaRN-style schedule to extend its 8K-trained base to a 128K context window in the released model card.