Abstract
While Transformers are known for their ability to discover latent structures in data, the temporal dynamics of this learning process are often obscured by the complexity of natural language. This paper investigates these dynamics using the controlled Alchemy benchmark. We find that Transformers do not learn latent structures through smooth, continuous improvement; instead, they progress through discrete stages marked by sudden performance jumps. Our analysis reveals a "coarse-to-fine" learning trajectory and a significant compositional asymmetry: models easily compose simple rules into complex sequences but struggle to decompose those sequences back into fundamental parts.
Introduction
Transformers have revolutionized machine learning by discovering latent structures—such as syntax or causal links—within vast datasets. However, the specific mechanics of "how" and "when" these structures are internalized remain poorly understood. Previous observations of "phase changes" or "grokking" suggest non-linear learning, but attributing these spikes to specific structural features in natural language is challenging. This study utilizes a mathematically defined environment to demystify these dynamics, asking whether models learn structural components simultaneously and how task complexity influences the learning trajectory.
The Alchemy Benchmark
The researchers utilize the Alchemy benchmark, a meta-reinforcement learning environment that provides a structured "chemistry" for the model to solve. The world consists of eight possible "stones" (vertices) arranged in a cubic graph. Transitions between these stones are governed by "potions" (edges) that alter features like color, size, and reward value. While the specific effect of a potion varies between chemistries, the underlying cubic structure remains invariant. To succeed, the model must learn this invariant latent structure to generalize to new, unseen chemistries.
Methodology: Event-Based Factorization
To probe the model's internal progress, the researchers trained a small decoder-only Transformer (~2M parameters) on three task variants: latent-structure discovery, composition (combining known rules), and decomposition (inferring rules from sequences).
Instead of monitoring aggregate accuracy, the authors employed event-based factorization. This method breaks down success into a chain of conditional probabilities:
- Event A (In-support): Predicting a stone present in the support set.
- Event B (Correct half): Identifying the correct half of the latent cubic graph.
- Event C (Exact match): Achieving a perfect prediction.
This granular approach allows researchers to pinpoint which sub-skills cause plateaus or sudden jumps in performance.
Results: Staged Jumps and Asymmetry
Staged Learning Dynamics
The model consistently masters "coarse" solutions before "fine" ones. As shown in the event-based analysis, the model first learns to restrict its guesses to the support set (Event A) before navigating the graph to find the target stone.
In the discovery task, near-perfect accuracy is reached in three distinct waves: mastering the support set (approx. epoch 50), identifying exact matches within a local neighborhood (approx. epoch 150), and finally mastering the "other half" of the graph (approx. epoch 250). Interestingly, the model exhibits an adjacency bias; it temporarily dips in "correct half" accuracy because it learns local reward correlations before understanding the global graph structure.
The Compositional Bottleneck
A fundamental gap exists between building up and breaking down information. In Composition tasks, the model is remarkably robust; increasing the sequence length (hop length) has negligible impact on the learning rate. Conversely, in Decomposition tasks, increasing the hop length significantly delays mastery. For example, a 2-hop decomposition task might converge by epoch 400, while a 5-hop task may not reach the same stage until epoch 800. This suggests that while Transformers are naturally adept at chaining transitions, they face a "complexity bottleneck" when inferring underlying rules from complex outcomes.
Discussion and Limitations
The study also highlights that hyperparameters like weight decay act as "gatekeepers." Sub-optimal settings do not just lower final accuracy; they can prevent a model from ever transitioning to the next stage of learning, leaving it trapped on a plateau indefinitely.
While these findings provide a clear window into the learning dynamics of small models on synthetic data, the primary limitation is scale. It remains to be seen if massive Large Language Models (LLMs) follow these same staged dynamics during pre-training. Future research should investigate whether these bottlenecks persist in different architectures, such as Graph Neural Networks, or during the fine-tuning of pre-trained models on structured data.
Summary updated