Research map / Large language models / Language, safety and interpretability
Exploring Context Window of Large Language Models via Decomposed Positional Vectors
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.
Decomposes LLM hidden states into semantic and mean-based positional vectors to analyze how positional information forms and drives context window extension, then proposes two training-free extension methods (positional vector replacement and attention window extension).
Problem
LLMs degrade in performance beyond their context window, and existing length extrapolation and context window extension methods lack an in-depth interpretation of their underlying mechanisms in hidden states.
Approach
Mean-based decomposition separates positional vectors from hidden states; analysis shows initial tokens act as anchors forming positional information, OOD positional vectors cause degradation beyond the window, and context window extension works by interpolating positional vectors via attention logit scaling. This yields two training-free extension methods that interpolate positional vectors.
Key results
- On PG-19, attention window extension (r=4, lambda=1.2) keeps PPL at 17.23 at 2K and 29.30 at 8K, while unmodified TL-Window reaches 660.51 at 8K.
- Positional vector replacement (r=5, alpha=1.3) reduces TL-NoPE PPL at 4K from over 1000 to 47.65, comparable to attention scaling (lambda=1.3 gives 43.84 at 4K).
- Dynamic NTK on TL-RoPE keeps PPL at 10.45 at 4K versus over 1000 without interpolation.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| extend the attention window and scale attention logits | TL-Window · PG-19 8K | PPL: 660.51 -> 29.30 | Helped |
| replace positional vectors with interpolated vectors | TL-NoPE · PG-19 8K | PPL: $>10^3$ -> 73.79 | Helped |
| apply Dynamic NTK | TL-RoPE · PG-19 8K | PPL: $>10^3$ -> 28.58 | Helped |
| use attention window extension rather than attention scaling | TL-Window and TL-NoPE · PG-19 8K | PPL: 46.59 -> 29.30 | Helped |
| increase positional-vector replacement interpolation from r=2, α=1.1 to r=5, α=1.3 | TL-NoPE · PG-19 4K | PPL: 15.58 -> 47.65 | Hurt |
| remove the positional vector from initial tokens 1–4 (ablation) | TL-NoPE · RedPajama | PPL: 7.56 -> >1000 | Hurt |
| remove the positional basis from initial tokens 1–4 (ablation) | TL-NoPE · RedPajama | PPL: 7.56 -> >1000 | Hurt |
| remove the semantic vector from initial tokens 1–4 (ablation) | TL-NoPE · RedPajama | PPL: 7.56 -> 8.20 | No clear effect |
| remove the positional basis from initial tokens 1–4 (ablation) | TL-RoPE · RedPajama | PPL: 6.06 -> >1000 | Hurt |
| remove the positional basis from initial tokens 0–4 (ablation) | Llama-3-8B · RedPajama | PPL: 6.74 -> >1000 | Hurt |
Surprising findings
- Positional vector replacement performs worse than attention scaling at 8K, which the authors attribute to a decreasing effective interpolation ratio across layers.
- Larger LLMs are less affected by removing positional vectors than smaller models, being more attuned to semantic information.
Limitations
- Analysis relies on small TinyLlama-based models trained by the authors, with mainstream LLMs all using RoPE.
- Proposed methods are validated only on the authors' own models, not on mainstream LLMs.
- Positional vector replacement degrades at 8K as the effective interpolation ratio decreases across layers.
Experimental setup
Datasets: RedPajama PG-19
Benchmarks: PG-19
Metrics: perplexity (PPL) cosine similarity of positional vectors
Baselines: Dynamic NTK Attention Scaling TL-RoPE TL-NoPE
Builds on: RoPE ALiBi NoPE Dynamic NTK attention scaling
Closest papers by meaning
- LongRoPE: Extending LLM Context Window Beyond 2 Million Tokens (ICML 2024 · similarity 0.91)
- Retrieval meets Long Context Large Language Models (ICLR 2024 · similarity 0.91)
- Why Does the Effective Context Length of LLMs Fall Short? (ICLR 2025 · similarity 0.91)
- An Efficient Recipe for Long Context Extension via Middle-Focused Positional Encoding (NeurIPS 2024 · similarity 0.90)
- YaRN: Efficient Context Window Extension of Large Language Models (ICLR 2024 · similarity 0.90)
- Long-Short Alignment for Effective Long-Context Modeling in LLMs (ICML 2025 · similarity 0.89)
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.
