Looped models have emerged as a prominent paradigm for reasoning, with successes on simple reasoning puzzles such as Sudoku-Extreme and Maze-Unique. However, these models can be unstable, slow to train, and use many parameters and FLOPs to solve simple puzzles. Descent on an energy not only mitigates these issues but also offers advantages: built-in early stopping, compute that adapts to problem difficulty, fast training without differentiating through a solver, and interpretable weights that learn the constraints of the puzzle. Here we demonstrate this with a learned version of Hopfield & Tank's energy from the 80s, which we term CRAM, solves 99.996% of Sudoku-Extreme and 100% of Maze-Unique test puzzles after 42 ms and 132 ms of training on one GPU, at least 1,000x faster than looped models on these tasks. CRAM also matches baseline looped models at their highest accuracy on Sudoku-Extreme using at least 282x fewer inference FLOPs. Our work suggests two things. First, that energies are an extremely promising direction for training reasoning from data. Second, a caution against using trivially solvable benchmarks like Sudoku and Maze to test the scalability of looped reasoning techniques.
Figures & tables
Figure 1: CRAM learns an energy from solved puzzles in seconds, and the energy tells the search when to stop. Training (left) pulls down the energy of each solution and pushes up the energy of negative samples, without differentiating through a reasoning trajectory (shown is a pseudolikelihood objective, Eq. 5 ). On one H200, training takes 42 ms on Sudoku-Extreme and 132 ms on Maze-Unique, at least 1,000 × faster than the looped models of Table 2 . Reasoning (right) clamps the clues of a new puzzle, starts several chains from random fills of the other cells (light-blue guesses; one board per chain), and minimizes the energy one cell at a time, using at least 282 × fewer inference FLOPs ( Fig. 2 ) than looped models at matched accuracy. The chains are independent, and the descent can be noisy, which lets a chain escape spurious local minima. The search stops when any chain’s energy falls below a stopping threshold fitted from the training solutions.
Table 1: Supplied priors by task. M×C is the shape of the answer grid (num cells × num values). NParams is the total number of parameters available to train. NChains is the number of independent search chains per input: for N-Queens and graph coloring it is N , which varies in Table 3 ( N=1 or N=20 ). Init is the value {\color[rgb]{0.1641,0.4688,0.8398}x}_{i} at the start of a search chain; U(C) draws it uniformly from the C values.
Sudoku-Extreme
Maze-Unique
Model
Solved
Params
FLOPs/puzl
Fit time
Solved
Params
FLOPs/puzl
Fit time
HRM [ 62 ]
54.62 ± 4.18
27 .0 M
2.20 e 11
1.2 h
39.97 ± 33.90
27 .0 M
3.01 e 12
7.1 h
TRM [ 38 ]
85.73 ± 0.74
5 .0 M
4.11 e 11
2.5 h
92.23 ± 13.37
6 .8 M
3.84 e 12
15.6 h
GRAM [ 3 ]
96.10 †
9 .1 M
8.51 e 12
3.2 h
98.63 ± 1.31
10 .9 M
8.00 e 13
23.2 h
EqR [ 36 ]
99.49 ± 0.14
5 .0 M
2.11 e 14
2.0 h
93.00 †
263 .8 K
1.16 e 14
7.2 h
FRM [ 29 ]
99.13 ± 0.29
7 .0 M
3.91 e 12
2.9 h
97.27 ± 2.80
8 .0 M
4.70 e 12
9.7 h
Table 2: CRAM trains faster and is more accurate and efficient than every looped baseline. The table reports accuracies and FLOPs at each model’s listed inference setting. Note that we also report a hand-set CRAM energy ( gray ). Solved : mean ± stdev test accuracy (%) over 3 training seeds. Params : nonzero, contributing params of the evaluated model. FLOPs/puzl : avg inference FLOPs per puzzle, including all search chains and failed searches ( Sec. C.2 ). Fit time : wall clock of training seed 0 on one H200 ( Sec. C.2 ); one run in a fresh process for each baseline, including initialization and compilation, and for CRAM the median of seven complete runs that follow a first run in the same process. More details in Sec. C.1 .
Figure 2: (a) CRAM matches each looped model’s highest accuracy using at least 282 × fewer inference FLOPs. Each point is one method showing what fraction of a 10,000 Sudoku-Extreme test puzzle was solved within a given inference budget, reported as the mean accuracy over three training runs with error bars spanning the lowest to the highest run. The arrow joins the most accurate point of EBR, the cheapest looped model, to the cheapest CRAM point that solves at least as many puzzles. The upper panel zooms into the top 2% shaded are of the lower panel. CRAM , TRMP and EBR points include early stopping, and FLOPs include the full reasoning search including every search chain (see Sec. C.2 for details). (b) CRAM learns weights that describe the reasoning task. Maze-Unique learns 3 × 3 shared weights, shown in units of the mean coupling to the four side neighbours, that describe a dead-end pruning algorithm for solving Maze-Unique, by exclusively observing valid maze solutions. On Sudoku-Extreme, CRAM learns correct sudoku costs despite receiving no positional constraint graph. Trained weights for sudoku and maze correspond to the CRAM model reported in Table 2 .
Task
HRM [ 62 ]
TRM [ 38 ]
GRAM [ 3 ]
EBR [ 11 ]
CRAM
(hand-set) ‡
N-Queens 8×8
Acc., N=1
84.41 ± 2.2
67.39 ± 6.8
99.44 ± 0.2
100.00 ± 0.0
99.95 ± 0.0
100.00 ± 0.0
Acc., N=20
84.41 ± 2.2
67.39 ± 6.8
100.00 ± 0.0
99.95 ± 0.1
100.00 ± 0.0
100.00 ± 0.0
Cov@20
58.8 ± 0.6
51.4 ± 3.1
97.9 ± 0.2
98.1 ± 0.2
97.9 ± 0.1
98.4 ± 0.0
Params
27.3M
6.8M
10.9M
7.1M
113
2
Fit time
59 min
1.3 h
1.3 h
3.2 h
2.9 s
none
N-Queens 10×10
Acc., N=1
37.80 †
17.50 †
88.91 ± 3.1
99.31 ± 0.3
99.45 ± 0.1
99.99 ± 0.0
Table 3: CRAM matches larger baselines on N-Queens and graph coloring. Both N-Queens on 8×8 and 10×10 boards and graph coloring of graphs with 8 and 10 vertices are evaluated on GRAM’s test sets. All numbers report mean ± stdev over three training seeds; the best learned value of each row is in bold. Acc. : test inputs whose kept answer is correct (%); N=1 keeps one sample, and N=20 keeps the majority vote of 20 samples for GRAM and the lowest-energy sample of 20 for EBR and CRAM ; TRM and HRM are deterministic, so their two values are equal. Cov@20 : share of each input’s solutions found by 20 samples (%). Conflict : conflicting edges of the kept answer, summed over the test graphs. Params : as in Table 2 ; each task trains its own model. Fit time : training seed 0 on one H200; one run for each baseline, and for CRAM the median of seven runs that follow a first run in the same process ( Sec. C.5 ).
Figure 3: (a) CRAM ’s compute grows gently with puzzle difficulty. The 10,000 Sudoku-Extreme test puzzles of Fig. 2 are binned by difficulty rating provided by the dataset, where each tick gives the lowest rating of its bin (0, 1, 2–3, 4–7, 8–15, 16–31, 32–63, and 64+). FRM uses static compute for every puzzle, whereas both CRAM and EBR implement early stopping. EBR’s early stop barely lowers its compute on easy puzzles: its median stays between 3.3 and 4.2×1011 FLOPs in every bin, near its minimum cost. Top: median FLOPs per puzzle, with bands spanning the 10th to 90th percentiles. Bottom: test accuracy, median over three training runs, with bands spanning the runs. (b) CRAM is data efficient, learning Sudoku using an order of magnitude fewer examples. Shown is model accuracy on the same 10,000 test puzzles vs. the number of unique training puzzles seen in the data (each data point is augmented with the same 99 augmentations). Points connect the median value across 6 training runs.
Figure 4: Local methods that avoid sampling the energy train significantly faster. We train CRAM with five objectives, the four named below and one-step BPTT [ 62 ] , and plot the mean solve rate on 512 Sudoku-Extreme development puzzles over 20 training runs against training time. Bands span the 25th to 75th percentile of the runs. The mean reaches 99% (circles) after 48 ms with pseudolikelihood [ 8 ] and 0.21 s with minimum probability flow [ 56 ] , against 4.4 s with one-step BPTT and 33 s with contrastive divergence [ 31 ] . Full BPTT [ 63 ] ends at a mean of 27% after 245 s, still rising at the end of its schedule; with 3,840,000 updates (about 5 h) it solves 48.8% of test puzzles. Training times include fitting the stopping threshold from the training solutions (24–75 ms) and exclude each run’s one-time start-up (0.08–0.30 s), as do the T 99 times of Table 7 , which compares twelve methods on Sudoku-Extreme and Maze-Unique; App. D gives details of each objective.
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
Sudoku-Extreme
Maze-Unique
Stopping rule
Halted (%)
Wrong halts (%)
Solved (%)
Halted (%)
Wrong halts (%)
Solved (%)
HRM (halting head)
54.5
0.62
54.7
21.4
0.16
40.3
TRM (halting head)
85.8
2.37
83.8
99.9
3.54
96.4
EqR (halting head)
87.5
1.61
86.1
66.0
1.06
65.3
TRMP (halting head)
93.8
0.05
93.8
91.2
0.73
99.2
EBR (gradient-norm stop)
99.35
0.21
99.31
no stopping rule
Appendix
Table 4: CRAM never halts at an incorrect board. Each looped model runs one rollout in its halting mode, capped at its trained depth; EBR’s first sample stops at a gradient norm below 0.2 or after 64 segments, as in its code. Halted: puzzles on which the rule stopped before the cap. Wrong halts: halted puzzles whose board is incorrect (% of halted). Full test sets (412,786 puzzles and 1,000 mazes), pooled over three training runs.
Sudoku-Extreme
Maze-Unique
N-Queens 8×8 ( 10×10 )
Graph coloring, 8 (10) vertices
Training
Training rows
1,000
1,000
7,224 (108,234)
7,002 (13,465)
Loss
PL + L1, λ=3.33×10−4
PL
PL
PL + L1, λ=10−4 ( 10−3 )
Updates
32, full batch
20, batches of 64
4,000, full batch
1,024 (256), full batch
Learning rate
540
1
30
10
Search
Appendix
Table 5: Every CRAM fit is a few dozen to a few thousand SGD updates of pseudolikelihood, and every search is a single-cell local search. All fits start at zero and use SGD with momentum 0.5 and a cosine schedule; the L1 term is a soft-threshold after each step. Values in parentheses are for the larger N-Queens board or graph. hˉ : mean positive learned cost; u : the N-Queens temperature unit ( Sec. C.5 ); τ : highest energy of a training solution.
Figure 5: Hand-set weights on CRAM energy. Each title gives the number of distinct nonzero values. (a) Sudoku: board cell j shows the 9×9 cost block \boldsymbol{{\color[rgb]{0.9219,0.4063,0.2031}K}}_{ij} between the digits of the chosen cell i (rows) and of cell j (columns), on the color scale of the learned costs in Fig. 2 b. It is the identity on the 20 cells that share a row, column or box with i . (b) Maze-Unique: change in energy when an open cell turns on; the center is the change with no neighbor on, and each other entry is the change that a neighbor on at that offset adds. (c) N-Queens ( 8×8 ): cost of a queen at each cell together with a queen at the dark cell, 1 when they attack each other. (d) Graph coloring: cost of the colors of the two vertices of an edge; pairs without an edge cost 0.
Training method
Compares the labeled solution with
L L L Pseudolikelihood [ 8 ]
every single-cell change ( Eq. 5 )
L L L Masked pseudolikelihood [ 17 ]
its single-cell changes, with each cell hidden with probability q
L L L Min Probability Flow [ 56 ]
every single-cell change, weighted by exp(−ΔE/2)
L L L Denoising Score Matching [ 60 ]
its own logits plus Gaussian noise of scale σ
S S L Contrastive divergence [ 31 ]
the board after k heat-bath moves from it
S S L Persistent CD [ 58 ]
a stored chain per training board, advanced k moves per visit
Appendix
Table 6: Local training objective overview. L L L local objectives, evaluated at the labeled solution. S S L sampling methods, whose negatives get no gradient. D D L methods that differentiate through a relaxation or its fixed point. k , n , T , q and σ are tuned ( App. D ).
Sudoku-Extreme
Maze-Unique
Training method
T 99
FLOPs 99
Solved
T 99
FLOPs 99
Solved
L L L Pseudolikelihood [ 8 ]
50 ms
3.42 e 10
100.00 ± 0.00
43 ms
6.15 e 7
100.00 ± 0.00
L L L Masked pseudolikelihood [ 17 ]
198 ms
1.95 e 11
99.99 ± 0.00
22 ms
3.11 e 7
100.00 ± 0.00
L L L Min Probability Flow [ 56 ]
225 ms
1.95 e 11
99.99 ± 0.00
30 ms
4.22 e 7
100.00 ± 0.00
L L L Denoising Score Matching [ 60 ]
1.6 s
2.20 e 12
99.98 ± 0.01
23 ms
3.44 e 7
100.00 ± 0.00
S S L Contrastive divergence [ 31 ]
33.7 s
1.26 e 14
99.99 ± 0.00
258 ms
3.37 e 9
100.00 ± 0.00
Appendix
Table 7: Nine of the twelve training methods reach at least 99% test accuracy on both tasks, and a local objective is the first to reach 99% on the development probe of each task. T 99 : training time until the mean development solve rate of three runs first reaches 99% (dash: never). FLOPs 99 : training arithmetic to that point. Solved : exact test solve rate (%), mean ± SD over three runs. Classes, protocol and notes in App. D ; bold: best value of each column. Every method runs in one shared training harness that is slower than the recipes of Table 2 , so compare these times with each other, not with Table 2 : a full pseudolikelihood fit on Sudoku-Extreme takes about 70 ms here, against 42 ms there.
Model
Solved
Params
FLOPs/puzl
HRM † [ 62 ]
74.50
2.70 e 7
3.01 e 12
TRM † [ 38 ]
85.30
6.82 e 6
3.84 e 12
FPRM † [ 44 ]
87.00
6.83 e 6
4.78 e 14
NCA † [ 22 ]
89.20
4.10 e 4
2.00 e 12
EBR † [ 11 ]
88.30
1.77 e 6
1.93 e 13
CRAM + z
99.90±0.00
2.90 e 1
1.41 e 7
Appendix
Table 8: CRAM + z solves 99.9% of the Maze-Hard test mazes with 29 parameters. Exact match to the labeled path on the 1,000 test mazes. Baselines: accuracy published by their authors. CRAM + z : mean and standard deviation over three training runs (999 of 1,000 in each).
Figure 6: CRAM + z solves a Maze-Hard test maze in two relaxations: the hidden layer settles to a distance-like field, and the answers prune the tree of pointers down to the path. Left: the hidden layer on test maze 0 (seed-0 model), settled first by Eq. 13 : \log{\color[rgb]{0.1641,0.4688,0.8398}z}^{\star}_{i} (white: not connected to G; dark gray: walls) and each cell’s pointer, a line toward its largest weight in Eq. 14 ; the pointers form a tree rooted at G. Top right: rounded answers of the answer flow, run second with the hidden layer fixed, from the all-on board: leaves switch off first; at the stop the board equals the labeled path. Bottom right: the answer energy ( Eq. 1 , entropy included) decreases at every step of that flow; the lighter line continues the flow for 48 steps after the stop, to its fixed point.
Looping is a powerful inductive bias for reasoning. By repeatedly iterating a recurrent block, looped models can scale their effective depth and enable multi-step reasoning in latent space. However, existing looped models are not inherently guided by an explicit measure of progress, making it difficult to determine when to stop looping and how to improve upon the current state. To enable this, we introduce Energy-Based Reasoners (EBRs), which learn an energy function over latent reasoning states and formulate looped updates as gradient descent on this energy. The energy scores latent states, while its gradient guides refinement and provides a signal for stopping. To train EBRs effectively, we further introduce exploration-based training to discover additional modes and to better shape the energy landscape over a broader set of states. Across four algorithmic reasoning benchmarks, EBRs match or outperform prior recurrent reasoning models, achieving 99.9% accuracy on Sudoku-Extreme while using 345× less inference compute than the next-best model and maintaining comparable training compute. On all multi-solution benchmarks, EBRs achieve state-of-the-art coverage of distinct valid solutions while maintaining near-100% single-sample accuracy. These results suggest that energy-based models are a promising approach for strong reasoning performance.
William Xingxu Chen, Alexi Gladstone, Zeyu Michael Li +2
Structured reasoning requires making and revising interdependent decisions to reach a globally consistent solution. Existing architectures struggle with this: autoregressive models commit sequentially and cannot revise earlier decisions, while masked diffusion models often require careful decoding schemes to coordinate interdependent predictions. We introduce Flow Reasoning Models (FRMs), a novel framework for structured reasoning that adapts continuous flows over discrete structured outputs with a simple recurrent refinement mechanism. By self-conditioning a flow model on its own past outputs, we turn one-shot denoising into iterative solution refinement. This lets FRMs make and revise decisions in parallel, efficiently coordinating interdependent choices across solutions. Yet conventional self-conditioning becomes unreliable at greater recurrent depth due to exposure bias between one-step training predictions and recursively generated inference states. We address this mismatch with Fixed-Point Forcing (FPF), which trains FRMs on states produced by their own inference dynamics while preserving the standard flow-matching objective. FRMs achieve solve rates of 99.5%, 100.0%, and 99.9% on Sudoku-Extreme, Zebra, and Maze-Unique, respectively. On Sudoku-Extreme, FRMs achieve higher peak accuracy than the evaluated masked-diffusion and specialized reasoning baselines while remaining highly compute-efficient, matching the next-best method's 98.7% peak solve rate with 44× fewer inference FLOPs.
Alec Helbling, Andrey Bryutkin, Mauro Martino +3
1Georgia Tech · 3MIT-IBM Computing Research Lab · 4IBM Research +1
Recursive reasoning models such as the Tiny Recursive Model (TRM) iteratively refine two latent states: an answer state y, decoded into the output, and a reasoning state z, which is never decoded. Many of their failures have been attributed to bad basins, regions of latent space that trap the recursion on wrong answers. Recent test-time approaches perturb y, z or both to recover these failures, but the impact of this choice on performance, test-time compute efficiency and scaling properties remains unclear. Through controlled experiments on TRM, we find that a failed trajectory carries its failure in its answer state. At equal compute, whether retries continue a failed trajectory (depth scaling) or draw multiple trajectories from the initial states (width scaling), resampling y recovers more failures than any perturbation of z we tested, and the performance gap widens as the test-time compute budget grows. Our approach, Gated Answer Resampling (GAR), pairs this resampling of the answer state with the model's own halting head and restarts only the puzzles that the head rejects. With at most 64 restarts per puzzle and no training or hyperparameter search, GAR takes TRM from 85.9% to 99.4% on Sudoku-Extreme and from 68.8% to 85.6% on Pencil Puzzle Bench validation. On the same checkpoints, GAR also outperforms Probabilistic TRM (PTRM), which perturbs z at each step, even when PTRM uses 42 to 197 times as much compute. Our code is available at https://github.com/MaximeILL/GAR.
Maxime Illouz
Concordia University Mila – Québec AI Institute Montréal, Canada