atlas

Research map / Architectures and efficiency / Attention and transformers

Looped Transformers for Length Generalization

ICLR 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.

Trains looped decoder-only Transformers with step-dependent end-to-end supervision (no intermediate steps) so that an adaptive number of loop iterations enables length generalization on arithmetic and algorithmic tasks.

Problem

Transformers trained from scratch solve arithmetic and algorithmic tasks in-distribution but fail to length-generalize to unseen input lengths, and fixed-depth models cannot adapt computation to problem length.

Approach

Define n-RASP-L problems (a RASP-L step applied T(n) times) and train a looped decoder-only GPT-2 block with full-output prediction, supervising the output after varying numbers of loop steps using only input-output pairs and the known step count; at inference, the number of steps is set by an oracle or a maximum-confidence rule.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use looped training with adaptive inference steps instead of NTPGPT-2 on Parity, Copy, Addition, Binary Sum, Multiplication, and Unique Set · length generalization across studied tasksexact match accuracyHelped
use looped training with adaptive inference steps instead of NTPGPT-2 on Parity · Parity, test length 40exact match accuracyHelped
use looped training with adaptive inference steps instead of NTPGPT-2 on Addition and Copy · Addition and Copy length generalizationexact match accuracyHelped
use weight-tied layers with fixed loop count in NTPGPT-2 on Addition, Copy, and Multiplication · length generalizationexact match accuracyHelped
add pause tokens to NTPGPT-2 on Binary Sum and Unique Set · length generalizationexact match accuracyHelped
add input injection at each loop iteration (ablation)FOP-Loop-Adaptive on Addition, Binary Sum, and Unique Set · length generalizationexact match accuracyHelped
replace adaptive loop steps with pause tokens (ablation)FOP on studied tasks · length generalizationexact match accuracyHurt
remove weight tying and adaptive depth (ablation)FOP on Addition · Additionin-distribution exact match accuracyHurt
use a fixed number of loop steps instead of variable depth (ablation)FOP-Loop-Fixed · length generalization across studied tasksexact match accuracyHurt
choose stopping steps per sample instead of for the full test set (ablation)FOP-Looped-Adaptive-Instance · Addition, Copy, Multiplication, and Unique Setexact match accuracyNo clear effect
choose stopping steps per sample instead of for the full test set (ablation)FOP-Looped-Adaptive-Instance · Parity and Binary Sumexact match accuracyHurt

Surprising findings

Limitations

Experimental setup

Datasets: synthetically generated algorithmic tasks: parity, copy, binary addition, binary sum, binary multiplication, unique set

Benchmarks: parity copy binary addition binary sum binary multiplication unique set

Metrics: exact match accuracy standard error over five seeds

Baselines: NTP NTP-Pause NTP-Loop FOP FOP-Pause FOP-Loop-Fixed PonderNet

Builds on: Universal Transformers RASP-L NoPE GPT-2

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