Generative Recursive Reasoning
Summary
This paper introduces Generative Recursive reAsoning Models (GRAM), a probabilistic framework that extends recursive reasoning models by enabling stochastic latent trajectories, multiple hypotheses, and inference-time scaling through depth and parallel sampling.
View Cached Full Text
Cached at: 05/20/26, 08:28 AM
# Generative Recursive Reasoning
Source: [https://arxiv.org/html/2605.19376](https://arxiv.org/html/2605.19376)
Junyeob Baek1†Mingyu Jo1†∗Minsu Kim1,2
Mengye Ren3Yoshua Bengio2,4Sungjin Ahn1,3
1KAIST2Mila – Québec AI Institute 3New York University4Université de Montréal
Equal contributionCorrespondence to: Junyeob Baek \(wnsdlqjtm@kaist\.ac\.kr\), Mingyu Jo \(mingyu\.jo@kaist\.ac\.kr\), Sungjin Ahn \(sungjin\.ahn@kaist\.ac\.kr\)###### Abstract
How should future neural reasoning systems implement extended computation? Recursive Reasoning Models \(RRMs\) offer a promising alternative to autoregressive sequence extension by performing iterative latent\-state refinement with shared transition functions\. Yet existing RRMs are largely deterministic, following a single latent trajectory and converging to a single prediction\. We introduce*Generative Recursive reAsoning Models \(GRAM\)*, a framework that turns recursive latent reasoning into probabilistic multi\-trajectory computation\. GRAM models reasoning as a stochastic latent trajectory, enabling multiple hypotheses, alternative solution strategies, and inference\-time scaling through both recursive depth and parallel trajectory sampling\. This yields a latent\-variable generative model supporting conditional reasoning viapθ\(y∣x\)p\_\{\\theta\}\(y\\mid x\)and, with fixed or absent inputs, unconditional generation viapθ\(x\)p\_\{\\theta\}\(x\)\. Trained with amortized variational inference, GRAM improves over deterministic recurrent and recursive baselines on structured reasoning and multi\-solution constraint satisfaction tasks, while demonstrating an unconditional generation capability\.[https://ahn\-ml\.github\.io/gram\-website](https://ahn-ml.github.io/gram-website/)
## 1Introduction
A central question for future neural reasoning systems is how extended computation should be implemented\. Large autoregressive models typically scale reasoning by extending a sequence\-generation process, whether intermediate computation is expressed explicitly as chain\-of\-thought tokens or implicitly in hidden or latent representations\[[1](https://arxiv.org/html/2605.19376#bib.bib1),[2](https://arxiv.org/html/2605.19376#bib.bib2),[3](https://arxiv.org/html/2605.19376#bib.bib3),[4](https://arxiv.org/html/2605.19376#bib.bib4),[5](https://arxiv.org/html/2605.19376#bib.bib5),[6](https://arxiv.org/html/2605.19376#bib.bib6)\]\. A complementary direction is explored by Recursive Reasoning Models \(RRMs\), which use repeated computation to refine a persistent latent state rather than to append new elements to an output or reasoning sequence\[[7](https://arxiv.org/html/2605.19376#bib.bib7),[8](https://arxiv.org/html/2605.19376#bib.bib8),[9](https://arxiv.org/html/2605.19376#bib.bib9)\]\. This approach is appealing because it decouples reasoning depth from both parameter scale and output length: a compact model can perform many steps of internal computation by repeatedly applying shared transition functions over time\.
Recent recursive reasoning models such as HRM\[[8](https://arxiv.org/html/2605.19376#bib.bib8)\]and TRM\[[9](https://arxiv.org/html/2605.19376#bib.bib9)\]provide early evidence for the potential of this approach in structured reasoning\. Rather than producing a solution in a single feedforward pass, they perform extended computation through iterative latent\-state refinement, deep supervision across refinement steps, and reasoning\-oriented recurrent designs such as hierarchical latent dynamics\. These features make them well suited to problems requiring constraint propagation, state tracking, iterative correction, and multi\-step inference\. More broadly, they build on a principle also explored in recurrent Transformer architectures such as Universal Transformers\[[10](https://arxiv.org/html/2605.19376#bib.bib10)\]and Looped Transformers\[[7](https://arxiv.org/html/2605.19376#bib.bib7)\]: shared Transformer blocks can be repeatedly applied to increase computational depth without increasing parameter count\. Together, these models suggest that reasoning capability can emerge not only from scaling model size or generating longer traces, but also from the organization of computation itself\.
Figure 1:Comparison of Latent Reasoning Trajectories\.Left: N\-Queens Example with two valid solutions\. Right: Given three independent runs for latent reasoning \(τ1,τ2,τ3\\tau\_\{1\},\\tau\_\{2\},\\tau\_\{3\}\): \(a\) Prior RRMs \(e\.g\. HRM, TRM\) are deterministic—all runs collapse to an identical trajectory, converging to a single solution and failing to explore alternatives, while \(b\) GRAM explores diverse trajectories, producing diverse trajectories that reach multiple valid solutionsy1y\_\{1\}andy2y\_\{2\}, while naturally enabling parallel inference\-time scaling\.While recurrent latent\-state refinement provides an appealing mechanism for efficiently increasing reasoning depth, depth alone is not sufficient for many reasoning problems\. A capable reasoning system should also be able to maintain uncertainty, consider alternative hypotheses, and explore multiple possible solution strategies\[[11](https://arxiv.org/html/2605.19376#bib.bib11),[12](https://arxiv.org/html/2605.19376#bib.bib12)\]\. This is especially important in settings where ambiguity or multiple valid solutions are intrinsic, and more generally in problems where a single refinement path may become trapped in a suboptimal reasoning trajectory\. In this sense, future RRMs should be not only deep, in the sense of repeated refinement, but also wide, in the sense of maintaining and exploring multiple latent trajectories in parallel\.
Existing RRMs\[[7](https://arxiv.org/html/2605.19376#bib.bib7),[8](https://arxiv.org/html/2605.19376#bib.bib8),[9](https://arxiv.org/html/2605.19376#bib.bib9),[10](https://arxiv.org/html/2605.19376#bib.bib10)\], however, remain fundamentally deterministic: given the same input and initialization, they follow a single latent trajectory and converge to a single prediction\. This deterministic recursion collapses the space of plausible reasoning paths into a single attractor, leaving probabilistic multi\-hypothesis latent reasoning largely unexplored within the RRM paradigm\. This motivates the central question of our work:can recursive latent computation support probabilistic, generative, multi\-hypothesis reasoning while preserving the efficiency of compact recurrent models?
In this paper, we propose Generative Recursive reAsoning Models \(GRAM\), a framework that turns recursive latent reasoning into probabilistic multi\-trajectory computation\. GRAM treats the reasoning process itself as a stochastic latent trajectory: at each recursion step, the model samples a transition conditioned on the input and the current reasoning state, rather than deterministically updating to a single next state\. Repeating this process defines a distribution over possible reasoning trajectories, allowing the model to maintain multiple hypotheses, explore alternative solution strategies, and scale inference not only by increasing recursive depth but also by sampling trajectories in parallel\. From a probabilistic perspective, GRAM is a latent\-variable generative model: it modelspθ\(y∣x\)p\_\{\\theta\}\(y\\mid x\)by marginalizing over latent reasoning trajectories, while the same recursive process can also define an unconditional generative modelpθ\(x\)p\_\{\\theta\}\(x\)when the input is fixed or absent\.
We evaluate GRAM on controlled reasoning and generation tasks that serve as probes of the architectural properties targeted by our formulation: recursive refinement, stochastic exploration, multi\-solution coverage, and inference\-time scaling\. Given this goal, our experiments focus on comparisons with the most relevant deterministic recurrent and recursive latent reasoning baselines, including Looped Transformers, HRM, and TRM, rather than frontier\-scale general\-purpose LLMs whose training data, inference budgets, and external scaffolding are not directly comparable\. Sudoku\-Extreme\[[8](https://arxiv.org/html/2605.19376#bib.bib8)\]and ARC\-AGI\[[13](https://arxiv.org/html/2605.19376#bib.bib13),[14](https://arxiv.org/html/2605.19376#bib.bib14)\]test structured reasoning under hard constraints and abstract transformations; N\-Queens and Graph Coloring evaluate multi\-solution recovery; and binarized MNIST\[[15](https://arxiv.org/html/2605.19376#bib.bib15)\]probes the unconditional generative interpretation\.
Our main contribution is to establish probabilistic multi\-trajectory recursion as a design principle for future recurrent and recursive reasoning architectures\. Concretely, we make three contributions\. First, we formulate recursive reasoning as a latent\-variable generative process, where solutions are obtained by marginalizing over stochastic reasoning trajectories\. Second, we introduce width\-based inference\-time scaling, enabling inference to scale not only with recursive depth but also with the number of sampled latent trajectories\. Third, we provide empirical evidence that this formulation yields the intended architectural advantages over deterministic recurrent and recursive baselines, improving structured reasoning, multi\-solution constraint satisfaction, and unconditional generation\.
## 2Generative Recursive Reasoning Models
In this section, we introduce Generative Recursive reAsoning Models \(GRAM\), an instantiation of probabilistic recursive reasoning\. We describe the architecture in[Section˜2\.1](https://arxiv.org/html/2605.19376#S2.SS1)and the training procedure in[Section˜2\.2](https://arxiv.org/html/2605.19376#S2.SS2), with an architecture schematic shown in[Figure˜2](https://arxiv.org/html/2605.19376#S2.F2)\.
### 2\.1Architecture
Figure 2:GRAM Architecture\.A single stochastic latent transition in the hierarchical instantiationz=\(h,l\)z=\(h,l\)\. AfterKKlow\-level refinements viafLf\_\{\\mathrm\{L\}\}, the high\-level updatefHf\_\{\\mathrm\{H\}\}produces a deterministic proposalutu\_\{t\}, to which stochastic guidanceϵt\\epsilon\_\{t\}is added:ht=ut\+ϵth\_\{t\}=u\_\{t\}\+\\epsilon\_\{t\}\.Overview\.GRAM models the conditional distributionpθ\(y∣x\)p\_\{\\theta\}\(y\\mid x\)by marginalizing over stochastic latent reasoning trajectories\. Given an inputxx, GRAM first computes an embedding
ex=fenc\(x;θ\),\\displaystyle e\_\{x\}=f\_\{\\mathrm\{enc\}\}\(x;\\theta\),\(1\)which is reused throughout the entire recursive computation\. Starting from a fixed initial latent statez0z\_\{0\}, the model evolves the latent state through learned stochastic transitions\. The recursive computation is organized into two nested levels: inner and outer loops\.
At the inner level, a*latent transition*samples a new latent state conditioned on the previous latent state and the input embedding,
zt∼pθ\(zt∣zt−1,ex\),t=1,…,T\.\\displaystyle z\_\{t\}\\sim p\_\{\\theta\}\(z\_\{t\}\\mid z\_\{t\-1\},e\_\{x\}\),\\qquad t=1,\\dots,T\.\(2\)At the end of theTTtransitions, the decoder produces a prediction,y^=argmaxfdec\(zT;θ\)\\hat\{y\}=\\operatorname\*\{arg\\,max\}f\_\{\\mathrm\{dec\}\}\(z\_\{T\};\\theta\)\. We refer to the sequence ofTTtransitions from the initial statez0z\_\{0\}to the final statezTz\_\{T\}as a*supervision step*\. A supervision step is the unit at which the decoder is invoked, and the training objective is applied, with gradients computed as described in[Section˜2\.2](https://arxiv.org/html/2605.19376#S2.SS2)\.
At the outer level,NsupN\_\{\\mathrm\{sup\}\}supervision steps are applied recursively, with the final state of one supervision step serving as the initial state of the next, thereby forming the full recursive computation:
z0\(1\)→TtransitionszT\(1\)=z0\(2\)→Ttransitions⋯→TtransitionszT\(Nsup\),\\displaystyle z\_\{0\}^\{\(1\)\}\\;\\xrightarrow\{\\;T\\text\{ transitions\}\\;\}\\;z\_\{T\}^\{\(1\)\}=z\_\{0\}^\{\(2\)\}\\;\\xrightarrow\{\\;T\\text\{ transitions\}\\;\}\\;\\cdots\\;\\xrightarrow\{\\;T\\text\{ transitions\}\\;\}\\;z\_\{T\}^\{\(N\_\{\\mathrm\{sup\}\}\)\},\(3\)wherezt\(n\)z\_\{t\}^\{\(n\)\}denotes the latent state at thett\-th transition of thenn\-th supervision step,z0\(1\)z\_\{0\}^\{\(1\)\}is the fixed initial state, and the terminal state of one supervision step serves as the initial state of the next \(z0\(n\+1\):=zT\(n\)\\smash\{z\_\{0\}^\{\(n\+1\)\}:=z\_\{T\}^\{\(n\)\}\}\)\. This abstract formulation can be instantiated with various recurrent Transformer backbones, including flat designs such as Universal Transformers and Looped Transformers\[[10](https://arxiv.org/html/2605.19376#bib.bib10),[7](https://arxiv.org/html/2605.19376#bib.bib7)\], as well as hierarchical designs such as HRM and TRM\[[8](https://arxiv.org/html/2605.19376#bib.bib8),[9](https://arxiv.org/html/2605.19376#bib.bib9)\]\.
Stochastic Latent Transitions\.Unlike prior recursive reasoning models \(RRMs\) that update the latent state deterministically and follow a single fixed trajectory\[[8](https://arxiv.org/html/2605.19376#bib.bib8),[9](https://arxiv.org/html/2605.19376#bib.bib9)\], GRAM definespθ\(zt∣zt−1,ex\)p\_\{\\theta\}\(z\_\{t\}\\mid z\_\{t\-1\},e\_\{x\}\)as a stochastic transition, so that repeated computation induces a distribution over latent reasoning trajectories\. Concretely, GRAM realizes this transition as a learned stochastic residual perturbation around a deterministic update: at each transition, the model first computes a deterministic updateutu\_\{t\}fromzt−1z\_\{t\-1\}andexe\_\{x\}, then samples a conditional perturbation from a state\-dependent Gaussian, and adds it toutu\_\{t\}:
ϵt\\displaystyle\\epsilon\_\{t\}∼pθ\(ϵt∣ut\):=𝒩\(μθ\(ut\),σθ2\(ut\)I\),\\displaystyle\\sim p\_\{\\theta\}\(\\epsilon\_\{t\}\\mid u\_\{t\}\):=\\mathcal\{N\}\\\!\\left\(\\mu\_\{\\theta\}\(u\_\{t\}\),\\,\\sigma\_\{\\theta\}^\{2\}\(u\_\{t\}\)I\\right\),\(4\)zt\\displaystyle z\_\{t\}=ut\+ϵt\.\\displaystyle=u\_\{t\}\+\\epsilon\_\{t\}\.\(5\)We refer toϵt\\epsilon\_\{t\}as thelearnable stochastic guidance\. The meanμθ\(ut\)\\mu\_\{\\theta\}\(u\_\{t\}\)encodes a state\-dependent direction in which the trajectory is steered, while the varianceσθ2\(ut\)\\sigma\_\{\\theta\}^\{2\}\(u\_\{t\}\)controls the amount of exploration\. This design allows GRAM to capture uncertainty, prevent convergence to local minima, and support robust exploration of the solution space without discarding the deterministic refinement performed byutu\_\{t\}\.
Hierarchical Instantiation\.We instantiate the latent state with two interacting components,z=\(h,l\)z=\(h,l\)\. The high\-level componenthhis updated once per latent transition and carries abstract reasoning state, while the low\-level componentllis updatedKKtimes within a single transition and carries fine\-grained intermediate computation\. This decomposition separates the two roles across time scales, withhhaccumulating slowly across transitions andllrefined rapidly within each one\.
With this hierarchical multi\-scale structure, a single transitionzt−1→ztz\_\{t\-1\}\\to z\_\{t\}is computed as follows\. The low\-level component is first refined forKKupdates, with the high\-level component held fixed:
lt,k=fL\(ht−1,lt,k−1,ex;θ\),k=1,…,K,\\displaystyle l\_\{t,k\}=f\_\{\\mathrm\{L\}\}\(h\_\{t\-1\},\\,l\_\{t,k\-1\},\\,e\_\{x\};\\,\\theta\),\\qquad k=1,\\dots,K,\(6\)wherelt,0:=lt−1l\_\{t,0\}:=l\_\{t\-1\}and we writelt:=lt,Kl\_\{t\}:=l\_\{t,K\}for the refined low\-level component\. The high\-level component is then updated as a stochastic transition conditioned on the refinedltl\_\{t\},
ut\\displaystyle u\_\{t\}=fH\(ht−1,lt;θ\),\\displaystyle=f\_\{\\mathrm\{H\}\}\(h\_\{t\-1\},\\,l\_\{t\};\\,\\theta\),\(7\)ϵt\\displaystyle\\epsilon\_\{t\}∼pθ\(ϵt∣ut\):=𝒩\(μθ\(ut\),σθ2\(ut\)I\),\\displaystyle\\sim p\_\{\\theta\}\(\\epsilon\_\{t\}\\mid u\_\{t\}\):=\\mathcal\{N\}\\\!\\big\(\\mu\_\{\\theta\}\(u\_\{t\}\),\\,\\sigma^\{2\}\_\{\\theta\}\(u\_\{t\}\)\\,I\\big\),\(8\)ht\\displaystyle h\_\{t\}=ut\+ϵt,\\displaystyle=u\_\{t\}\+\\epsilon\_\{t\},\(9\)and we setzt=\(ht,lt\)z\_\{t\}=\(h\_\{t\},l\_\{t\}\)\. Note that stochasticity is introduced only at the high level: the low\-level refinement is fully deterministic, while the stochastic guidance signalϵt\\epsilon\_\{t\}acts on the slower, more abstract component of the latent state, where it can steer the overall reasoning trajectory across transitions111We also tried injecting noise into the low\-level state, but found that it did not improve performance\.\. Under this instantiation, the decoder reads only the high\-level component, i\.e\.,fdec\(zT\)=fdec\(hT\)f\_\{\\mathrm\{dec\}\}\(z\_\{T\}\)=f\_\{\\mathrm\{dec\}\}\(h\_\{T\}\)\. Additional architectural details are provided in Appendix[B\.1](https://arxiv.org/html/2605.19376#A2.SS1)\.
Modeling Unconditional Distribution\.While the description so far focuses on the conditional settingpθ\(y∣x\)p\_\{\\theta\}\(y\\mid x\), the same recursive process can also be defined as an unconditional generative modelpθ\(x\)p\_\{\\theta\}\(x\)when the input is replaced with an empty conditioning embedding\. We use this formulation for generation tasks in[Section˜4\.3](https://arxiv.org/html/2605.19376#S4.SS3)\.
### 2\.2Training
GRAM is trained to model the conditional distributionpθ\(y∣x\)p\_\{\\theta\}\(y\\mid x\), where each training example consists of an inputxxand its corresponding targetyy\. As a probabilistic model, GRAM adopts a latent\-variable formulation and is optimized by maximizing an evidence lower bound \(ELBO\) with respect to the generative parametersθ\\thetaand variational parametersϕ\\phi\.
Latent Variable Modeling\.We model GRAM as a latent\-variable probabilistic modelpθp\_\{\\theta\}, where the full latent trajectoryτ=\(z0→⋯→zTTotal\)\\tau=\(z\_\{0\}\\rightarrow\\cdots\\rightarrow z\_\{T\_\{\\mathrm\{Total\}\}\}\)consists of a sequence of latent variables, withTTotal=T×NsupT\_\{\\mathrm\{Total\}\}=T\\times N\_\{\\mathrm\{sup\}\}\. The conditional likelihood is defined as
pθ\(y∣x\)=∫pθ\(y∣τ,x\)pθ\(τ∣x\)𝑑τ,p\_\{\\theta\}\(y\\mid x\)=\\int p\_\{\\theta\}\(y\\mid\\tau,x\)\\,p\_\{\\theta\}\(\\tau\\mid x\)\\,d\\tau,\(10\)wherexxdenotes the input problem andyydenotes the corresponding ground\-truth output\.
Direct maximum likelihood estimation oflogpθ\(y∣x\)\\log p\_\{\\theta\}\(y\\mid x\)is intractable due to the marginalization over latent trajectories\. We therefore introduce a variational posteriorqϕ\(τ∣x,y\)q\_\{\\phi\}\(\\tau\\mid x,y\)and optimize the evidence lower bound \(ELBO\), jointly trainingθ\\thetaandϕ\\phivia variational inference:
logpθ\(y∣x\)≥𝔼qϕ\(τ∣x,y\)\[logpθ\(y∣τ,x\)\]−KL\(qϕ\(τ∣x,y\)∥pθ\(τ∣x\)\)\.\\displaystyle\\log p\_\{\\theta\}\(y\\mid x\)\\geq\\mathbb\{E\}\_\{q\_\{\\phi\}\(\\tau\\mid x,y\)\}\[\\log p\_\{\\theta\}\(y\\mid\\tau,x\)\]\-\\mathrm\{KL\}\\\!\\left\(q\_\{\\phi\}\(\\tau\\mid x,y\)\\,\\\|\\,p\_\{\\theta\}\(\\tau\\mid x\)\\right\)\.\(11\)
During training, latent trajectories are sampled from the variational posteriorqϕ\(⋅∣x,y\)q\_\{\\phi\}\(\\cdot\\mid x,y\), which has access to both the input problemxxand the target outputyy\. At inference time, whereyyis unavailable, trajectories are instead generated from the learned priorpθ\(⋅∣x\)p\_\{\\theta\}\(\\cdot\\mid x\)\.
Both the prior and the posterior are modeled as conditional Markov processes over latent states:
pθ\(τ∣x\)=p\(z0\)∏t=1TTotalpθ\(zt∣zt−1,x\),qϕ\(τ∣x,y\)=p\(z0\)∏t=1TTotalqϕ\(zt∣zt−1,x,y\)\.p\_\{\\theta\}\(\\tau\\mid x\)=p\(z\_\{0\}\)\\prod\_\{t=1\}^\{T\_\{\\mathrm\{Total\}\}\}p\_\{\\theta\}\(z\_\{t\}\\mid z\_\{t\-1\},x\),\\qquad q\_\{\\phi\}\(\\tau\\mid x,y\)=p\(z\_\{0\}\)\\prod\_\{t=1\}^\{T\_\{\\mathrm\{Total\}\}\}q\_\{\\phi\}\(z\_\{t\}\\mid z\_\{t\-1\},x,y\)\.\(12\)Here,z0z\_\{0\}is a fixed initial state shared by the prior and posterior\. Both transitions are implemented by adding reparameterized Gaussian noiseϵt\\epsilon\_\{t\}after a deterministic updateutu\_\{t\}; the posterior uses the same transition module as the prior, but samples from a target\-conditioned noise distributionqϕ\(ϵt∣ut,y\)q\_\{\\phi\}\(\\epsilon\_\{t\}\\mid u\_\{t\},y\), whereas the prior usespθ\(ϵt∣ut\)p\_\{\\theta\}\(\\epsilon\_\{t\}\\mid u\_\{t\}\)\.
Since the two processes share the same Markov structure and all stochasticity is introduced throughϵ1:TTotal\\epsilon\_\{1:T\_\{\\mathrm\{Total\}\}\}, their trajectory distributions can be equivalently represented in noise space\. Moreover, since GRAM decodes the output only from the terminal latent state, the likelihood term satisfiespθ\(y∣τ,x\)=pθ\(y∣zTTotal,x\)p\_\{\\theta\}\(y\\mid\\tau,x\)=p\_\{\\theta\}\(y\\mid z\_\{T\_\{\\mathrm\{Total\}\}\},x\)\. Therefore, the full trajectory\-level ELBO can be written as
ℒELBO=𝔼qϕ\[logpθ\(y∣zTTotal,x\)\]−∑t=1TTotal𝔼qϕ\(ϵ<t∣x,y\)\[KL\(qϕ\(ϵt∣ut,y\)∥pθ\(ϵt∣ut\)\)\]\.\\displaystyle\\mathcal\{L\}\_\{\\mathrm\{ELBO\}\}=\\mathbb\{E\}\_\{q\_\{\\phi\}\}\\big\[\\log p\_\{\\theta\}\(y\\mid z\_\{T\_\{\\mathrm\{Total\}\}\},x\)\\big\]\-\\sum\_\{t=1\}^\{T\_\{\\mathrm\{Total\}\}\}\\mathbb\{E\}\_\{q\_\{\\phi\}\(\\epsilon\_\{<t\}\\mid x,y\)\}\\Big\[\\mathrm\{KL\}\\\!\\left\(q\_\{\\phi\}\(\\epsilon\_\{t\}\\mid u\_\{t\},y\)\\,\\\|\\,p\_\{\\theta\}\(\\epsilon\_\{t\}\\mid u\_\{t\}\)\\right\)\\Big\]\.\(13\)Here,ut=fH\(ht−1,lt\)u\_\{t\}=f\_\{\\mathrm\{H\}\}\(h\_\{t\-1\},l\_\{t\}\)denotes the deterministic high\-level update before noise injection, as defined in[Equation˜9](https://arxiv.org/html/2605.19376#S2.E9)\. Sinceutu\_\{t\}depends onht−1h\_\{t\-1\}, which is determined by the previously sampled noise variablesϵ<t:=\(ϵ1,…,ϵt−1\)\\epsilon\_\{<t\}:=\(\\epsilon\_\{1\},\\dots,\\epsilon\_\{t\-1\}\), the expectation averages over these ancestral samples\.
Practical Implementation\.In practice, following previous recursive reasoning models\[[8](https://arxiv.org/html/2605.19376#bib.bib8),[9](https://arxiv.org/html/2605.19376#bib.bib9)\], we train GRAM with deep supervision overNsupN\_\{\\mathrm\{sup\}\}consecutive supervision steps, each consisting ofTTrecursive latent transitions\. This provides dense learning signals along the full latent trajectory, rather than supervising only the final state afterTTotal=T×NsupT\_\{\\mathrm\{Total\}\}=T\\times N\_\{\\mathrm\{sup\}\}transitions\. The terminal state of each step is reused as the initial state of the next step\.
Following standard practice for recurrent models with long computation chains, we apply truncated gradient propagation\[[16](https://arxiv.org/html/2605.19376#bib.bib16),[17](https://arxiv.org/html/2605.19376#bib.bib17)\], as used in recent recursive reasoning models\[[8](https://arxiv.org/html/2605.19376#bib.bib8),[9](https://arxiv.org/html/2605.19376#bib.bib9),[18](https://arxiv.org/html/2605.19376#bib.bib18)\]\. In our implementation, gradients are propagated only through the final transition of each supervision step,zT−1\(n\)→zT\(n\)\\smash\{z\_\{T\-1\}^\{\(n\)\}\\to z\_\{T\}^\{\(n\)\}\}\. This gives the following surrogate objective for each supervision step:
ℒGRAM\(n\)\(x,y;θ,ϕ\)=𝔼qϕ\[logpθ\(y∣zT\(n\),x\)\]−KL\(qϕ\(ϵT\(n\)∣uT\(n\),y\)∥pθ\(ϵT\(n\)∣uT\(n\)\)\),\\displaystyle\{\\mathcal\{L\}\}\_\{\\mathrm\{GRAM\}\}^\{\(n\)\}\(x,y;\\theta,\\phi\)=\\mathbb\{E\}\_\{q\_\{\\phi\}\}\\big\[\\log p\_\{\\theta\}\(y\\mid z\_\{T\}^\{\(n\)\},x\)\\big\]\-\\mathrm\{KL\}\\big\(q\_\{\\phi\}\(\\epsilon\_\{T\}^\{\(n\)\}\\mid u\_\{T\}^\{\(n\)\},y\)\\,\\\|\\,p\_\{\\theta\}\(\\epsilon\_\{T\}^\{\(n\)\}\\mid u\_\{T\}^\{\(n\)\}\)\\big\),\(14\)wherezT\(n\)z\_\{T\}^\{\(n\)\}is the terminal state of the current supervision stepnn, and gradients are stopped through preceding states\. Thus,ℒGRAM\\mathcal\{L\}\_\{\\mathrm\{GRAM\}\}should be viewed as a truncated surrogate objective rather than the exact ELBO; it introduces a biased but memory\-efficient approximation to the full ELBO\. Further analysis of this approximation is provided in Appendix[A\.3](https://arxiv.org/html/2605.19376#A1.SS3), and detailed training hyperparameters are listed in Appendix[B\.2](https://arxiv.org/html/2605.19376#A2.SS2)\.
### 2\.3Inference\-Time Scaling
GRAM supports two complementary axes of inference\-time scaling:*depth*, by varying the number of recursive transitions, and*width*, by sampling multiple latent reasoning trajectories in parallel\. For depth, we follow prior recursive reasoning models\[[8](https://arxiv.org/html/2605.19376#bib.bib8),[9](https://arxiv.org/html/2605.19376#bib.bib9)\]in adopting adaptive computation time \(ACT\)\[[8](https://arxiv.org/html/2605.19376#bib.bib8),[9](https://arxiv.org/html/2605.19376#bib.bib9),[10](https://arxiv.org/html/2605.19376#bib.bib10)\], which allows each trajectory to terminate at a learned halting depth \(details in Appendix[A\.1](https://arxiv.org/html/2605.19376#A1.SS1)\)\. For width — the focus of this section — we draw\{τ\(i\)\}i=1N∼pθ\(τ∣x\)\\smash\{\\\{\\tau^\{\(i\)\}\\\}\_\{i=1\}^\{N\}\\sim p\_\{\\theta\}\(\\tau\\mid x\)\}from the learned prior and decode each terminal state into a candidate outputy^\(i\)=fdec\(zT\(i\)\)\\smash\{\\hat\{y\}^\{\(i\)\}=f\_\{\\mathrm\{dec\}\}\(z\_\{T\}^\{\(i\)\}\)\}, exploring multiple stochastic reasoning paths simultaneously rather than extending a single trajectory\.
To select among candidates, we use either majority voting or best\-of\-N with a Latent Process Reward Model \(LPRM\)\. The LPRM is a value headvψ\(zt\)v\_\{\\psi\}\(z\_\{t\}\)trained to predict the final quality of a trajectory from its latent state, using a regression targetr∈\[0,1\]r\\in\[0,1\]given by the final prediction accuracy\. At inference time, majority voting selects the most frequent prediction, whereas LPRM\-guided selection chooses the candidate with the highest predicted terminal value\. Details of LPRM training are provided in Appendix[A\.2](https://arxiv.org/html/2605.19376#A1.SS2)\. Overall, this procedure improves robustness and solution quality through parallel exploration, without increasing the sequential recursion length\.
## 3Related Work
Latent Reasoning\.Latent reasoning aims to reduce the inefficiency and verbosity of explicit Chain\-of\-Thought \(CoT\) by shifting part or all of the reasoning process into latent or continuous representations\[[1](https://arxiv.org/html/2605.19376#bib.bib1),[2](https://arxiv.org/html/2605.19376#bib.bib2),[3](https://arxiv.org/html/2605.19376#bib.bib3),[4](https://arxiv.org/html/2605.19376#bib.bib4),[5](https://arxiv.org/html/2605.19376#bib.bib5),[6](https://arxiv.org/html/2605.19376#bib.bib6)\]\. By avoiding token\-by\-token generation of intermediate steps, such representations can make reasoning traces more compact and reduce generation overhead\. Existing approaches instantiate this idea through hidden states, latent or soft tokens, continuous thoughts, internal reasoning traces, and recursive state updates for scaling test\-time computation\[[4](https://arxiv.org/html/2605.19376#bib.bib4),[7](https://arxiv.org/html/2605.19376#bib.bib7),[19](https://arxiv.org/html/2605.19376#bib.bib19),[20](https://arxiv.org/html/2605.19376#bib.bib20),[21](https://arxiv.org/html/2605.19376#bib.bib21),[22](https://arxiv.org/html/2605.19376#bib.bib22),[23](https://arxiv.org/html/2605.19376#bib.bib23),[18](https://arxiv.org/html/2605.19376#bib.bib18),[24](https://arxiv.org/html/2605.19376#bib.bib24),[25](https://arxiv.org/html/2605.19376#bib.bib25),[26](https://arxiv.org/html/2605.19376#bib.bib26)\]\. However, many remain organized around autoregressive sequence generation, where additional computation is tied to generating more tokens, latent positions, or sequential reasoning states\.
Recursive Architectures\.Recursive architectures perform iterative state updates and have evolved from RNNs to weight\-sharing Transformers with adaptive computation\[[7](https://arxiv.org/html/2605.19376#bib.bib7),[10](https://arxiv.org/html/2605.19376#bib.bib10),[27](https://arxiv.org/html/2605.19376#bib.bib27),[28](https://arxiv.org/html/2605.19376#bib.bib28),[29](https://arxiv.org/html/2605.19376#bib.bib29),[30](https://arxiv.org/html/2605.19376#bib.bib30),[31](https://arxiv.org/html/2605.19376#bib.bib31),[32](https://arxiv.org/html/2605.19376#bib.bib32),[25](https://arxiv.org/html/2605.19376#bib.bib25)\]\. Recent recursive reasoning models show that increasing inference\-time depth can outperform larger static models\[[8](https://arxiv.org/html/2605.19376#bib.bib8),[9](https://arxiv.org/html/2605.19376#bib.bib9),[18](https://arxiv.org/html/2605.19376#bib.bib18),[24](https://arxiv.org/html/2605.19376#bib.bib24)\]\. GRAM builds on this line but formulates recurrence as a probabilistic process: instead of following a single deterministic refinement path, it maintains stochastic latent trajectories, enabling multi\-path exploration and generative sampling\.
Probabilistic Latent State\-Space Models\.Probabilistic recurrent models use stochastic latent transitions to capture uncertainty and multimodal dynamics, often trained with variational inference\[[33](https://arxiv.org/html/2605.19376#bib.bib33),[34](https://arxiv.org/html/2605.19376#bib.bib34),[35](https://arxiv.org/html/2605.19376#bib.bib35),[36](https://arxiv.org/html/2605.19376#bib.bib36),[37](https://arxiv.org/html/2605.19376#bib.bib37),[38](https://arxiv.org/html/2605.19376#bib.bib38)\]\. They have been widely used in sequential generative modeling, video prediction, and model\-based reinforcement learning\. GRAM shares this latent state\-space view but reinterprets stochastic dynamics as computation rather than temporal observation modeling: latent transitions define possible reasoning trajectories, supporting multi\-hypothesis exploration and both conditionalpθ\(y∣x\)p\_\{\\theta\}\(y\\mid x\)and unconditionalpθ\(x\)p\_\{\\theta\}\(x\)generation\.
## 4Experiments
GRAM is designed as an architecture for probabilistic recursive reasoning, rather than as a general\-purpose large language reasoning model whose training data, inference budgets, prompting strategies, tool use, and external scaffolding are not directly comparable\. Following prior work on recurrent and recursive reasoning models\[[8](https://arxiv.org/html/2605.19376#bib.bib8),[9](https://arxiv.org/html/2605.19376#bib.bib9)\], we therefore evaluate GRAM on standard structured reasoning tasks that probe the computational properties targeted by our formulation: iterative latent refinement, stochastic trajectory exploration, multi\-solution coverage, and inference\-time scaling\.
In the following, we first evaluate structured reasoning performance on Sudoku\-Extreme and ARC\-AGI \(Section[4\.1](https://arxiv.org/html/2605.19376#S4.SS1)\)\. We then assess multi\-solution behavior on N\-Queens and Graph Coloring \(Section[4\.2](https://arxiv.org/html/2605.19376#S4.SS2)\)\. Next, we examine the unconditional generative interpretation of GRAM on binarized MNIST \(Section[4\.3](https://arxiv.org/html/2605.19376#S4.SS3)\)\. Finally, we perform ablation studies to evaluate the impact of key design choices \(Section[4\.4](https://arxiv.org/html/2605.19376#S4.SS4)\)\.
Figure 3:Performance on puzzle benchmarks\.On both Sudoku\-Extreme and ARC\-AGI, GRAM consistently outperforms all deterministic recursive baselines \(Looped TF, HRM, TRM\), demonstrating that stochastic latent transitions yield substantial gains within the recursive\-reasoning paradigm\. Looped TF results on ARC\-AGI are omitted due to prohibitive training cost \(see[Section˜C\.1\.1](https://arxiv.org/html/2605.19376#A3.SS1.SSS1)\) Note that large reasoning model scores are included only as external reference points for benchmark difficulty\.### 4\.1Challenging Puzzle Tasks
Figure 4:\(Left\) Inference\-time scaling on Sudoku\-Extreme\.While both TRM and GRAM benefit from longer recursion \(x\-axis\), GRAM additionally scales with parallel sampling \(NN= number of samples\); each iteration corresponds to a supervision step, while meaningK×K\\timesmore flat iterations in Looped TF\.\(Right\) Accuracy across number of solutions in N\-Queens \(8×88\\times 8\)\.Conventional deterministic recursive models suffer a sharp performance drop as the number of possible solutions increases, whereas GRAM maintains consistent performance\.Setup\.We evaluate on Sudoku\-Extreme\[[8](https://arxiv.org/html/2605.19376#bib.bib8)\], which contains 9×\\times9 puzzles with minimal clues requiring extensive constraint propagation, and ARC\-AGI Challenge\[[13](https://arxiv.org/html/2605.19376#bib.bib13),[14](https://arxiv.org/html/2605.19376#bib.bib14)\], which tests abstract visual reasoning through few\-shot pattern recognition\. We compare against direct prediction \(Transformer\[[39](https://arxiv.org/html/2605.19376#bib.bib39)\]\), a flat recursive baselines \(Looped TF\[[7](https://arxiv.org/html/2605.19376#bib.bib7)\], HRM\[[8](https://arxiv.org/html/2605.19376#bib.bib8)\], TRM\[[9](https://arxiv.org/html/2605.19376#bib.bib9)\]\)\. Reported large reasoning model results\[[40](https://arxiv.org/html/2605.19376#bib.bib40)\]are included as external reference points for benchmark difficulty, rather than as controlled baselines, since their training and inference settings are not directly comparable to task\-specific recursive models\. For the scaling analysis, all baselines \(Looped TF, HRM, TRM\) are reproduced under identical settings followingYang et al\. \[[7](https://arxiv.org/html/2605.19376#bib.bib7)\]andJolicoeur\-Martineau \[[9](https://arxiv.org/html/2605.19376#bib.bib9)\]\.
Stochastic Guidance Improves Reasoning\.Figure[3](https://arxiv.org/html/2605.19376#S4.F3)and Table[8](https://arxiv.org/html/2605.19376#A4.T8)summarize our main results\. GRAM consistently outperforms prior recursive models across all benchmarks\. We attribute this improvement to the fundamental difference in how reasoning trajectories are utilized\. While Looped TF, HRM, and TRM are restricted to learning from a single deterministic path, GRAM leverages stochastic transitions to explore diverse reasoning trajectories\. By training on this richer distribution of solution paths, GRAM acquires more robust reasoning capabilities, allowing it to navigate complex problem spaces more effectively than models constrained to a single sequential refinement process\. Detailed experiment results, including more state\-of\-art methods, are provided in Appendix[D\.1](https://arxiv.org/html/2605.19376#A4.SS1)\.
Parallel Sampling Provides a New Test\-time Scaling Axis\.Figure[4](https://arxiv.org/html/2605.19376#S4.F4)\(left\) shows that increasing the number of parallel samples consistently improves performance across all iteration counts\. Notably, GRAM withN=20N=20samples at 16 iterations outperforms all deterministic baselines at 320 iterations, including TRM \(97\.0% vs 90\.5%\), despite comparable computational budget\. While deterministic recursive models scale only through sequential refinement, GRAM leverages stochastic transitions to explore multiple reasoning paths in parallel\. To select the best trajectory, we employ a Latent Process Reward Model \(LPRM\) that predicts output correctness \(Section[2\.3](https://arxiv.org/html/2605.19376#S2.SS3)\)\. This parallel scaling bypasses the latency bottlenecks of depth\-based scaling while achieving superior performance\. Additional analysis on the ARC\-AGI Challenge is provided in Appendix[D\.2](https://arxiv.org/html/2605.19376#A4.SS2)\.
### 4\.2Multi\-solution Puzzle Tasks
Setup\.To evaluate whether GRAM can capture diverse solutions, we test on N\-Queens \(8×88\\times 8,10×1010\\times 10\) and Graph Coloring \(8\-vertex, 10\-vertex\) tasks, where multiple valid solutions exist for each input\. We compare against direct prediction \(Transformer\[[39](https://arxiv.org/html/2605.19376#bib.bib39)\]\), recursive models \(Looped TF\[[7](https://arxiv.org/html/2605.19376#bib.bib7)\], HRM\[[8](https://arxiv.org/html/2605.19376#bib.bib8)\], TRM\[[9](https://arxiv.org/html/2605.19376#bib.bib9)\]\), and generative models \(Autoregressive Transformer \(AR\), MDLM\[[41](https://arxiv.org/html/2605.19376#bib.bib41)\]\)\. For N\-Queens, we report accuracy \(whether the output satisfies all constraints\) and coverage \(found / total valid solutions, with 20 samples\)\. For Graph Coloring, we report conflict edges \(number of constraint violations; lower is better\) instead of accuracy\. Detailed configurations are provided in Appendix[C\.2](https://arxiv.org/html/2605.19376#A3.SS2)\.
Deterministic Recursion Fails on Multi\-Solution Tasks\.Table[1](https://arxiv.org/html/2605.19376#S4.T1)reveals that deterministic recursive models structurally cannot capture multiple solutions, with coverage at most 36\.1% across all tasks\. Figure[4](https://arxiv.org/html/2605.19376#S4.F4)\(right\) further illustrates this limitation: as the number of valid solutions increases, all three deterministic recursive baselines exhibit sharp accuracy degradation, whereas GRAM maintains consistent performance regardless of solution count\. This confirms that deterministic latent updates cause mode collapse when multiple valid outputs exist for the same input\. Additional coverage analysis is provided in Appendix[D\.3](https://arxiv.org/html/2605.19376#A4.SS3)\.
Recursive Refinement Yields Sharper Constraint Satisfaction\.While generative models \(AR, MDLM\) achieve high coverage, GRAM consistently attains higher accuracy with comparable diversity\. On N\-Queens, GRAM reaches 99\.7% accuracy versus 96\.3% \(AR\) and 96\.1% \(MDLM\)\. The gap is more pronounced on Graph Coloring, where GRAM reduces conflict edges to 2\.7 and 3\.3 on 8\- and 10\-vertex tasks, compared to 19\.0 and 61\.3 for AR\. This demonstrates that recursive refinement enables stricter constraint satisfaction than generative sampling alone\.
Table 1:Evaluation on N\-Queens and Graph Coloring benchmarks\.Rec\. and Gen\. indicate whether the model uses recursive computation and generative sampling, respectively\. Values are mean±\\pmstandard deviation over runs\. Accuracy: single\-sample \(%\)\. Conflict: constraint\-violating edges \(↓\\downarrow\)\. Coverage: unique valid solutions discovered with 20 samples \(%\)\.N\-QueensGraph Coloring8×88\\times 810×1010\\times 108\-vertex10\-vertexMethodRec\.Gen\.\# ParamsAccuracyCoverageAccuracyCoverageConflict↓\\downarrowCoverageConflict↓\\downarrowCoverageDirect Pred \(8 layers\)✗✗27M40\.4±1\.1\\pm 1\.113\.7±1\.1\\pm 1\.113\.6±0\.5\\pm 0\.51\.6±0\.2\\pm 0\.2179\.3±4\.0\\pm 4\.019\.9±0\.2\\pm 0\.2198\.7±5\.0\\pm 5\.06\.7±0\.1\\pm 0\.1Direct Pred \(32 layers\)✗✗100M40\.2±1\.3\\pm 1\.313\.6±1\.1\\pm 1\.113\.1±0\.4\\pm 0\.41\.6±0\.2\\pm 0\.2174\.0±18\.0\\pm 18\.019\.1±1\.7\\pm 1\.7227\.7±34\.5\\pm 34\.56\.5±1\.9\\pm 1\.9Looped TF✓✗7M68\.4±3\.7\\pm 3\.723\.6±1\.9\\pm 1\.950\.0±7\.6\\pm 7\.66\.2±3\.2\\pm 3\.2136\.0±16\.1\\pm 16\.120\.5±1\.5\\pm 1\.5157\.3±9\.0\\pm 9\.07\.2±0\.7\\pm 0\.7HRM✓✗27M78\.7±2\.9\\pm 2\.926\.7±1\.3\\pm 1\.337\.4±0\.3\\pm 0\.34\.7±0\.1\\pm 0\.1109\.7±1\.5\\pm 1\.521\.8±0\.3\\pm 0\.3164\.3±21\.6\\pm 21\.68\.9±1\.7\\pm 1\.7TRM✓✗7M66\.8±5\.7\\pm 5\.736\.1±22\.5\\pm 22\.517\.5±11\.2\\pm 11\.22\.0±1\.3\\pm 1\.3109\.3±3\.1\\pm 3\.122\.3±0\.6\\pm 0\.6170\.7±17\.9\\pm 17\.96\.8±0\.3\\pm 0\.3AR✗✓10\.6M96\.3±1\.0\\pm 1\.084\.8±0\.8\\pm 0\.890\.0±2\.2\\pm 2\.253\.2±0\.8\\pm 0\.819\.0±11\.3\\pm 11\.383\.0±0\.7\\pm 0\.761\.3±8\.3\\pm 8\.340\.0±0\.3\\pm 0\.3MDLM✗✓12\.6M96\.1±1\.5\\pm 1\.587\.2±0\.6\\pm 0\.674\.3±6\.6\\pm 6\.647\.4±2\.2\\pm 2\.22\.7±0\.6\\pm 0\.684\.5±4\.0\\pm 4\.012\.0±7\.0\\pm 7\.048\.2±1\.4\\pm 1\.4GRAM \(Ours\)✓✓10M99\.7±0\.3\\pm 0\.390\.3±1\.9\\pm 1\.989\.7±2\.7\\pm 2\.757\.5±3\.4\\pm 3\.42\.7±2\.1\\pm 2\.185\.8±0\.5\\pm 0\.53\.3±1\.5\\pm 1\.551\.3±2\.8\\pm 2\.8
### 4\.3Exploring GRAM as an Unconditional Generator
Table 2:Unconditional generation results on binarized MNIST\.We report IS \(↑\\uparrow\) and FID \(↓\\downarrow\)\. For iterative models, a step corresponds to a supervision step for TRM and GRAM, and a denoising step for D3PM\. FID is calculated using real samples with original pixel values \(0–255\)\.
Figure 5:Unconditional Sudoku generation\.Validity \(%\) of generated Sudoku puzzles\. GRAM achieves higher validity than D3PM with substantially fewer parameters and steps\.
Setup\.To investigate GRAM’s unconditional generative capability beyond conditional reasoning, we evaluate generation in two domains: structured constraint generation on*Sudoku*\(from empty boards, evaluated by the fraction of generated boards satisfying Sudoku constraints\) and image generation on*binarized MNIST*\[[15](https://arxiv.org/html/2605.19376#bib.bib15)\], where pixel values are thresholded to0or11\(evaluated by Inception Score \(IS\)\[[42](https://arxiv.org/html/2605.19376#bib.bib42)\]and FID\[[43](https://arxiv.org/html/2605.19376#bib.bib43)\]\)\. In both cases, the input is replaced by an empty conditioning signal and the model samples an output from its learned prior\. Baselines include D3PM\[[44](https://arxiv.org/html/2605.19376#bib.bib44)\], a discrete diffusion model, on both tasks, and additionally a VAE\[[45](https://arxiv.org/html/2605.19376#bib.bib45)\]trained with binary reconstruction loss on MNIST\. To ensure a fair comparison with existing literature, FID is calculated using real samples from the original standard MNIST\.
Generative Behavior Beyond Reasoning\.GRAM extends from conditional reasoning to unconditional generation in two different domains\. On Sudoku generation \([Figure˜5](https://arxiv.org/html/2605.19376#S4.F5)\), GRAM produces valid boards with 99\.05% validity using 10\.9M parameters and 16 supervision steps, surpassing D3PM baselines that use up to 55\.1M parameters and 1000 denoising steps\.[Figure˜7](https://arxiv.org/html/2605.19376#S4.F7)shows qualitative examples, illustrating that the model produces diverse, fully valid boards from empty inputs without any explicit constraint checker\. On MNIST \([Table˜2](https://arxiv.org/html/2605.19376#S4.T2)\), the deterministic baseline TRM exhibits mode collapse \(FID 303\.29\), whereas GRAM produces recognizable digits with IS and FID comparable to D3PM\. Together, these results indicate that GRAM’s stochastic latent transitions support generative modeling beyond symbolic reasoning, with constraint satisfaction emerging as a natural byproduct of the recursive generative process\.
Inference\-Time Scaling Transfers to Generation\.[Table˜2](https://arxiv.org/html/2605.19376#S4.T2)further shows that increasing recursion at inference improves generation quality monotonically \(IS1\.85→2\.041\.85\\\!\\to\\\!2\.04, FID84\.08→73\.3484\.08\\\!\\to\\\!73\.34from 8 to 256 steps\), even though training uses only 16 steps\. This indicates that the iterative\-refinement advantage of recursive models carries over into the generative regime\.[Figure˜6](https://arxiv.org/html/2605.19376#S4.F6)visualizes this process; additional samples are in[Section˜D\.4](https://arxiv.org/html/2605.19376#A4.SS4)\.
Figure 6:Visualization of the generation process and samples\.\(a\) The generation process over recursion steps\. Each row corresponds to a different model\. GRAM \(bottom\) progressively refines the generated image through recursive latent updates, correcting initial errors\. \(b\) Unconditional generated samples from each model\.
### 4\.4Ablation Study
We ablate key design choices of GRAM on Sudoku\-Extreme and N\-Queens \(8×88\\times 8\) using 5 samples\. Table[3](https://arxiv.org/html/2605.19376#S4.T3)summarizes the results\.
Table 3:Ablation study on Sudoku\-Extreme and N\-Queens \(8×88\\times 8\)\.We evaluate with 5 samples\. For \(a\), Components are added cumulatively to the Looped TF baseline \(DS = deep supervision, HR = hierarchical recursion, SG = stochastic guidance\)\. For \(b\), both stochasticity and learned guidance are essential—removing either significantly degrades performance\.\(a\)Architecture Ablation\.
\(b\)Mechanism Ablation\.
Stochastic Guidance Provides Consistent Gains Across Architectures\.[Table˜3\(a\)](https://arxiv.org/html/2605.19376#S4.T3.st1)shows that stochastic guidance \(SG\) improves performance regardless of the underlying architecture: SG alone lifts the flat Looped TF baseline, and combining SG with deep supervision already reaches 100% on N\-Queens\. The full GRAM \(with hierarchical recursion on top\) achieves the best results overall \(93\.96% / 99\.69%\)\. While the effect of hierarchical recursion is task\-dependent, SG yields consistent gains in every configuration, supporting our design of stochastic guidance as the core extension introduced by GRAM\.
Both Stochasticity and Guidance Are Essential\.We ablate each component by modifying the learned distributionϵt∼𝒩\(μθ,σθ2I\)\\epsilon\_\{t\}\\sim\\mathcal\{N\}\(\\mu\_\{\\theta\},\\sigma^\{2\}\_\{\\theta\}I\)in[Equation˜4](https://arxiv.org/html/2605.19376#S2.E4)\. Removing guidance \(𝒩\(0,σθ2I\)\\mathcal\{N\}\(0,\\sigma^\{2\}\_\{\\theta\}I\)\) maintains Sudoku performance \(94\.88%\), indicating that stochasticity alone can enable diverse reasoning paths\. However, this variant collapses on N\-Queens \(50\.27%\), where structured guidance is necessary to navigate multi\-solution spaces\. Removing stochasticity \(𝒩\(μθ,0\)\\mathcal\{N\}\(\\mu\_\{\\theta\},0\)\) fails completely \(0\.0% on both tasks\), as deterministic guidance conditioned on the target leads to severe overfitting\.
Naive Stochasticity Does Not Help TRM\.We test two simple approaches to add stochasticity to TRM: \(1\)stochastic decoding, which samples from the output distribution instead of argmax, and \(2\)random initialization, which samplesz0z\_\{0\}from a Gaussian𝒩\(0,I\)\\mathcal\{N\}\(0,I\)at each inference\. Neither improves performance, demonstrating that GRAM’s gains stem from the variational framework rather than mere randomness\.
Figure 7:Qualitative examples of unconditional Sudoku generation by GRAM\.Each board is independently sampled from an empty grid using the learned prior\. GRAM produces diverse, complete boards satisfying all row, column, and box constraints, without an explicit constraint checker or search procedure\. Incorrect digits are highlighted in red\.
## 5Conclusions and Limitations
We introduced GRAM, a generative framework that transforms deterministic recursive architectures into probabilistic generative models capable of modeling bothp\(y∣x\)p\(y\\mid x\)andp\(x\)p\(x\)via recursive amortized variational inference\. For reasoning problems, introducing stochasticity into latent transitions enables diverse solution discovery and improved exploration compared to deterministic counterparts\. Notably, we demonstrate GRAM can leverage width\-based inference\-time scaling as a complement to depth: by sampling multiple latent trajectories in parallel, bypassing the latency bottleneck of depth\-only scaling\. Our ablations further reveal that stochastic guidance is a general\-purpose extension that consistently improves any recursive architecture, and that the gains stem specifically from the variational framework — not from mere randomness, as naive stochastic alternatives applied to existing models yield no improvement\.
Beyond solution\-seeking, GRAM also demonstrates potential as an unconditional generative model through recursion\-based generation over inputs, with generation quality improving monotonically with recursive depth even beyond training\-time steps\. This suggests new directions for generative modeling via hierarchical recursion\. Despite these strengths, the sequential nature of deep supervision limits training efficiency compared to Transformers, posing a significant barrier to scaling GRAM toward larger foundation models\.
## Acknowledgment
This research was supported by the Brain Pool Plus Program \(No\. 2021H1D3A2A03103645\) and the GRDC \(Global Research Development Center\) Cooperative Hub Program \(RS\-2024\-00436165\) through the National Research Foundation of Korea \(NRF\) funded by the Ministry of Science and ICT \(MSIT\)\. This work was also supported by the Institute of Information & Communications Technology Planning & Evaluation \(IITP\) grant funded by the Korea government \(MSIT\) \(No\. RS\-2024\-00509279, Global AI Frontier Lab\) and by the NYU\-KAIST Global Innovation and Research Institute\. Minsu Kim acknowledges funding from the KAIST Jang Young Sil Fellow Program\. We are especially grateful to Gyubin and Seungju for their non\-trivial contributions, and we thank the members of the MLML for valuable discussions and feedback throughout this project\.
## Broader Impacts
GRAM studies probabilistic recursive reasoning for structured reasoning and generation\. By maintaining multiple latent trajectories, it may benefit tasks such as constraint satisfaction, and scientific problem solving, where uncertainty and multiple valid solutions are common\. It also suggests a way to improve reasoning through inference\-time computation rather than parameter scaling alone\. Its generality also entails risks: plausible but invalid generations may be mistaken for verified solutions in downstream decision\-making pipelines, and multi\-sample inference may increase computational and energy costs at scale\. Since our experiments focus on controlled benchmarks, deployment in real\-world or high\-stakes settings would require rigorous validation, uncertainty calibration, and domain\-specific safeguards\.
## References
- Wei et al\. \[2022\]Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny Zhou, et al\.Chain\-of\-thought prompting elicits reasoning in large language models\.*Advances in neural information processing systems*, 35:24824–24837, 2022\.
- Yao et al\. \[2023\]Shunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran, Tom Griffiths, Yuan Cao, and Karthik Narasimhan\.Tree of thoughts: Deliberate problem solving with large language models\.*Advances in neural information processing systems*, 36:11809–11822, 2023\.
- Besta et al\. \[2024\]Maciej Besta, Nils Blach, Ales Kubicek, Robert Gerstenberger, Michal Podstawski, Lukas Gianinazzi, Joanna Gajda, Tomasz Lehmann, Hubert Niewiadomski, Piotr Nyczyk, et al\.Graph of thoughts: Solving elaborate problems with large language models\.In*Proceedings of the AAAI conference on artificial intelligence*, volume 38, pages 17682–17690, 2024\.
- Hao et al\. \[2024\]Shibo Hao, Sainbayar Sukhbaatar, DiJia Su, Xian Li, Zhiting Hu, Jason Weston, and Yuandong Tian\.Training large language models to reason in a continuous latent space\.*arXiv preprint arXiv:2412\.06769*, 2024\.
- Zhu et al\. \[2025\]Hanlin Zhu, Shibo Hao, Zhiting Hu, Jiantao Jiao, Stuart Russell, and Yuandong Tian\.Reasoning by superposition: A theoretical perspective on chain of continuous thought\.*arXiv preprint arXiv:2505\.12514*, 2025\.
- Gozeten et al\. \[2025\]Halil Alperen Gozeten, M Emrullah Ildiz, Xuechen Zhang, Hrayr Harutyunyan, Ankit Singh Rawat, and Samet Oymak\.Continuous chain of thought enables parallel exploration and reasoning\.*arXiv preprint arXiv:2505\.23648*, 2025\.
- Yang et al\. \[2023\]Liu Yang, Kangwook Lee, Robert Nowak, and Dimitris Papailiopoulos\.Looped transformers are better at learning learning algorithms\.*arXiv preprint arXiv:2311\.12424*, 2023\.
- Wang et al\. \[2025\]Guan Wang, Jin Li, Yuhao Sun, Xing Chen, Changling Liu, Yue Wu, Meng Lu, Sen Song, and Yasin Abbasi Yadkori\.Hierarchical reasoning model\.*arXiv preprint arXiv:2506\.21734*, 2025\.
- Jolicoeur\-Martineau \[2025\]Alexia Jolicoeur\-Martineau\.Less is more: Recursive reasoning with tiny networks\.*arXiv preprint arXiv:2510\.04871*, 2025\.
- Dehghani et al\. \[2018\]Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Łukasz Kaiser\.Universal transformers\.*arXiv preprint arXiv:1807\.03819*, 2018\.
- Kahneman \[2011\]Daniel Kahneman\.Thinking, fast and slow\.*Farrar, Straus and Giroux*, 2011\.
- Bengio \[2017\]Yoshua Bengio\.The consciousness prior\.*arXiv preprint arXiv:1709\.08568*, 2017\.
- Chollet \[2019\]François Chollet\.On the measure of intelligence\.*arXiv preprint arXiv:1911\.01547*, 2019\.
- Chollet et al\. \[2025\]Francois Chollet, Mike Knoop, Gregory Kamradt, Bryan Landers, and Henry Pinkard\.Arc\-agi\-2: A new challenge for frontier ai reasoning systems\.*arXiv preprint arXiv:2505\.11831*, 2025\.
- Lecun et al\. \[1998\]Y\. Lecun, L\. Bottou, Y\. Bengio, and P\. Haffner\.Gradient\-based learning applied to document recognition\.*Proceedings of the IEEE*, 86\(11\):2278–2324, 1998\.doi:10\.1109/5\.726791\.
- Williams and Peng \[1990\]Ronald J Williams and Jing Peng\.An efficient gradient\-based algorithm for on\-line training of recurrent network trajectories\.*Neural computation*, 2\(4\):490–501, 1990\.
- Tallec and Ollivier \[2017\]Corentin Tallec and Yann Ollivier\.Unbiasing truncated backpropagation through time\.*arXiv preprint arXiv:1705\.08209*, 2017\.
- Geiping et al\. \[2025\]Jonas Geiping, Sean McLeish, Neel Jain, John Kirchenbauer, Siddharth Singh, Brian R Bartoldson, Bhavya Kailkhura, Abhinav Bhatele, and Tom Goldstein\.Scaling up test\-time compute with latent reasoning: A recurrent depth approach\.*arXiv preprint arXiv:2502\.05171*, 2025\.
- Zhuang et al\. \[2025\]Yufan Zhuang, Liyuan Liu, Chandan Singh, Jingbo Shang, and Jianfeng Gao\.Text generation beyond discrete token sampling\.*arXiv preprint arXiv:2505\.14827*, 2025\.
- Zhang et al\. \[2025\]Zhen Zhang, Xuehai He, Weixiang Yan, Ao Shen, Chenyang Zhao, Shuohang Wang, Yelong Shen, and Xin Eric Wang\.Soft thinking: Unlocking the reasoning potential of llms in continuous concept space\.*arXiv preprint arXiv:2505\.15778*, 2025\.
- Butt et al\. \[2025\]Natasha Butt, Ariel Kwiatkowski, Ismail Labiad, Julia Kempe, and Yann Ollivier\.Soft tokens, hard truths\.*arXiv preprint arXiv:2509\.19170*, 2025\.
- Shen et al\. \[2025\]Zhenyi Shen, Hanqi Yan, Linhai Zhang, Zhanghao Hu, Yali Du, and Yulan He\.Codi: Compressing chain\-of\-thought into continuous space via self\-distillation\.*arXiv preprint arXiv:2502\.21074*, 2025\.
- Yue et al\. \[2025\]Zhenrui Yue, Bowen Jin, Huimin Zeng, Honglei Zhuang, Zhen Qin, Jinsung Yoon, Lanyu Shang, Jiawei Han, and Dong Wang\.Hybrid latent reasoning via reinforcement learning\.*arXiv preprint arXiv:2505\.18454*, 2025\.
- Bae et al\. \[2025\]Sangmin Bae, Yujin Kim, Reza Bayat, Sungnyun Kim, Jiyoun Ha, Tal Schuster, Adam Fisch, Hrayr Harutyunyan, Ziwei Ji, Aaron Courville, et al\.Mixture\-of\-recursions: Learning dynamic recursive depths for adaptive token\-level computation\.*arXiv preprint arXiv:2507\.10524*, 2025\.
- Mohtashami et al\. \[2023\]Amirkeivan Mohtashami, Matteo Pagliardini, and Martin Jaggi\.Cotformer: A chain\-of\-thought driven architecture with budget\-adaptive computation cost at inference\.*arXiv preprint arXiv:2310\.10845*, 2023\.
- Bae et al\. \[2024\]Sangmin Bae, Adam Fisch, Hrayr Harutyunyan, Ziwei Ji, Seungyeon Kim, and Tal Schuster\.Relaxed recursive transformers: Effective parameter sharing with layer\-wise lora\.*arXiv preprint arXiv:2410\.20672*, 2024\.
- Elman \[1990\]Jeffrey L Elman\.Finding structure in time\.*Cognitive science*, 14\(2\):179–211, 1990\.
- Hochreiter and Schmidhuber \[1997\]Sepp Hochreiter and Jürgen Schmidhuber\.Long short\-term memory\.*Neural computation*, 9\(8\):1735–1780, 1997\.
- Cho et al\. \[2014\]Kyunghyun Cho, Bart Van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio\.Learning phrase representations using rnn encoder\-decoder for statistical machine translation\.*arXiv preprint arXiv:1406\.1078*, 2014\.
- Lan et al\. \[2019\]Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut\.Albert: A lite bert for self\-supervised learning of language representations\.*arXiv preprint arXiv:1909\.11942*, 2019\.
- Elbayad et al\. \[2019\]Maha Elbayad, Jiatao Gu, Edouard Grave, and Michael Auli\.Depth\-adaptive transformer\.*arXiv preprint arXiv:1910\.10073*, 2019\.
- Graves \[2016\]Alex Graves\.Adaptive computation time for recurrent neural networks\.*arXiv preprint arXiv:1603\.08983*, 2016\.
- Chung et al\. \[2016\]Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron Courville, and Yoshua Bengio\.A recurrent latent variable model for sequential data, 2016\.URL[https://arxiv\.org/abs/1506\.02216](https://arxiv.org/abs/1506.02216)\.
- Fraccaro et al\. \[2016\]Marco Fraccaro, Søren Kaae Sønderby, Ulrich Paquet, and Ole Winther\.Sequential neural models with stochastic layers, 2016\.URL[https://arxiv\.org/abs/1605\.07571](https://arxiv.org/abs/1605.07571)\.
- Krishnan et al\. \[2015\]Rahul G\. Krishnan, Uri Shalit, and David Sontag\.Deep kalman filters, 2015\.URL[https://arxiv\.org/abs/1511\.05121](https://arxiv.org/abs/1511.05121)\.
- Hafner et al\. \[2019\]Danijar Hafner, Timothy Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson\.Learning latent dynamics for planning from pixels, 2019\.URL[https://arxiv\.org/abs/1811\.04551](https://arxiv.org/abs/1811.04551)\.
- Hafner et al\. \[2020\]Danijar Hafner, Timothy Lillicrap, Mohammad Norouzi, and Jimmy Ba\.Mastering atari with discrete world models\.*arXiv preprint arXiv:2010\.02193*, 2020\.
- Hafner et al\. \[2023\]Danijar Hafner, Jurgis Pasukonis, Jimmy Ba, and Timothy Lillicrap\.Mastering diverse domains through world models\.*arXiv preprint arXiv:2301\.04104*, 2023\.
- Vaswani et al\. \[2017\]Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin\.Attention is all you need\.*Advances in neural information processing systems*, 30, 2017\.
- ARC\-Prize\-Foundation \[2026\]ARC\-Prize\-Foundation\.ARC\-AGI benchmarking: Leaderboard and dataset for the ARC\-AGI benchmark\.[https://arcprize\.org/leaderboard](https://arcprize.org/leaderboard), 2026\.Accessed: 2026\-1\-22\.
- Sahoo et al\. \[2024\]Subham Sahoo, Marianne Arriola, Yair Schiff, Aaron Gokaslan, Edgar Marroquin, Justin Chiu, Alexander Rush, and Volodymyr Kuleshov\.Simple and effective masked diffusion language models\.*Advances in Neural Information Processing Systems*, 37:130136–130184, 2024\.
- Barratt and Sharma \[2018\]Shane Barratt and Rishi Sharma\.A note on the inception score\.*arXiv preprint arXiv:1801\.01973*, 2018\.
- Heusel et al\. \[2017\]Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter\.Gans trained by a two time\-scale update rule converge to a local nash equilibrium\.*Advances in neural information processing systems*, 30, 2017\.
- Austin et al\. \[2021\]Jacob Austin, Daniel D Johnson, Jonathan Ho, Daniel Tarlow, and Rianne Van Den Berg\.Structured denoising diffusion models in discrete state\-spaces\.*Advances in neural information processing systems*, 34:17981–17993, 2021\.
- Kingma and Welling \[2013\]Diederik P Kingma and Max Welling\.Auto\-encoding variational bayes\.*arXiv preprint arXiv:1312\.6114*, 2013\.
- Su et al\. \[2024\]Jianlin Su, Murtadha Ahmed, Yu Lu, Shengfeng Pan, Wen Bo, and Yunfeng Liu\.Roformer: Enhanced transformer with rotary position embedding\.*Neurocomputing*, 568:127063, 2024\.
- Shazeer \[2020\]Noam Shazeer\.Glu variants improve transformer\.*arXiv preprint arXiv:2002\.05202*, 2020\.
- Ryu \[2024\]Simo Ryu\.Minimal implementation of a d3pm \(structured denoising diffusion models in discrete state\-spaces\), in pytorch\.[https://github\.com/cloneofsimo/d3pm](https://github.com/cloneofsimo/d3pm), 2024\.
- Peebles and Xie \[2023\]William Peebles and Saining Xie\.Scalable diffusion models with transformers\.In*Proceedings of the IEEE/CVF international conference on computer vision*, pages 4195–4205, 2023\.
- LeCun et al\. \[2002\]Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner\.Gradient\-based learning applied to document recognition\.*Proceedings of the IEEE*, 86\(11\):2278–2324, 2002\.
- Krizhevsky et al\. \[2012\]Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton\.Imagenet classification with deep convolutional neural networks\.*Advances in neural information processing systems*, 25, 2012\.
- Elfwing et al\. \[2018\]Stefan Elfwing, Eiji Uchibe, and Kenji Doya\.Sigmoid\-weighted linear units for neural network function approximation in reinforcement learning\.*Neural networks*, 107:3–11, 2018\.
- Wu and He \[2018\]Yuxin Wu and Kaiming He\.Group normalization\.In*Proceedings of the European conference on computer vision \(ECCV\)*, pages 3–19, 2018\.
- Loshchilov and Hutter \[2017\]Ilya Loshchilov and Frank Hutter\.Decoupled weight decay regularization\.*arXiv preprint arXiv:1711\.05101*, 2017\.
- Brock et al\. \[2018\]Andrew Brock, Jeff Donahue, and Karen Simonyan\.Large scale gan training for high fidelity natural image synthesis\.*arXiv preprint arXiv:1809\.11096*, 2018\.
- Song and Ermon \[2020\]Yang Song and Stefano Ermon\.Improved techniques for training score\-based generative models\.*Advances in neural information processing systems*, 33:12438–12448, 2020\.
- Erdős and Rényi \[1964\]P\. Erdős and A\. Rényi\.On the strength of connectedness of a random graph\.*Acta Mathematica Academiae Scientiarum Hungarica*, 12\(1\):261–267, Mar 1964\.ISSN 1588\-2632\.doi:10\.1007/BF02066689\.URL[https://doi\.org/10\.1007/BF02066689](https://doi.org/10.1007/BF02066689)\.
- Lemos et al\. \[2019\]Henrique Lemos, Marcelo Prates, Pedro Avelar, and Luis Lamb\.Graph colouring meets deep learning: Effective graph neural network models for combinatorial problems\.In*2019 IEEE 31st International Conference on Tools with Artificial Intelligence \(ICTAI\)*, pages 879–885\. IEEE, 2019\.
- Pomerantsev \[2014\]Alexey L\. Pomerantsev\.Principal component analysis \(pca\)\.*Encyclopedia of Autism Spectrum Disorders*, 2014\.URL[https://api\.semanticscholar\.org/CorpusID:2534141](https://api.semanticscholar.org/CorpusID:2534141)\.
- Bentley \[1975\]Jon Louis Bentley\.Multidimensional binary search trees used for associative searching\.*Commun\. ACM*, 18:509–517, 1975\.URL[https://api\.semanticscholar\.org/CorpusID:13091446](https://api.semanticscholar.org/CorpusID:13091446)\.
## Appendix AAdditional Method Details
### A\.1Adaptive Computation Time
GRAM optionally adopts adaptive computation time \(ACT\)\[[8](https://arxiv.org/html/2605.19376#bib.bib8),[9](https://arxiv.org/html/2605.19376#bib.bib9),[10](https://arxiv.org/html/2605.19376#bib.bib10)\]at inference, allowing each trajectory to terminate at a learned halting depth rather than running for a fixed number of supervision steps\. We follow the Q\-learning formulation introduced by HRM\[[8](https://arxiv.org/html/2605.19376#bib.bib8)\]and adopted in TRM\[[9](https://arxiv.org/html/2605.19376#bib.bib9)\]\.
Halt head\.The decoder includes an auxiliary headqψ:ℝD→ℝ2q\_\{\\psi\}:\\mathbb\{R\}^\{D\}\\to\\mathbb\{R\}^\{2\}that maps the high\-level statehhto two scalar values,qψ\(h\)=\(qhalt,qcontinue\)q\_\{\\psi\}\(h\)=\(q^\{\\mathrm\{halt\}\},q^\{\\mathrm\{continue\}\}\)\. These are interpreted as estimated Q\-values for the binary action of halting or continuing computation at the current supervision step\.
Training\.The halt head is trained jointly with the main objective via a temporal\-difference loss\. After computing the latent statezT\(n\)z\_\{T\}^\{\(n\)\}at the end of supervision stepnn, we form Q\-learning targets:
- •q^nhalt=𝟏\[y^\(n\)=y\]\\hat\{q\}^\{\\mathrm\{halt\}\}\_\{n\}=\\mathbf\{1\}\[\\hat\{y\}^\{\(n\)\}=y\], indicating whether decoding the current state would yield a correct prediction\.
- •q^ncontinue=max\(qn\+1halt,qn\+1continue\)\\smash\{\\hat\{q\}^\{\\mathrm\{continue\}\}\_\{n\}=\\max\\\!\\left\(q^\{\\mathrm\{halt\}\}\_\{n\+1\},\\,q^\{\\mathrm\{continue\}\}\_\{n\+1\}\\right\)\}, the bootstrapped value of running one more supervision step\.
The halt head is trained by regression to these targets:
ℒACT=∑n=1Nsup\[\(qnhalt−q^nhalt\)2\+\(qncontinue−q^ncontinue\)2\]\.\\displaystyle\\mathcal\{L\}\_\{\\mathrm\{ACT\}\}=\\sum\_\{n=1\}^\{N\_\{\\mathrm\{sup\}\}\}\\Big\[\\big\(q^\{\\mathrm\{halt\}\}\_\{n\}\-\\hat\{q\}^\{\\mathrm\{halt\}\}\_\{n\}\\big\)^\{2\}\+\\big\(q^\{\\mathrm\{continue\}\}\_\{n\}\-\\hat\{q\}^\{\\mathrm\{continue\}\}\_\{n\}\\big\)^\{2\}\\Big\]\.\(15\)This auxiliary loss is added to the main training objective and contributes only through the halt head; it does not propagate gradients into the recursive core\.
Inference\.At inference, computation proceeds one supervision step at a time\. After each stepnn, we evaluateqψ\(h\(n\)\)q\_\{\\psi\}\(h^\{\(n\)\}\)and halt ifqnhalt\>qncontinueq^\{\\mathrm\{halt\}\}\_\{n\}\>q^\{\\mathrm\{continue\}\}\_\{n\}, returningy^\(n\)\\hat\{y\}^\{\(n\)\}as the prediction\. Otherwise, computation continues to the next supervision step, up to a maximum budget ofNsupmaxN\_\{\\mathrm\{sup\}\}^\{\\max\}steps\. Different trajectories sampled in parallel may therefore terminate at different depths, complementing the parallel\-sampling scheme described in[Section˜2\.3](https://arxiv.org/html/2605.19376#S2.SS3)\. In practice, we found that using onlyqhaltq^\{\\mathrm\{halt\}\}\(halting whenσ\(qhalt\)\>0\.5\\sigma\(q^\{\\mathrm\{halt\}\}\)\>0\.5, without the continue branch\) performs comparably while simplifying implementation; our released code uses this variant\.
### A\.2Latent Process Reward Model \(LPRM\)\.
To rank or select among sampled candidates, we train a value headvψ\(zt\)v\_\{\\psi\}\(z\_\{t\}\)to predict the expected accuracy of the final output, conditioned on the current latent stateztz\_\{t\}\. The LPRM is trained jointly with the main objective via a regression loss:
ℒLPRM=∑t=1T\(vψ\(zt\)−r\)2,\\displaystyle\\mathcal\{L\}\_\{\\text\{LPRM\}\}=\\sum\_\{t=1\}^\{T\}\(v\_\{\\psi\}\(z\_\{t\}\)\-r\)^\{2\},\(16\)wherer∈\[0,1\]r\\in\[0,1\]denotes the accuracy of the final prediction for a given trajectory\.
### A\.3Empirical Validation of the Surrogate Objective
We further analyze the approximation introduced by the surrogate training objectiveℒGRAM\\mathcal\{L\}\_\{\\mathrm\{GRAM\}\}used in[Section˜2\.2](https://arxiv.org/html/2605.19376#S2.SS2), both qualitatively and empirically\.
Truncation as a gradient approximation\.We frameℒGRAM\\mathcal\{L\}\_\{\\mathrm\{GRAM\}\}as a gradient approximation rather than a separate variational objective\. The full trajectory\-level ELBO \([Equation˜13](https://arxiv.org/html/2605.19376#S2.E13)\) involves a sum of KL terms across allTTotalT\_\{\\mathrm\{Total\}\}transitions, and computing its exact gradient requires backpropagation through the entire trajectory\. To enable training with constant memory, we propagate gradients only through the final transition of each supervision step\. This is a standard practice in recurrent latent variable models with long computation chains: ELBOs over truncated sequences are used, for example, in VRNN\[[33](https://arxiv.org/html/2605.19376#bib.bib33)\]and SRNN\[[34](https://arxiv.org/html/2605.19376#bib.bib34)\], while truncated latent imagination is used in Dreamer\-family world models\[[37](https://arxiv.org/html/2605.19376#bib.bib37),[38](https://arxiv.org/html/2605.19376#bib.bib38)\]\. Trading a small gradient bias for training stability via local truncation is therefore well\-precedented; what is specific to GRAM is applying this approximation at the level of recursive reasoning trajectories rather than temporal sequences\.
Empirical validation\.To verify that optimizingℒGRAM\\mathcal\{L\}\_\{\\mathrm\{GRAM\}\}effectively drives improvement in the full variational bound, we compute both quantities on the validation set throughout training\. The full ELBOℒELBO\\mathcal\{L\}\_\{\\mathrm\{ELBO\}\}is evaluated as in[Equation˜13](https://arxiv.org/html/2605.19376#S2.E13), summing the reconstruction term and KL contributions across allTTotalT\_\{\\mathrm\{Total\}\}transitions; the surrogate objective is evaluated as the average ofℒGRAM\(n\)\\mathcal\{L\}\_\{\\mathrm\{GRAM\}\}^\{\(n\)\}over theNsupN\_\{\\mathrm\{sup\}\}supervision steps\.[Figure˜8](https://arxiv.org/html/2605.19376#A1.F8)reports the results on Sudoku\-Extreme and N\-Queens8×88\\times 8\.
Figure 8:Full ELBOℒELBO\\mathcal\{L\}\_\{\\mathrm\{ELBO\}\}and surrogate objectiveℒGRAM\\mathcal\{L\}\_\{\\mathrm\{GRAM\}\}throughout training\(plotted as−ELBO\-\\mathrm\{ELBO\}, smaller is better\)\. On both Sudoku\-Extreme \(left\) and N\-Queens8×88\\times 8\(right\), both quantities decrease monotonically over training, indicating that gradient updates ofℒGRAM\\mathcal\{L\}\_\{\\mathrm\{GRAM\}\}consistently improve the full variational bound\. The two curves do not coincide becauseℒELBO\\mathcal\{L\}\_\{\\mathrm\{ELBO\}\}sums KL contributions across allTTotalT\_\{\\mathrm\{Total\}\}transitions whileℒGRAM\\mathcal\{L\}\_\{\\mathrm\{GRAM\}\}evaluates only the final\-step KL of each supervision step; their gap reflects the cumulative KL across earlier transitions, not a failure of optimization\. The N\-Queens plot uses a log scale on the y\-axis due to the large dynamic range\.BothℒELBO\\mathcal\{L\}\_\{\\mathrm\{ELBO\}\}andℒGRAM\\mathcal\{L\}\_\{\\mathrm\{GRAM\}\}improve monotonically throughout training on both tasks\. This indicates that, despite the truncation, gradient updates ofℒGRAM\\mathcal\{L\}\_\{\\mathrm\{GRAM\}\}effectively drive improvement in the full variational bound\. SinceℒELBO\\mathcal\{L\}\_\{\\mathrm\{ELBO\}\}also serves as an indirect estimate of the negative log\-likelihood, its consistent improvement provides evidence that GRAM optimizes a well\-defined data likelihood, even though training relies on the surrogate\.
The gap between the two curves in[Figure˜8](https://arxiv.org/html/2605.19376#A1.F8)reflects the structural difference between the two quantities —ℒELBO\\mathcal\{L\}\_\{\\mathrm\{ELBO\}\}accumulates KL terms across all transitions whileℒGRAM\\mathcal\{L\}\_\{\\mathrm\{GRAM\}\}evaluates only the final\-step KL of each supervision step — rather than an optimization failure\. This gap is consistent withℒGRAM\\mathcal\{L\}\_\{\\mathrm\{GRAM\}\}being a biased but useful surrogate forℒELBO\\mathcal\{L\}\_\{\\mathrm\{ELBO\}\}\.
## Appendix BTraining and Architecture Details
### B\.1Architecture Details
GRAM consists of three components: Encoder, Recursive Core, and Decoder\.
Table 4:Architecture components\.Encoder\.Input tokens are mapped to embeddings via a token embedding layer, optionally concatenated with puzzle embeddings \(for ARC\[[13](https://arxiv.org/html/2605.19376#bib.bib13),[14](https://arxiv.org/html/2605.19376#bib.bib14)\]\), and combined with positional encodings \(RoPE\)\[[46](https://arxiv.org/html/2605.19376#bib.bib46)\]\. The embeddings are scaled byD\\sqrt\{D\}and prepended with 16 puzzle embedding tokens\[[8](https://arxiv.org/html/2605.19376#bib.bib8)\]\.
Recursive Core\.The core maintains two latent states:hh\(high\-level\) andll\(low\-level\)\. For each outer step, the low\-level state is refinedKKtimes vial←fL\(l,h\+ex\)l\\leftarrow f\_\{L\}\(l,h\+e\_\{x\}\), injecting the input embedding at each iteration\. The high\-level state is then updated viah←fH\(h,l\)h\\leftarrow f\_\{H\}\(h,l\)\. BothfLf\_\{L\}andfHf\_\{H\}share the same architecture: a stack of attention and SwiGLU\[[47](https://arxiv.org/html/2605.19376#bib.bib47)\]MLP layers\. In addition, as an exception, we use \[SwiGLU \+ SwiGLU\] network for the Recursive Core module instead of \[Attention \+ SwiGLU\] for Sudoku tasks, following\[[9](https://arxiv.org/html/2605.19376#bib.bib9)\]\. For initialization ofz0=\(h0,l0\)z\_\{0\}=\(h\_\{0\},l\_\{0\}\), we sample once from the standard Gaussian distribution𝒩\(0,I\)\\mathcal\{N\}\(0,I\), then save the value within the network checkpoint and load it again, meaning the initializedz0z\_\{0\}has a fixed value\.
Decoder\.The decoder extracts content tokens fromhh\(excluding puzzle embedding positions\) and maps them to logits via a SwiGLU MLP head\. An auxiliary head predicts halt decisions and correctness values from the first token ofhh\.
##### Encoder and Decoder for Image Patches\.
In the MNIST\[[15](https://arxiv.org/html/2605.19376#bib.bib15)\]image generation task, we first construct a binarized dataset by normalizing the original discrete pixel values \(0∼2550\\sim 255\) to the continuous range\[0,1\]\[0,1\]and applying a threshold at0\.50\.5\. For the network architecture, we employ a convolutional patch encoder, following\[[48](https://arxiv.org/html/2605.19376#bib.bib48),[49](https://arxiv.org/html/2605.19376#bib.bib49)\]\.
The encoding process proceeds in three stages\. First, the discrete input tokensx∈\{0,1\}x\\in\\\{0,1\\\}are normalized to the range\[−1,1\]\[\-1,1\]\. Second, to capture local spatial dependencies before patchification, the normalized image passes through a shallow convolutional encoder\. This encoder consists of two stacked blocks, where each block comprises a 2D convolution\[[50](https://arxiv.org/html/2605.19376#bib.bib50),[51](https://arxiv.org/html/2605.19376#bib.bib51)\]with a5×55\\times 5kernel and padding 2, a SiLU non\-linearity\[[52](https://arxiv.org/html/2605.19376#bib.bib52)\], and Group Normalization \(GN\)\[[53](https://arxiv.org/html/2605.19376#bib.bib53)\]\. Finally, the resulting feature map is divided into non\-overlapping patches of sizeP×PP\\times Pand linearly projected to match the model’s hidden dimensionDD\. The detailed architectural specifications and dimension transitions are summarized in Table[5](https://arxiv.org/html/2605.19376#A2.T5)\.
Table 5:Detailed architecture of the Image Patch Encoder for MNIST\.H,WH,Wdenote image resolution,CCinput channels,PPpatch size,NpN\_\{p\}the number of patches, andDDthe hidden dimension\.StageLayer / OperationOutput Dim\.1\. Norm\.Input Tokens\(B,C,H,W\)\(B,C,H,W\)Linear Scaling\[−1,1\]\[\-1,1\]\(B,C,H,W\)\(B,C,H,W\)2\. ConvConv2d5×55\\times 5\(p=2p=2\)\(B,D/2,H,W\)\(B,D/2,H,W\)SiLU→\\rightarrowGN\(32\)Conv2d5×55\\times 5\(p=2p=2\)\(B,D/2,H,W\)\(B,D/2,H,W\)SiLU→\\rightarrowGN\(32\)3\. PatchFlatten Patches\(B,Np,P2⋅D2\)\(B,N\_\{p\},P^\{2\}\\cdot\\frac\{D\}\{2\}\)Linear Projection\(B,Np,D\)\(B,N\_\{p\},D\)Hyperparameters\.FollowingWang et al\. \[[8](https://arxiv.org/html/2605.19376#bib.bib8)\], Jolicoeur\-Martineau \[[9](https://arxiv.org/html/2605.19376#bib.bib9)\], both the input and output are represented as sequences of shape\[B,L\]\[B,L\], whereBBdenotes the batch size andLLthe context length\. Each input sequence includes 16 fixed puzzle embedding tokens\. The latent stateshth\_\{t\}andltl\_\{t\}, as well as the decoder output, have shape\[B,L,D\]\[B,L,D\], with embedding dimensionDD\. The Transformer\[[39](https://arxiv.org/html/2605.19376#bib.bib39)\]backbone uses embedding dimensionD=512D=512, attention headsNheadN\_\{\\text\{head\}\}=8 , and FFN hidden dimensionDhD\_\{h\}=512\. Within a recursion step, meaning a latent transitionzt→zt\+1z\_\{t\}\\to z\_\{t\+1\}, we use low\-level \(inner\) stepsK=6K=6for Sudoku\[[8](https://arxiv.org/html/2605.19376#bib.bib8)\]andK=4K=4for all other tasks, with high\-level \(outer\) stepsT=3T=3\.
### B\.2Training Details
Task Configuration\.All tasks represent inputs and outputs as discrete token sequences \(Summarized in[Table˜6](https://arxiv.org/html/2605.19376#A2.T6)\)\.
- •ForSudoku\[[8](https://arxiv.org/html/2605.19376#bib.bib8)\], the 9×\\times9 grid is flattened row\-by\-row into 81 tokens with vocabulary size 11 \(0=pad, 1=blank, 2–10=digits\)\.
- •ForARC\-AGI\[[13](https://arxiv.org/html/2605.19376#bib.bib13),[14](https://arxiv.org/html/2605.19376#bib.bib14)\], variable\-size grids are padded to a fixed 30×\\times30 canvas with EOS markers, yielding 900 tokens and vocabulary size 12 \(0=pad, 1=eos, 2–11=colors\); task\-specific puzzle embeddings are prepended to distinguish different ARC tasks\.
- •N\-Queensflattens anN×NN\\times Nboard row\-by\-row intoN2N^\{2\}tokens with vocabulary size 3 \(0=pad, 1=empty, 2=queen\)\.
- •Graph Coloringencodes the strict upper triangle of the adjacency matrix asn\(n−1\)/2\\nicefrac\{\{n\(n\-1\)\}\}\{\{2\}\}tokens, using 0=PAD, 1=no\-edge, and 2=edge for inputs and3\+color\_id3\+\\text\{color\\\_id\}for output colors\.
- •For image generation onMNIST\[[15](https://arxiv.org/html/2605.19376#bib.bib15)\], images are quantized and processed via CNN\-based patchification\[[50](https://arxiv.org/html/2605.19376#bib.bib50),[49](https://arxiv.org/html/2605.19376#bib.bib49)\], with the encoder applying patchify and the decoder unpatchify\. Then, patched input forms14×1414\\times 14flattened sequence tokens with vocabulary size 3 \(0=pad, 1=black, 2=white\)\.
Table 6:Task\-specific configurations\.Training Details\.We train all models using AdamW\[[54](https://arxiv.org/html/2605.19376#bib.bib54)\]with learning rate10−410^\{\-4\}, weight decay 1\.0, and gradient clipping at 1\.0\. The global batch size is 768\. For stability, we apply exponential moving average \(EMA\) with decay 0\.9999, followingBrock et al\. \[[55](https://arxiv.org/html/2605.19376#bib.bib55)\]andSong and Ermon \[[56](https://arxiv.org/html/2605.19376#bib.bib56)\]\. To prevent posterior collapse, we use a KL balance\[[37](https://arxiv.org/html/2605.19376#bib.bib37),[38](https://arxiv.org/html/2605.19376#bib.bib38)\]coefficient of 0\.8\. The number of deep supervision steps isNsup=16N\_\{\\text\{sup\}\}=16for all tasks\. The KL coefficientβ\\betais set to0\.10\.1\(Sudoku\),0\.04/0\.10\.04/0\.1\(ARC\-AGI\-1/2\),0\.07/0\.0450\.07/0\.045\(N\-Queens8×88\\times 8/10×1010\\times 10\),0\.5/0\.450\.5/0\.45\(Graph Coloring with 8/10 nodes\), and0\.070\.07\(MNIST\)\. Task\-specific training configurations are summarized in[Table˜7](https://arxiv.org/html/2605.19376#A2.T7)\.
Table 7:Training configurations on NVIDIA RTX 4090 GPUs\.
## Appendix CAdditional Details of Experiment Setup
### C\.1Challenging Puzzle Tasks
#### C\.1\.1Looped TF on ARC\-AGI
We report Looped Transformer\[[7](https://arxiv.org/html/2605.19376#bib.bib7)\]results on Sudoku\-Extreme but omit them on ARC\-AGI due to prohibitive training cost\. Under the same setup used for our other recursive baselines \(200K epochs, batch size 768, on8×8\\timesNVIDIA RTX Pro 6000 GPUs\), training Looped TF on Sudoku\-Extreme already takes 19 hours, and extrapolating to ARC\-AGI — which uses substantially longer sequences and a larger training set — suggests approximately97 days\(≈776\\approx 776GPU\-days\) for a full training run\.
This gap stems from two compounding factors\. First, Looped TF lacks deep supervision: HRM, TRM, and GRAM performNsupN\_\{\\mathrm\{sup\}\}gradient updates per trajectory \(one per segment\), whereas Looped TF performs only one update at the end of the full trajectory, slowing convergence\. Second, Looped TF lacks adaptive halting such as ACT\[[8](https://arxiv.org/html/2605.19376#bib.bib8),[9](https://arxiv.org/html/2605.19376#bib.bib9),[10](https://arxiv.org/html/2605.19376#bib.bib10)\], so every input must be processed for the maximum recursion depth, increasing per\-example sequential compute\. Both inefficiencies compound at ARC\-AGI scale, making a full Looped TF training run impractical\.
### C\.2Multi\-solution Puzzle Tasks
#### C\.2\.1N\-Queens Problem
Figure 9:Example of an8×88\\times 8N\-Queens puzzle instance\.In this example, 5 queens are removed from the full board, leaving 3 queens\. The model must find the positions of the remaining queens\. This configuration admits exactly 3 valid solutions\.Data Generation Details\.The N\-Queens problem requires placingNNqueens on anN×NN\\times Nchessboard such that no two queens attack each other—meaning no queens share the same row, column, or diagonal\. Figure[9](https://arxiv.org/html/2605.19376#A3.F9)illustrates an example where 5 queens are removed from an8×88\\times 8solution, resulting in a puzzle with 3 distinct valid completions\.
To construct the dataset, we first generated all valid complete N\-Queens solutions forN=8N=8andN=10N=10\. We then created puzzle instances by removing a specific number of queens, treating the remaining partial configuration as the input and the original complete board as the target label\. To generate instances yielding diverse valid completions, we removedk∈\{5,6,7\}k\\in\\\{5,6,7\\\}queens for the8×88\\times 8setting andk∈\{7,8,9\}k\\in\\\{7,8,9\\\}queens for the10×1010\\times 10setting\. The distribution of solution counts for our generated dataset is shown in Figure[10](https://arxiv.org/html/2605.19376#A3.F10)\.
For evaluation, we employed an 85:15 train\-test split\. Crucially, to prevent data leakage and ensure the model learns to reason rather than memorize, the split was performed based on unique*input*configurations\. This guarantees that no input pattern in the test set appears in the training set\. Inputs are flattened into discrete 1D sequencesx∈\{0,1,2\}Lx\\in\\\{0,1,2\\\}^\{L\}, whereL=N2L=N^\{2\}, along with zero\-padded puzzle embedding tokens\. Vocabulary mapping follows: padding \(0\), empty \(1\), and queen \(2\)\.
Figure 10:Distribution of the number of valid solutions for generated N\-Queens instances\.The dataset covers a wide range of solution counts, testing the model’s ability to recover multiple valid outputs\.
#### C\.2\.2Graph Coloring Problem
Data Generation Details\.The Graph Coloring problem requires assigning one ofkkcolors to each node in a graph such that no two adjacent nodes share the same color\. We consider graphs withN∈\{8,10\}N\\in\\\{8,10\\\}nodes and usek=3k=3colors\. Figure[11](https://arxiv.org/html/2605.19376#A3.F11)illustrates an example instance withN=8N=8nodes andk=3k=3colors\.
Graphs are generated using the Erdős–Rényi random graph model\[[57](https://arxiv.org/html/2605.19376#bib.bib57)\], following the generation pipeline from GNN\-GCP\[[58](https://arxiv.org/html/2605.19376#bib.bib58)\]\. Specifically, for each instance, edges are sampled independently with a fixed probabilitypp, producing a symmetric adjacency matrix\. We retain only graphs that are 3\-colorable\.
For each graph, we enumerate all valid 3\-colorings and retain only canonical forms to eliminate redundant solutions under color permutation \(e\.g\., swapping red and blue\)\. This yields a set of structurally distinct solutions per input\. The distribution of solution counts is shown in Figure[12](https://arxiv.org/html/2605.19376#A3.F12)\.
The final dataset consists of 7,002 training and 255 test instances forN=8N=8, and 13,465 training and 192 test instances forN=10N=10\.
Input and Output Representation\.The input graph is represented by extracting the upper triangular portion of the adjacency matrix \(excluding the diagonal\) and flattening it into a 1D sequence\. The output is a sequence of lengthNN, where each position encodes the assigned color for the corresponding node\. Vocabulary mapping is as follows: PAD \(0\), no edge \(1\), edge \(2\), and colors \(3, 4, 5\) for red, blue, and green respectively\.
Figure 11:Graph Coloring ExampleFigure 12:Distribution of the number of valid solutions for generated graph coloring instances\.The dataset covers a wide range of solution counts, testing the model’s ability to recover multiple valid outputs\.
## Appendix DAdditional Experiment Results
### D\.1Additional Results on Challenging Puzzle Benchmarks
[Table˜8](https://arxiv.org/html/2605.19376#A4.T8)reports test accuracy on three challenging puzzle benchmarks\. Here we provide additional observations complementing the main text\.
##### GRAM Advances the Recursive\-Reasoning Line\.
Across all three benchmarks, GRAM consistently outperforms prior recursive baselines \(Looped TF, HRM, TRM\) while using fewer parameters than HRM \(10M vs\. 27M\)\. The complete failure of direct prediction on Sudoku and ARC\-AGI\-2 \(0% in both cases\) further confirms that recursive computation is essential for these tasks — single\-pass models, regardless of capacity, cannot solve them\. Together, these results indicate that GRAM’s gains arise from how recursive computation is organized \(probabilistic, multi\-trajectory\) rather than from increased model capacity\.
##### Sudoku\-Extreme Resists Parameter Scaling\.
All tested large reasoning models \(LRMs\), including Deepseek\-R1 \(671B\), score 0% on Sudoku\-Extreme\. This suggests that pretrained capacity alone does not transfer to constraint\-propagation reasoning, and that benchmarks like Sudoku\-Extreme probe a fundamentally different axis from those captured by general\-purpose LRMs\. On ARC\-AGI, more recent LRMs such as Gemini 3 Pro \(75\.0% on ARC\-1, 31\.1% on ARC\-2\) remain substantially ahead of all recursive models, highlighting that abstract few\-shot reasoning still benefits from scale; we view these numbers as benchmark\-difficulty reference points rather than controlled baselines\.
Table 8:Test accuracy \(%\) on Challenging Puzzle Benchmarks\.GRAM significantly outperforms prior recursive models\. All recursive model scores were obtained at 16 supervision steps\.
### D\.2Scales with Parallel Sampling on ARC\-AGI Challenge
To investigate the effect of GRAM’s sampling on the ARC\-AGI\-1 benchmark, we measured performance without relying on external data augmentation\. Typically, TRM achieves its reported accuracy by generating 1,000 augmentations for a single problem and performing majority voting over the results\. Because this augmentation process itself creates a wide variety of samples, we isolated the specific effect of generative sampling by performing inference solely on the original problem instance and conducting majority voting over multiple sampled paths\. For a fair comparison, TRM was evaluated using the same hyperparameters as GRAM, including the number of epochs, learning rate, and the number of layers\.
As illustrated in Figure[13](https://arxiv.org/html/2605.19376#A4.F13), removing augmentations causes a performance decline for both GRAM and TRM compared to the values reported in Table[8](https://arxiv.org/html/2605.19376#A4.T8)\. However, in the case of GRAM, we observe that accuracy consistently improves as the model generates more parallel samples\. This trend mirrors observations in Section[4\.2](https://arxiv.org/html/2605.19376#S4.SS2), suggesting that increased inference\-time compute through width scaling allows the model to explore more plausible reasoning trajectories and recover from initial errors, eventually leading to more robust solution discovery\.
Figure 13:Effect of sampling on ARC\-AGI\-1 without data augmentation\.To isolate the internal sampling effect, both models are evaluated on original problem instances without 1,000 augmentations\. While removing augmentations causes an initial performance drop, GRAM exhibits robust scaling through generative sampling as the number of parallel samplesNNincreases, outperforming the TRM baseline\.##### Interaction between Augmentation and Sampling\.
A natural question arises: why not combine higher levels of augmentation with extensive parallel sampling? To address this, we conducted an ablation study examining the interaction between data augmentation and inference\-time sampling\. Figure[14](https://arxiv.org/html/2605.19376#A4.F14)presents the results across varying augmentation levels \(Aug=0 to Aug=50\)\. Without augmentation \(Aug=0\), increasing the number of samples yields consistent accuracy improvements, demonstrating that stochastic sampling effectively explores diverse reasoning trajectories\. However, as the level of augmentation increases, the marginal benefit of additional sampling diminishes substantially\. At Aug==50, performance saturates regardless of sample count—accuracy remains nearly constant whether we draw 1 or 50 samples\. This observation reveals that augmentation and sampling serve complementary rather than additive roles: both mechanisms enable the model to capture solution diversity, but through different means\. When training data is limited, parallel sampling compensates by exploring varied reasoning paths at inference time\. When training data is abundant through augmentation, the model has already internalized sufficient diversity during training, rendering additional inference\-time exploration redundant\. Consequently, scaling sampling beyond augmentation provides diminishing returns, justifying our experimental design choice to evaluate these two scaling axes separately\.
Figure 14:Effect of augmentation on sampling efficiency\.With limited augmentation \(Aug=0\), parallel sampling provides consistent gains\. As augmentation increases, sampling benefits diminish—at Aug=50=50, performance saturates regardless of sample count, suggesting augmentation and sampling serve complementary roles in capturing solution diversity\.
### D\.3Solution Coverage Analysis
We analyze the ability of GRAM to capture the diversity of the solution space compared to deterministic baselines\. Figure[15](https://arxiv.org/html/2605.19376#A4.F15)presents the solution coverage on8×88\\times 8and10×1010\\times 10N\-Queens tasks with respect to the total number of valid ground\-truth solutions\.
As shown in Figure[15](https://arxiv.org/html/2605.19376#A4.F15), deterministic recursive models \(HRM and TRM\) exhibit a sharp decline in coverage as the number of possible solutions increases\. Since these models are constrained to a single fixed reasoning trajectory, they structurally fail to explore alternative paths, resulting in severe mode collapse in multi\-solution landscapes\.
In contrast, GRAM effectively leverages its generative latent transitions to cover a broader range of solutions\. As the number of parallel samplesNNincreases \(from 1 to 20\), the solution coverage improves monotonically across both8×88\\times 8and10×1010\\times 10settings\. This empirical evidence confirms that GRAM’s stochastic guidance mechanism is essential for navigating complex problem spaces where multiple valid reasoning paths exist\.
\(a\)N\-Queens8×88\\times 8
\(b\)N\-Queens10×1010\\times 10
Figure 15:Solution coverage analysis on N\-Queens \(𝟖×𝟖\\mathbf\{8\\times 8\}and𝟏𝟎×𝟏𝟎\\mathbf\{10\\times 10\}\)with respect to the number of ground\-truth solutions\. While deterministic baselines \(HRM, TRM\) suffer from mode collapse as the solution space grows, GRAM demonstrates monotonic improvement in coverage as the number of parallel samplesNNincreases\.
### D\.4Additional Generated Image Samples
In this section, we provide further qualitative results demonstrating GRAM’s capability in unconditional image generation\. Figure[16](https://arxiv.org/html/2605.19376#A4.F16)presents a diverse set of samples generated on the binarized MNIST dataset, visualized across the recursive inference stepst=0t=0tot=16t=16\.
As observed in the main text, GRAM exhibits a distinct progressive refinement behavior\. Starting from a black initialization, the model iteratively adds details and sharpens the structure of the digit\. A particularly compelling property of this process is the model’s ability to recover from initially ambiguous or incorrect formations\.
For instance, in the second row \(generating the digit ’2’\) and the last row \(generating the digit ’1’\), the early predictions att=1t=1andt=2t=2manifest as disjointed artifacts or incorrect shapes\. However, as the recursion proceeds, GRAM effectively leverages its feedback loop to correct these initial errors, resolving the ambiguity and converging to a coherent, high\-quality digit byt=16t=16\.
Figure 16:Additional generated samples from GRAM\.We provide 8 additional samples generated unconditionally on binarized MNIST using GRAM\. Each row represents a single generated sample, visualized across its recursive refinement process\.
### D\.5Additional Experiment Results on Unconditional Sudoku Generation
In this section, we provide additional details on unconditional Sudoku generation\. Unlike the conditional Sudoku\-solving setting, where the input board contains given clues, the model receives an entirely blank board and samples a complete9×99\\times 9Sudoku board from its learned prior\. We evaluate each generated board using the standard Sudoku validity criterion: every row, column, and3×33\\times 3box must contain the digits 1 through 9 exactly once\. We report the validity rate over 100K generated boards\. To check whether high validity comes from repeatedly producing the same board, we also compute the fraction of unique boards among valid samples\.
For GRAM, we construct the unconditional training set from Sudoku\-Extreme\[[8](https://arxiv.org/html/2605.19376#bib.bib8)\], the Sudoku benchmark used by HRM and TRM\. We sample 50K complete solutions from the original training split, discard the clue patterns, and use an all\-blank board as input with the complete solution as the target\. No data augmentation is used\. We train GRAM on this derived 50K\-solution set for 200 epochs with learning rate10−410^\{\-4\}, EMA decay 0\.999, and KL coefficient 0\.05\. The resulting model contains 10\.9M parameters and uses 16 inference steps\.
For D3PM baselines, we use a DiT\-style Transformer backbone and evaluate two model sizes\. D3PM\-Big uses hidden dimension 768, 5 Transformer blocks, and 12 attention heads, yielding 55\.1M parameters, while D3PM\-Small uses hidden dimension 512, 3 Transformer blocks, and 8 attention heads, yielding 15\.9M parameters\. Both variants are trained on the same derived training set and generate boards with 1000 denoising steps\.
As shown in Table[9](https://arxiv.org/html/2605.19376#A4.T9), GRAM achieves 99\.05% validity, outperforming all D3PM baselines\. The strongest D3PM baseline, D3PM\-Uniform \(Big\), reaches 91\.33% validity while using 55\.1M parameters and 1000 denoising steps\. In contrast, GRAM uses fewer parameters and only 16 inference steps\. In all cases, the valid samples are unique under exact board matching, indicating that the reported validity is not due to simple repetition of a small set of boards\. These results show that GRAM can generate highly constrained symbolic structures from an empty input, supporting its potential as a generator beyond conditional puzzle solving\.
Figure[17](https://arxiv.org/html/2605.19376#A4.F17)illustrates the unconditional Sudoku generation setup\. Starting from an empty board, the task is to generate complete boards, and validity is determined by whether the generated board satisfies all Sudoku constraints\. Figure[7](https://arxiv.org/html/2605.19376#S4.F7)shows qualitative examples of boards generated by GRAM\.
Table 9:Unconditional Sudoku generation\.We report the ratio of generated boards satisfying Sudoku constraints over 100K samples\. All valid boards are unique for all methods in this evaluation\.Figure 17:Unconditional Sudoku generation setup\.Starting from an empty board, the task is to generate complete Sudoku boards\. The valid sample satisfies all Sudoku constraints, while red entries in the invalid sample indicate cells involved in constraint violations\.
### D\.6Visualizing Latent Recursion Process
To understand how stochastic guidance shapes reasoning, we visualize latent trajectories during recursive computation\. Specifically, we track the high\-level statehhat each supervision step throughout the recursion process\. For visualization, we project these latent vectors into 2D using PCA\[[59](https://arxiv.org/html/2605.19376#bib.bib59)\]and interpolate unobserved states via K\-D tree\[[60](https://arxiv.org/html/2605.19376#bib.bib60)\]to construct a continuous loss landscape\.
Figures[18](https://arxiv.org/html/2605.19376#A4.F18)and[19](https://arxiv.org/html/2605.19376#A4.F19)compare TRM and GRAM on the same Sudoku puzzle\. TRM follows a single deterministic path from initialization to solution, offering no mechanism to escape if the trajectory enters a suboptimal region\. In contrast, GRAM samples diverse trajectories that explore different regions of latent space before converging\. While some trajectories become trapped in local minima \(bright yellow regions\), others successfully navigate toward the global optimum \(dark blue regions\)\. This diversity enables GRAM to discover valid solutions more reliably through parallel exploration\.
Figure 18:Latent reasoning trajectory of TRM\.The red dot indicates the initial stateh0h\_\{0\}and the green dot indicates the final statehTh\_\{T\}\. Background color represents the loss landscape: bright yellow corresponds to high loss regions, while dark blue indicates low loss \(optimal\) regions\. TRM follows a single deterministic path with no ability to escape suboptimal trajectories\.Figure 19:Latent reasoning trajectories of GRAM \(50 samples\)\.Using the same visualization scheme as Figure[18](https://arxiv.org/html/2605.19376#A4.F18), we show 50 sampled trajectories from GRAM\. The stochastic guidance enables diverse exploration of the latent space: while some trajectories converge to local minima \(right bottom\), others successfully reach the global optimum \(left middle\), demonstrating how parallel sampling improves solution discovery\.
## Licenses
Table 10:Existing assets, licenses, and source links\.We list the existing datasets, benchmarks, and public reference implementations used or cited in our experiments\. Synthetic N\-Queens and Graph Coloring instances are generated by the authors and are therefore not external assets\.Similar Articles
@askalphaxiv: A fascinating paper supervised by Yoshua Bengio "Generative Recursive Reasoning" Test time compute should scale not jus…
The paper 'Generative Recursive Reasoning' introduces a method that scales test-time compute by sampling multiple latent reasoning trajectories in parallel, enabling the model to explore diverse hypotheses and avoid deterministic collapse. This approach improves performance on tasks such as Sudoku, ARC AGI, N Queens, and graph coloring, and can also generate valid Sudoku boards and MNIST digits.
Graph-Native Reinforcement Learning Enables Traceable Scientific Hypothesis Generation through Conceptual Recombination
This paper introduces Graph-PRefLexOR, a family of graph-native reasoning models fine-tuned with group relative policy optimization (GRPO) to generate traceable scientific hypotheses through explicit reasoning phases. The method achieves 40-65% improvements over base models in reasoning traceability and demonstrates enhanced semantic diversity and conceptual recombination.
@machinestein: ICML 2026: Latent Reasoning in TRMs is Secretly a Policy Improvement Operator Why does recursive reasoning, especially …
The paper reveals that latent reasoning in transformer-based reasoning models (TRMs) functions as a policy improvement operator, and proposes an algorithm that enhances learning and inference efficiency by up to 18x.
D$^2$F-ReAG: Dynamic Decomposition and Filtering for Multi-Hop Reasoning-Augmented Generation
This paper introduces D2F-ReAG, a novel paradigm for multi-hop reasoning-augmented generation that dynamically controls reasoning depth by judging root-level reasoning reliability and decomposing questions into sub-questions when needed, improving accuracy on multi-hop benchmarks.
Multi-Granularity Reasoning for Natural Language Inference
Proposes a Multi-Granularity Reasoning Network (MGRN) that explicitly leverages hierarchical semantic features for natural language inference, outperforming strong baselines on multiple benchmarks.