Introduction
Large Language Models (LLMs) demonstrate remarkable planning abilities, from solving puzzles to orchestrating complex API calls. However, the mechanism by which next-token prediction translates into high-level planning remains poorly understood. The ALPINE project investigates this gap by modeling planning as a network path-finding task: given a source and target node in a graph, can a Transformer generate a valid sequence of edges to reach the goal?
Theoretical Framework: Expressivity and Learning Dynamics
The researchers analyze the planning problem through two primary lenses:
- Expressivity: They prove (Theorem 2) that a 1-layer, 1-head Transformer has the mathematical capacity to encode both the adjacency matrix (local connections) and the reachability matrix (global path availability) within its weights.
- Learning Dynamics: Using gradient descent, the authors show that models naturally learn the adjacency matrix and an "observed" version of the reachability matrix based on the training distribution.
Mechanistic Interpretability: Peeking into the Weights
To move beyond "black box" analysis, the authors visualize the trained Transformer's internal weight matrices ($W^M$ and $W^V$). These heatmaps reveal how the model's internal representations align with the structural properties of the underlying graph.
The Transitivity Wall
The most significant finding is the "Transitivity Wall." While Transformers excel at following paths explicitly seen during training, they struggle with transitive reasoning—the ability to deduce that if $A \to B$ and $B \to C$, then $A$ can reach $C$, without having seen the full $A \to C$ chain in a single sequence.
As shown in Figure 6, the model's internal weights ($W^V$) correlate strongly with the observed reachability in the training data ($R^{obs}$) rather than the true underlying graph structure ($R^{true}$). This suggests that LLMs are performing sophisticated pattern matching on observed paths rather than deducing the full graph topology.
Key Results and Scaling Laws
- High Accuracy on Seen Structures: On synthetic Directed Acyclic Graphs (DAGs), 1-layer Transformers achieved near 100% accuracy on test pairs that were reachable via paths similar to those in the training set.
- Concatenation Failure: Accuracy plummeted when models were required to link two segments they hadn't seen connected before (degree-2 paths). This confirms that models are memorizing observed reachability rather than deducing the graph's full structure.
- Embedding Dimension: The study found that embedding size ($d$) is a critical bottleneck. If $d$ is smaller than the number of nodes, the model's ability to represent the adjacency matrix—and thus its planning accuracy—degrades significantly.
Limitations and Future Outlook
The primary limitation is the lack of inherent transitive reasoning in the next-token prediction objective. Because the loss encourages matching the training distribution, it doesn't naturally learn to deduce unobserved connections. Future work may explore:
- Architectural Inductive Biases: Incorporating transitivity directly into the model architecture.
- Search-Based Inference: Using Chain-of-Thought (CoT) or backtracking to allow models to "search" the graph during inference.
- Complex Scenarios: Extending the analysis to hyper-graphs where multiple preconditions must be met simultaneously.
Summary updated