TL;DR
Standard Transformer models, which usually fail to solve problems longer or harder than those seen in training, can "bootstrap" their way to extreme generalization through iterative self-improvement. By learning from their own filtered, self-generated solutions on progressively harder tasks, these models can leap from 10-digit addition to 100-digit addition without any changes to their architecture or positional embeddings.
What Problem Does This Paper Address?
Transformers are remarkably capable, but they have a well-known "brittleness" when it comes to length generalization. If you train a model on 10-digit addition, it typically fails miserably when asked to solve a 20-digit problem. This suggests that instead of learning the underlying logic (the "algorithm"), the model is merely interpolating within the specific distribution of its training data.
Previous attempts to fix this often relied on architectural "hacks"—specialized positional encodings or modified attention mechanisms. The authors of this paper ask a more fundamental question: Can we teach a standard Transformer to extrapolate simply by changing how we train it?
Methods
The researchers employ an iterative self-improvement framework inspired by techniques like STaR and ReST. The core idea relies on a phenomenon called "transcendence": the observation that a model trained on problems of difficulty $n$ can often solve problems of difficulty $n+1$ with at least some accuracy.
The process works in a loop:
- Generate: The current model attempts to solve problems slightly harder than its current training set.
- Filter: To prevent the model from learning its own mistakes (which leads to an "error avalanche"), the outputs are filtered. The authors use two unsupervised methods:
- Length Filtering: Since out-of-distribution (OOD) errors often result in answers that are too short, they discard any solutions significantly shorter than the longest in the batch.
- Majority Voting: They train multiple models in parallel and only keep solutions where a consensus is reached.
- Fine-tune: The model is retrained on a mix of the original gold-standard data and the new, filtered self-generated data.
- Repeat: The difficulty is nudged upward for the next round.
Datasets
The authors evaluated their approach on several synthetic algorithmic tasks designed to test logical extrapolation:
- Arithmetic: Reverse addition, forward addition, and multi-digit multiplication (using Chain-of-Thought).
- String Manipulation: Copying and reversing strings of digits.
- Maze Solving: Finding the shortest path in tree-structured graphs, varying both the number of "hops" (path length) and the total number of nodes in the graph.
Key Insights and Ideas
- Transcendence as a Ladder: The model's ability to generalize just a little bit beyond its training data is the engine for the entire process. By iteratively capturing these "lucky" correct guesses on harder problems, the model builds a curriculum for itself.
- The "Error Avalanche": Without filtering, self-improvement is dangerous. Small errors in round $n$ become the ground truth for round $n+1$, eventually causing performance to crash.
- Unsupervised Filtering Works: Surprisingly, you don't need an external "teacher" or a ground-truth verifier to filter data. Simple heuristics like "don't trust short answers" or "trust the consensus" are enough to sustain the loop.
- Pretraining Accelerates Progress: While models trained from scratch can self-improve, starting with a pretrained model (like Llama-3B) significantly speeds up the process, allowing the model to reach higher difficulty levels in fewer rounds.
Key Results
The results demonstrate that self-improvement allows models to tackle tasks far beyond their initial training:
- Addition: Models initially trained on 1-16 digit addition reached near-perfect accuracy on 100-digit addition after multiple rounds.
- Multiplication: In the challenging 5x5 to 9x9 multiplication task, the combined filtering approach (majority voting + length filtering) boosted accuracy from a baseline of ~31% to over 93%.
- Mazes: Models successfully generalized from 9-hop paths to 30-hop paths and scaled from 30-node graphs to 100-node graphs.
- Acceleration: The authors showed that the "safe range" for difficulty increases as the model improves, meaning they could eventually sample multiple new difficulty levels at once, leading to exponential extrapolation.
Limitations and Future Work
- Input Generation: The current framework assumes we can easily generate the inputs (the math problems or maze structures) for the model to solve. In more complex, real-world domains, generating high-quality "questions" is a challenge in itself.
- Defining Difficulty: For algorithmic tasks, "difficulty" (number of digits, number of hops) is easy to quantify. For natural language tasks (like writing a complex essay), defining a clear "easy-to-hard" curriculum is much harder.
- Algorithmic Bias: The paper notes that models can sometimes memorize their own mistakes if they are repeated often enough, suggesting that maintaining a diverse and high-quality "memory" of past solutions is critical.
Summary updated