atlas

Research map / Architectures and efficiency / Attention and transformers

Extrapolation by Association: Length Generalization Transfer In Transformers

NeurIPS 2025 · Architectures and efficiency › Attention and transformers · approach: Transformer expressivity and learnability · 0 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 length generalization can transfer from a longer-trained auxiliary task to a shorter-trained main task in transformers (from scratch and pretrained SmolLM-360M), and links transfer to reuse of attention heads/circuits.

Problem

How transformers extrapolate to longer inputs than seen in training; the paper asks whether length generalization on one task can be transferred from a related auxiliary task trained on longer inputs.

Approach

Length generalization emerges via task association: co-training a main task on short inputs with a related auxiliary task on longer inputs lets the main task extrapolate to the auxiliary's length range, a transfer not seen when training the main task alone; the effect correlates with shared attention-head usage.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Co-train reverse add with no carry and carry onlyFrom-scratch transformer · Reverse add, lengths beyond training lengthexact match accuracyHelped
Co-train reverse add with reverse subtractFrom-scratch transformer · Reverse add, lengths beyond training lengthexact match accuracyHelped
Co-train reverse add with n × 3 CoT multiplyFrom-scratch transformer · Reverse add, lengths beyond training lengthexact match accuracyHelped
Co-train string copy with MQARFrom-scratch transformer · String copy, lengths beyond training lengthexact match accuracyHelped
Co-train capitalize-reverse with capitalize and reverseFrom-scratch transformer · Capitalize-reverse, lengths beyond training lengthexact match accuracyHelped
Co-train DFS trace with shortest pathFrom-scratch transformer · DFS trace, longer mazesexact match accuracyHelped
Co-train shortest path with DFS traceFrom-scratch transformer · Shortest path, longer mazesexact match accuracyHelped
Use unrelated copy-first-op as an auxiliary taskReverse add · Reverse add, lengths beyond training lengthexact match accuracyNo clear effect
Use reverse as an auxiliary taskString copy · String copy, lengths beyond training lengthexact match accuracyNo clear effect
Increase natural-language pretraining progressSmolLM-360M finetuned on reverse add and shortest path · Reverse add and shortest path, out-of-distribution lengthsexact match accuracyHelped
Use NoPE instead of RoPE (ablation)From-scratch transformer · Reverse add, capitalize-reverse, string copy; transfer evaluationgeneralization transferHurt
Use only one auxiliary task instead of both no carry and carry only (ablation)Reverse add · Reverse add, lengths beyond training lengthexact match accuracyHurt

Surprising findings

Limitations

Experimental setup

Datasets: synthetic reverse add no carry carry only reverse subtract n x 3 CoT multiply string copy MQAR capitalize reverse capitalize-reverse DFS trace maze shortest path maze

Benchmarks: synthetic algorithmic task suites (arithmetic, string, maze) with length sweeps

Metrics: exact match accuracy generalization gap attention matrix difference head mean-ablation map difference

Baselines: main task trained alone NoPE model control tasks (copy-first-op, reverse)

Builds on: Llama RoPE multi-query associative recall Wilson's algorithm task hinting

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