Research map / Architectures and efficiency / Attention and transformers
Randomized Positional Encodings Boost Length Generalization of Transformers
Anian Ruoss, Grégoire Delétang, Tim Genewein, Jordi Grau-Moya, Róbert Csordás, Mehdi Bennani, Shane Legg, Joel Veness
Google DeepMind · The Swiss AI Lab
Read the paperPlace an idea next to itCheck your own paper ↗
AI-extracted. The measured effects below were read by AI from the paper's full text (no summary yet). Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| randomize positional encodings (sampled up to L=2048) | relative PE · Reverse String | accuracy: 58.3 -> 95.1 | Improved |
| randomize positional encodings | relative PE · Missing Duplicate | accuracy: 54.0 -> 100.0 | Improved |
| randomize positional encodings | sin/cos PE · Even Pairs | accuracy: 50.9 -> 100.0 | Improved |
| randomize positional encodings | all PE schemes, 15 tasks · algorithmic reasoning suite (avg over tasks) | accuracy: +12.0% on average, up to 43.5% | Improved |
| randomize positional encodings | ALiBi · Even Pairs | accuracy: 67.3 -> 81.5 | Improved |
| randomize positional encodings | relative PE · Binary Multiplication | accuracy: 52.2 -> 50.1 | No clear effect |
| sort the sampled positions (ablation) | randomized sin/cos PE · 15 tasks (avg) | accuracy: +15.7% on average, up to 76.3% | Improved |
| sort the sampled positions (ablation) | randomized sin/cos PE · Bucket Sort | accuracy: 23.7 -> 100.0 | Improved |
| sort the sampled positions (ablation) | randomized sin/cos PE · Missing Duplicate | accuracy: 53.1 -> 52.5 | Hurt |
| vary maximum position L (1024, 2048, 4096, 8192) (ablation) | randomized relative PE · Reverse String, Missing Duplicate | accuracy | No clear effect |
| train randomized relative PE on length 40 instead of classical relative PE on length 500 | relative PE · Missing Duplicate | training speed: 168.4 vs 22.1 steps per second | Improved |
Open problems in Transformer expressivity and learnability
Do theorems about transformer expressivity and learning still hold for deep, softmax, trained models?
- Experiments use small models and synthetic tasks only. · 16 papers state it
- Theory covers one layer, linear attention or fixed matrices, not full transformers. · 12 papers state it
- Theorems and constructions are not shown to match trained transformers. · 6 papers state it
Closest papers by meaning
- A Formal Framework for Understanding Length Generalization in Transformers (ICLR 2025 · similarity 0.94)
- Position Coupling: Improving Length Generalization of Arithmetic Transformers Using Task Structure (NeurIPS 2024 · similarity 0.90)
- Arithmetic Transformers Can Length-Generalize in Both Operand Length and Count (ICLR 2025 · similarity 0.90)
- Universal Length Generalization with Turing Programs (ICML 2025 · similarity 0.90)
- The Role of Sparsity for Length Generalization in LLMs (ICML 2025 · similarity 0.90)
- What Algorithms can Transformers Learn? A Study in Length Generalization (ICLR 2024 · 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.