Self-Improving Transformers Overcome Easy-to-Hard and Length Generalization Challenges

Nayoung Lee, Ziyang Cai, Avi Schwarzschild, Kangwook Lee, Dimitris Papailiopoulos

Abstract

Standard Transformer models typically struggle with length generalization and easy-to-hard transitions, failing when test instances exceed the complexity of training data. This paper demonstrates that an iterative self-improvement loop—leveraging a model's ability to solve a small fraction of slightly harder problems—allows standard architectures to achieve extreme generalization. Through rounds of generation, unsupervised filtering, and fine-tuning, models initially trained on short sequences can master tasks like 100-digit addition and 10x10 multiplication without architectural modifications.

Introduction

Transformers are the state-of-the-art in AI, yet they face a notorious "glass ceiling": length generalization. A model trained on 10-digit addition often fails on 20-digit addition. Similarly, they struggle with easy-to-hard generalization, where complex logic puzzles remain unsolvable if only simpler versions were seen during training. While previous work suggested architectural modifications (e.g., specialized positional embeddings), this research explores whether standard architectures can overcome these limits through a refined training methodology.

Methodology: The Self-Improvement Loop

The authors propose an iterative framework inspired by algorithms like STaR and ReST. The core mechanism is "transcendence": the empirical observation that a model trained on problems of difficulty $n$ can often solve a small percentage of problems at difficulty $n+1$.

Task definitions and difficulty metrics for the algorithmic benchmarks evaluated.

The process follows a five-step iterative loop:

  1. Initial Training: Train a standard Transformer (e.g., LLaMA-style) on a base dataset of "easy" problems.
  2. OOD Generation: The model generates solutions for "Out-of-Distribution" (OOD) problems that are slightly harder or longer.
  3. Unsupervised Filtering: To prevent learning from errors, two filters are applied:
  4. Relative Length Filtering: Discarding outputs significantly shorter than the batch maximum to avoid "short-circuiting."
    • Majority Voting: Keeping only solutions where multiple model seeds agree.
  5. Fine-tuning: Re-training the model on the filtered, harder examples.
  6. Iteration: Gradually increasing difficulty in subsequent rounds.

Experimental Results

The iterative self-improvement loop yielded significant performance gains across all tasks, as evidenced by the rightward shift of accuracy curves over successive rounds.

  • Arithmetic: Models generalized from 16-digit addition to 100-digit addition with near-perfect accuracy. Multiplication, a traditionally difficult task, progressed from 5x5 to 10x10 digits using an accelerated schedule.
  • Maze Solving: Models scaled from 9-hop paths to 30-hop paths and handled larger graphs than those seen in initial training.
  • Filtering Impact: Majority voting was crucial for hard tasks; in multiplication, it improved data accuracy from 31% to over 93%.
Accuracy curves and heatmaps showing performance shifts across successive self-improvement rounds for addition, string copying, maze-solving, and multiplication.

Discussion and Insights

A major finding is that architecture is not the primary bottleneck. Using No Positional Encoding (NoPE), the authors showed that a proper curriculum and self-improvement loop matter more than specific architectural "hacks." Furthermore, starting with a pretrained model (e.g., Llama-3B) acts as a catalyst, providing a stronger logical foundation that speeds up the self-improvement process.

However, the "Error Avalanche" remains a risk; models are sensitive to structured noise (like consistent digit dropping). Future work is needed to define "hard" curricula for more subjective domains like natural language reasoning, where difficulty is less quantifiable than in arithmetic or graph theory.

Conclusion

This work proves that standard Transformers possess the latent capacity for extreme generalization. By shifting the focus from architectural design to iterative, self-supervised training loops, we can push models far beyond their initial training distributions, effectively "leveling up" their reasoning and computational capabilities.

Summary updated

BibTeX
@inproceedings{lee2025self,
  author = {Nayoung Lee and Ziyang Cai and Avi Schwarzschild and Kangwook Lee and Dimitris Papailiopoulos},
  title = {{Self-Improving Transformers Overcome Easy-to-Hard and Length Generalization Challenges}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=ZtX0MBT6mf},
}
Figure