atlas

Research map / Architectures and efficiency / Attention and transformers

Position Coupling: Improving Length Generalization of Arithmetic Transformers Using Task Structure

NeurIPS 2024 · 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.

Proposes position coupling, which assigns identical position IDs to semantically relevant tokens (e.g., digits of equal significance), enabling decoder-only Transformers trained on 1-30 digit addition to generalize to 200-digit addition, with supporting theory on 1-layer constructions.

Problem

Transformers often fail to length-generalize even on simple arithmetic such as integer addition, learning only up to the training sequence length.

Approach

Embed task structure into absolute positional encodings by giving the same position IDs to tokens that are semantically relevant to each other (e.g., digits of the same significance across operands and sum), with random starting position IDs during training.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Train on longer operand lengths (ablation)Position coupling for addition · Additiongeneralizable length (digits): 70 (1--10) -> 135 (1--20) -> 200 (1--30 and 1--40)Helped
Increase depth to 6 layers (ablation)Position coupling for addition trained on 1--30 digits · Additionlength generalization performanceHurt
Use zero-padding (ablation)Position coupling for addition with a 1-layer 4-head model · Additionlength generalization performanceHelped
Reverse the response or all numbers (ablation)Position coupling for addition with a 1-layer 4-head model · Additionlength generalization performanceHelped
Remove reversing (ablation)Position coupling for addition with a 1-layer 4-head model · Additionin-distribution performanceHurt
Add zero-padding and reversing (ablation)Position coupling for addition with a 6-layer 8-head model · AdditionperformanceHurt
Use position coupling instead of NoPE or random-start APEDecoder-only Transformers for addition · Additionlength generalizationHelped
Use index hinting instead of NoPE or random-start APE6-layer 8-head Transformer for addition · Additiongeneralizable length (digits): does not extend further than 50; complete failure starting from length 70Helped
Use shared rather than distinct positional embedding layers (ablation)Position coupling for minesweeper generator · Minesweeper generatorgeneralizable board width: 10×10 -> 12×12; over 98\% accuracy on 12×12 and near 90\% on 14×14Helped
Combine position coupling with RoPE (ablation)12-layer Transformer for addition · Additionlength generalization: up to operand lengths 100Helped

Surprising findings

Limitations

Experimental setup

Datasets: synthetic arithmetic data (balanced-digit sampled addition, multiplication, copy/reverse, minesweeper generator)

Benchmarks: 5-200 digit addition exact match (in-house) N x 2 multiplication (in-house) minesweeper generator (in-house) copy/reverse (in-house)

Metrics: exact-match accuracy generalizable length

Baselines: NoPE random-start APE index hinting RoPE Abacus

Builds on: learned absolute positional embedding index hinting NoPE reversed format

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