atlas

Research map / Large language models / Instruction and fine-tuning

Scaling Laws of RoPE-based Extrapolation

ICLR 2024 · Large language models › Instruction and fine-tuning · approach: Efficient LLM fine-tuning systems · 3 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Shows that fine-tuning RoPE-based LLaMA2 with either smaller or larger rotary bases (vs. 10000) at the training length improves extrapolation, and explains this with a periodic "scaling law" and a critical dimension.

Problem

RoPE-based LLMs fail to extrapolate beyond their training context length; prior work adjusts the rotary base only upward, and the relationship between base, tuning length, and extrapolation limit is not understood.

Approach

Fine-tuning with both smaller and larger rotary bases improves extrapolation; a periodic view yields theorems linking the base to the extrapolation upper bound (larger bases) or to a monotone improvement (smaller bases), and a critical dimension where RoPE rotary periods exceed the training length explains the failure.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
fine-tune with RoPE base=500 instead of base=1000000LLaMA2 7B · Books3, 1Mperplexity: 4914.81 -> 51.28Helped
add log-scaled attention to RoPE base=500 (ablation)LLaMA2 7B with RoPE base=500 · Books3, 1Mperplexity: 51.28 -> 19.07Helped
increase RoPE base from 500 to 1000000LLaMA2 7B · Books3, 128Kperplexity: 9.49 -> 7.07Helped
increase RoPE base from 500 to 1000000LLaMA2 7B · Books3, 256Kperplexity: 12.41 -> 76.82Hurt
increase RoPE base from 500 to 1000000LLaMA2 7B · Books3, 512Kperplexity: 23.99 -> 1755.87Hurt
fine-tune with a smaller RoPE base, such as 500LLaMA2 7B · Books3, 1Mperplexity: 4914.81 -> 51.28Helped
trim the final 36 dimensions of query and key vectors before fine-tuning (ablation)LLaMA2 7B · extrapolation beyond 20KperplexityHelped
set a max index of 4096 for the final 36 dimensions (ablation)LLaMA2 7B query and key vectors · long-context extrapolationattention score variationHelped
fine-tune with RoPE base=500 instead of base=10000LLaMA2 · extrapolation beyond training contextperplexityHelped
fine-tune with a larger RoPE baseLLaMA2 · within the extrapolation upper boundperplexityHelped
fine-tune with a larger RoPE base beyond its extrapolation upper boundLLaMA2 · beyond the extrapolation upper boundperplexityHurt

Surprising findings

Limitations

Experimental setup

Datasets: The Pile Books3

Benchmarks: Books3 validation perplexity Lambada SuperGLUE Hellaswag PIQA Winogrande OBQA NQ TriviaQA TruthfulQA ARC MMLU

Metrics: perplexity accuracy

Baselines: Linear PI NTK fixed Dynamic NTK Code LLaMA

Builds on: RoPE NTK-aware scaling Dynamic NTK Linear Position Interpolation

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy