- Rating
- 5
- Clarity
- 4
- Confidence
- 4
- Originality
- 3
- Quality
- 3
- Significance
- 4
Read review
Summary
In this paper, the author(s) study the fundamental problem aiming to understand and characterize how transformers acquire and execute multistep reasoning and search methods. The paper focuses on the task of DFS on directed graphs, which abstract multi-step reasoning. It addresses basic questions including: How the number of layers in the transformer architecture impact the efficiency of graph search? Whether gradient-based training results induce general graph-search mechanism?
The paper demonstrates a quantitative separation between one-layer and two-layer transformer architectures. It shows that on dense network; single layer transformers require quadratic size to capture a key DFS branching primitive. In contrast, two-level architectures can implement DFS with O(nlogn) size. In addition, it shows that each additional layer provides multiplicative power increasing in look-ahead horizon for graph search. Perhaps, more interestingly, the paper establishes that two-layer transformers can use gradient flow for DFS learning and generalization.
Strengths and weaknesses
Strengths: I found the paper interesting conceptually as well as technically. Both the size-separation of single and multi-layer transformer architectures in graph search and the capability of gradient flows to learn DFS methods are significant. The formulation, including the exponential-search power characterization of architectural depth, and the techniques developed in the paper are insightful. To capture the power of gradient flows, the author(s) prove that gradient flow preserves a low-dimensional invariant structure when working on permutation-invariant curriculum. Instead of analyzing all matrix entries independently, they show that the dynamics collapse to a small set of effective scalar parameters.
The one-two-layer separation result remind me of the Mitzenmacher’s “power of two” result for randomized load balancing, where he showed decision maximizing two random choices significantly improved upon a single random choice. In addition, the paper provides a small-scale yet well designed experiment to test the predicted training dynamics.
Weaknesses: The current proof of gradient-flow learning depends on permutation symmetry as well as partially fixed architecture. If I understand correctly, the current formulation assuming exact graph search method (i.e., exact DFS). Real-world LLM reasoning often appears heuristic and approximate.
Questions
Questions: Can the framework be extended to probabilistic reasoning and imprecise reasoning?
Limitations
yes
Paper formatting concerns
no
We thank the reviewer for the encouraging assessment and for raising this important question. The current theorem indeed studies exact, deterministic DFS under a partially fixed architecture; we do not claim that it already explains the full heuristic behavior of real-world LLMs. Nevertheless, we believe the framework has a natural extension to probabilistic and imprecise reasoning.
We agree that Theorem 4.2 is intentionally scoped: permutation symmetry and the fixed first-layer/value/readout components make the gradient-flow dynamics analytically tractable. In particular, symmetry ensures that the gradient vector field preserves the diagonal/off-diagonal subspace in Equation (27), reducing the matrix dynamics to a small scalar system. This is a sufficient condition used by the proof, not a claim that symmetry is necessary for learning DFS. Likewise, fixing the predecessor-copy layer isolates the novel part of the learning problem—how the second layer learns the competing forward and backtracking mechanisms. The expressivity results in Section 3 do not rely on these training assumptions.
To examine whether the mechanism is brittle, we additionally tested several relaxations. With finite-permutation stochastic training, even one sampled permutation per update recovers slopes close to the predicted (2,2,1) rates and generalizes to unseen graph topologies. The behavior is also stable under substantial symmetry-breaking initialization, a fixed state-independent readout, and joint training of the active key-query and value blocks. In the latter setting, greedy DFS rollouts remain near-perfect on unseen graphs at N∈16,40,100.
Probabilistic reasoning.
Let s=(G,τ<t) denote the current reasoning state, and replace the deterministic admissible-action target by a stochastic policy π⋆(⋅∣s). The corresponding training objective is
Lprob(θ)=Es[−∑v∈Vπ⋆(v∣s)logpθ(v∣s)].
If the curriculum is permutation invariant and the target policy is permutation equivariant, i.e.,
π⋆(π(v)∣π(s))=π⋆(v∣s),
then Lprob remains invariant under simultaneous relabeling of the graph, trace, and parameters. Consequently, the gradient vector field still commutes with the permutation action, and the diagonal/off-diagonal invariant structure in Equation (27) is preserved. Thus, the N2 matrix entries again collapse to a constant number of orbit parameters. The exact four-variable system and its asymptotic rates would change because the gradient coefficients now depend on π⋆, but the symmetry-based reduction itself is not tied to deterministic labels. For example, a probabilistic DFS policy could distribute mass among unexplored children according to estimated success probabilities and retain nonzero probability of backtracking. The appropriate guarantee would then be convergence in policy divergence or expected regret, rather than exact next-token correctness.
Imprecise or heuristic reasoning.
The L-look-ahead construction in the paper can already be viewed as a restricted heuristic method: it makes an informed decision when the target lies within a bounded horizon and otherwise falls back to ordinary DFS. A natural extension is to replace the Boolean reachability vector Rr(u) by a real-valued score hr(u) representing an estimated reachability probability or value. Attention can aggregate neighboring scores through Bellman-style updates; for example, under a fixed stochastic transition model,
hr+1(u)=∑vP(v∣u)hr(v),
with max or softmax variants corresponding to controlled or entropy-regularized search. The proof would then track approximation error through the layers instead of proving exact equality of reachable sets.
A simple robustness principle is already available. Let z⋆(s) be the ideal logits, z(s) the approximate logits, and define the admissible-action margin
Δ(s)=maxv∈C(s)zv⋆(s)−maxv∈/C(s)zv⋆(s).
If ∥z(s)−z⋆(s)∥∞≤ε, then greedy decoding still selects an admissible move whenever Δ(s)>2ε. When this margin is small, exact correctness is no longer the appropriate objective; one should instead bound policy divergence, expected search cost, or regret. For deeper look-ahead models, the exact horizon 2L−3+1 would similarly be replaced by a horizon-dependent approximation bound.