Classical Energies Learn to Reason 1,000x Faster than Looped Models
Energy Reasons Faster
Symbol colors. A color marks a symbol's role, the same on every post and deck. Roles in this post:state what descent changescouplings the weights between unitstruth the true answernegatives the fake answers training pushes up

Looped models are a popular new way to make neural networks reason. But they are slow to train, and they use millions of parameters to solve simple logic puzzles. We show that a small energy from the 1980s, with learned weights, solves the same puzzles after 42 milliseconds of training, uses 282× fewer operations to reason, and never stops at a wrong answer.
CRAM trains at least 1,000× faster than looped models, and reasons with at least 282× less compute. Training directly lowers the energy of solved puzzles while raising the energy of incorrect solutions or "negative samples". Reasoning keeps the clues of a new puzzle clamped and runs several chains from random guesses, noisily lowering the energy one cell at a time, until the energy of one chain reaches a stopping threshold fitted to the training solutions. The boards are real Sudoku-Extreme puzzles.
Looping Is an Emerging Form of Reasoning
A looped model applies one network, or one block of layers, many times in a row. Give it a Sudoku puzzle with empty cells, and each pass through the block refines its guess at the filled board. The block reuses its weights on every pass, so a looped model is a recurrent network in depth.
The idea of “looping” is not new: recurrent relational networks solved Sudoku by repeated message passing [RRN], and Universal Transformers apply one transformer layer many times [UT]. 2025 kicked off the new wave of looped models, with the Hierarchical Reasoning Model (HRM) [HRM] and the Tiny Recursive Model (TRM) [TRM] made looping popular. With a few million parameters, they learn Sudoku-Extreme and mazes from examples, which large feedforward transformers generally fail to do. Many variants followed [GRAM, EqR, FRM, TRMP, EBR, FPRM].
Looping works, but it has three problems.
- It is slow to train. The seven looped models we test train for 1.2 to 23 hours on one GPU.
- It is large. They use between 33 thousand and 27 million parameters, and between and floating-point operations (FLOPs) per puzzle.
- It is not always stable. Nothing makes the loop settle on an answer, so looped models add training losses that make the loop converge, and separate networks that decide when to stop.
Why looped models succeed is also unclear [ARC Prize, Ren and Liu].
Looping Is Slow to Train
The main cost of training is backpropagation through time (BPTT). BPTT runs the loop forward, 16 or more passes, compares the last output with the answer, and sends the gradient back through every pass. The update then changes the whole trajectory, so that the next time the model sees the puzzle, its output is a little closer to the answer. Every training step pays for the whole reasoning trajectory twice: once forward and once backward. The figure below shows the four stages.
How can energy-based models be trained?
-
Looped models learn by backpropagation through time (BPTT). BPTT runs the inference steps, measures the error between the output and the answer, and corrects a portion of the entire path accordingly. Large energy-based reasoners ((cite)) are trained the same way, through their descent.
-
Energy landscapes can be shaped directly. So long as we know what "real-looking" solution is and what a "fake-looking" solution is, we can shape an energy landscape: low-energy for real data, high-energy for fake data. This lets you train with no backpropagation through any path. The figure above shows how CRAM does this.
Looping Looks Like Energy Descent
Write one pass of a looped model as an update of its state :
The learned network can be anything. Now constrain it to be the negative gradient of a learned scalar function , the energy, with a step size :
The loop is now gradient descent on the energy. The energy gives one number to every candidate board: low for a board that satisfies the rules, high for a board that breaks many of them. An unsolved puzzle starts high on this landscape, the solution sits at the bottom of a well, and reasoning is the walk down. For a small enough step size, each step lowers the energy, so the loop settles at a fixed point by construction. The figure below compares the two.
From looping to energy
Looped model
A looped model a step. Inference or "reasoning" is a sequence of steps that get closer to a desired output. Nothing constrains the path those steps take, and it does not need to settle.
Descent on an energy
An energy-based model learns a landscape. Inference or "reasoning" paths are searches for low-energy states on that landcsape. Reasoning is complete when no step lowers the energy further.
Learn the Energy Directly
Looped models already borrow the properties of an energy, one at a time. Some train their loop to converge to attractors or fixed points [EqR, FPRM, Attractor Models], which descent on an energy gives for free. Others learn when to stop with a separate halting network [ACT, PonderNet, HRM, TRM]. Others put an energy on top of a deep network and descend it [IREM, IRED, EBT, AKOrN, EBR]. Each of these adds a head, a loss or a module to the looped network, and the network still trains by BPTT.
Hypothesis: an explicit energy enables rapid training and efficient reasoning.
We test this with a small energy that has no network inside it. We call it Compact Reasoning Associative Memory (CRAM). On Sudoku-Extreme and Maze-Unique, compared with seven looped models:
- CRAM trains in 42 ms and 132 ms on one GPU, at least 1,000× faster.
- It matches the looped models at their highest accuracy with 282× fewer inference FLOPs.
- It loses no accuracy: it solves 99.996% of Sudoku-Extreme and 100% of Maze-Unique test puzzles, more than any looped model.
CRAM’s Energy Is a Sum of Costs
A puzzle has answer variables, called cells, and each cell takes one of values. A 9×9 Sudoku has cells with digits each. A maze has one cell per square, which is on or off the path (). CRAM keeps a belief for each cell : a softmax distribution over the cell’s values. Its energy is a sum of costs on cells and on pairs of cells:
The colors follow one rule through the post: blue symbols change during reasoning, and orange symbols are learned.
- The pair costs are the important term. holds a learned cost for each pair of values at cells and . For Sudoku, a good makes two equal digits in the same row expensive.
- The input costs hold a learned cost for each value at cell .
- The negative entropy, with inverse temperature , penalizes a belief that is more certain than the costs justify. When every belief is one-hot, it is zero, and the energy is the sum of the costs of the chosen values.
That an energy like this solves Sudoku is not new. It is a small change to the energy that Hopfield and Tank used in 1985 to solve the travelling salesman problem [Hopfield and Tank], written in the mean-field form of Peterson and Söderberg [Peterson and Söderberg]. In 2008, Hopfield set the weights of such an energy by hand to solve Sudoku [Hopfield (Sudoku)]. What is new is that CRAM learns its weights from solved puzzles, and is never told the rules.
Other work learns pairwise costs for Sudoku from solved puzzles too, with likelihood objectives close to ours [Brouard et al., Defresne et al.]. Those methods pass the learned costs to an exact combinatorial solver. CRAM instead reasons by descent on its own energy, as a looped model does, which lets us compare it with looped models step for step.
The name comes from associative memory. As in an Amari–Hopfield network [Amari, Hopfield], CRAM’s weights memorize associations, here between pairs of cell values that may appear together. Descent then completes a partial pattern: a puzzle given with only its clues. CRAM’s energy is a special case of the energies of modern Hopfield networks [Dense AM, AM tutorial].
Training Lowers the Energy of Correct Solutions
An energy defines a probability for every board, , the Boltzmann distribution. Training minimizes the negative log-likelihood (NLL) of the training solutions [Boltzmann machine, LeCun et al.]:
Its gradient has two terms:
The first term lowers the energy of the real solutions. The second raises the energy of boards sampled from the model, so the boards that the model wrongly favors are pushed up hardest [Du and Mordatch]. When the model puts all its probability on the solutions, the two terms cancel.
This objective has one large advantage over BPTT: no gradient goes through inference. The samples are held fixed, so there is no reasoning trajectory to backpropagate through. The figure below plays the objective on a line of 41 possible boards, with the second term computed exactly.
The cost is in the second term. A real puzzle has far too many boards to sum over, and drawing samples from the model takes a long Markov chain. Most training methods for energies differ in how they avoid this.
Pseudolikelihood: Fast Contrastive Training
CRAM uses pseudolikelihood [Besag]. It replaces the samples from the model with the solution changed at one cell:
Here is the set of free cells, and is the solution with cell set to value . If a free Sudoku cell holds a 5 in the solution, the loss compares the energy of the solution with the energies of the eight boards where that cell holds another digit. For each cell, this is a softmax cross-entropy over its values. It needs only the costs that touch that cell, and nothing is sampled. An L1 penalty sets a cost to zero where the examples show no constraint, so the learned energy is sparse.
The video below shows pseudolikelihood on a real Sudoku-Extreme solution. The solution’s energy is pulled down, the energies of its one-cell changes are pushed up, and a well forms around the solution.
Pseudolikelihood shapes the energy around a solution. Green: a Sudoku-Extreme solution, whose energy is pulled down. Orange: the solution with one cell changed, whose energy is pushed up.
Pseudolikelihood has a cost of its own. It shapes only the bottom of each well and its rim. It never trains the energy between wells, or far from any solution. So the search at inference needs noise to find the wells, which the next section describes. On these four tasks, pseudolikelihood trains an energy as good as the one that contrastive divergence trains, and much faster (below). Harder problems will likely need some sampling from the model.
Reasoning Minimizes the Energy
At inference, the clues stay fixed and the free cells descend the energy. As in Hopfield networks, each cell has a state , and its belief is the softmax of that state at temperature :
With step size and one cell at a time, the update is exact, and it is one looped layer:
So CRAM is itself a looped model, whose layer is fixed by its energy.
Deterministic descent tends to stop in a spurious local minimum, the regions that pseudolikelihood never trained. So CRAM runs a noisy focused Gibbs search [Hopfield and Tank, Geman and Geman]. Each move picks a cell whose local energy is high, computes its state with the update, and samples the cell’s value from its belief. Because the value is sampled, a move can go uphill and leave a local minimum. On Sudoku-Extreme, four search chains run in parallel from random boards.
The energy also says when to stop. After training, we measure the energies of the training solutions. The search stops at the first board whose energy is at most the highest of them. This threshold is one number, read off the trained energy; no separate network learns it.
Each move is a fixed, small amount of arithmetic, so we can count the FLOPs of a search exactly and compare them with the FLOPs of a looped model.
Four Reasoning Benchmarks
We test on four benchmarks that are standard for looped models (the table below).
The four benchmarks. Sudoku-Extreme is from HRM [HRM], Maze-Unique from EqR [EqR], and N-Queens and graph colouring from GRAM [GRAM].
| Benchmark | The task | Answers per puzzle |
|---|---|---|
| Sudoku-Extreme | hard 9×9 Sudoku | one |
| Maze-Unique | the one path through a 30×30 maze | one |
| N-Queens (8×8, 10×10) | place queens so that no queen attacks another, given some queens | many |
| Graph colouring (8, 10 nodes) | colour each node so that no edge joins two nodes of one colour | many |
Sudoku-Extreme and Maze-Unique have one answer per puzzle, so the score is the share of puzzles solved. N-Queens and graph colouring have many answers per puzzle, so a second question is how many different answers a model finds.
The figure below runs the trained CRAM weights for each task in your browser. Press Play to watch each search lower its energy until it stops, or click a puzzle to replay it.
per chain, 4 chains
first of 4 chains to stop
first of 4 chains to stop
Trained CRAM models running live in your browser. CRAM energy, trained separately from observed puzzle solutions for each task, solves all four kinds of puzzles by minimizing its energy one cell at a time. Feel free to shuffle different puzzle examples. The playback is not in real time: it is slowed down about 10× for Sudoku, about 5,000× for Maze-Unique, and more than 10,000× for N-Queens and graph colouring.
Seven Looped Baselines
We compare CRAM with seven looped models from 2025 and 2026.
- HRM, the Hierarchical Reasoning Model, and TRM, the Tiny Recursive Model, made looped reasoning popular [HRM, TRM].
- GRAM, Generative Recursive Reasoning, samples reasoning trajectories [GRAM].
- EqR, Equilibrium Reasoners, trains the loop to converge to attractors, and adds restarts [EqR].
- FRM, Flow Reasoning Models, treats the loop as a flow [FRM].
- TRMP, Tiny Recursive Message Passing, selects the best of 64 rollouts [TRMP].
- EBR, Energy-Based Reasoners, treats a TRM-style recurrent reasoner as an energy-based model, and stops when the energy’s gradient is small [EBR].
EBR is the closest to CRAM, and it is the reason this work exists: it shows that energy helps looped reasoning, but it trains a large network by BPTT. We retrain each model with its authors’ code and recipe on one H200 GPU, and score it with its published inference setting.
More Accurate, 1,000× Faster to Train
CRAM solves 99.996% of the 412,786 Sudoku-Extreme test puzzles and all 1,000 Maze-Unique test mazes (the table below). The most accurate looped model, TRMP, solves 99.87% and 99.23%. HRM, the model that started this line of work, solves 54.6% and 40.0%.
CRAM trains in 42 ms on Sudoku-Extreme and 132 ms on Maze-Unique, with 7.7 thousand and 18 parameters. The looped models train for 1.2 to 23 hours. Some looped models have faster hand-tuned variants, so we state the speed-up as at least 1,000×.
| Model | Sudoku-Extreme | Maze-Unique | ||||||
|---|---|---|---|---|---|---|---|---|
| Solved (%) | Params | flop / puzzle | Fit time | Solved (%) | Params | flop / puzzle | Fit time | |
| HRM | 54.62±4.18 | 27.0M | 2.20 × 1011 | 1.2 h | 39.97±33.90 | 27.0M | 3.01 × 1012 | 7.1 h |
| TRM | 85.73±0.74 | 5.0M | 4.11 × 1011 | 2.5 h | 92.23±13.37 | 6.8M | 3.84 × 1012 | 15.6 h |
| GRAM | 96.10† | 9.1M | 8.51 × 1012 | 3.2 h | 98.63±1.31 | 10.9M | 8.00 × 1013 | 23.2 h |
| EqR | 99.49±0.14 | 5.0M | 2.11 × 1014 | 2.0 h | 93.00† | 263.8K | 1.16 × 1014 | 7.2 h |
| FRM | 99.13±0.29 | 7.0M | 3.91 × 1012 | 2.9 h | 97.27±2.80 | 8.0M | 4.70 × 1012 | 9.7 h |
| TRMP | 99.87±0.08 | 32.8K | 4.57 × 1012 | 9.0 h | 99.23±0.31 | 60.7K | 1.80 × 1013 | 7.6 h |
| EBR | 99.85±0.05 | 1.8M | 3.37 × 1011 | 2.8 h | 89.80±6.35 | 1.8M | 1.93 × 1013 | 2.0 h |
| CRAM | 100.00±0.00 | 7.7K | 2.02 × 109 | 0.04 s | 100.00±0.00 | 18 | 8.37 × 105 | 0.13 s |
| (hand-set)‡ | 100.00±0.00 | 1 | 1.08 × 108 | — | 100.00±0.00 | 3 | 8.37 × 105 | — |
Solved: mean ± SD over three training runs. Params: nonzero parameters. flop / puzzle: mean inference operations per puzzle, every search chain and failed search included. Fit time: one run on one H200. † Published accuracy, shown where our reproduction scored lower. ‡ Weights set by hand from the task's rules; Params counts unique nonzero values.
CRAM is more accurate than every looped model on both tasks, and trains at least 1,000× faster. Each looped model is retrained with its authors’ code and recipe and scored with its published inference setting. Solved: mean and standard deviation over three training runs. Params: nonzero parameters. A dagger marks a published accuracy, shown where our reproduction scored lower. The gray row has weights set by hand from the rules (below). CRAM’s fit time is the median of seven complete fits after a first fit in the same process; each looped model’s is one run in a fresh process.
To make the gap concrete: TRM trains on Sudoku-Extreme for 2 hours and 32 minutes on one H200. In that time, CRAM trains 215,056 times.
CRAM trains 215,000 times in the time TRM trains once. The clock runs at real time for the first second, then speeds up.
N-Queens and Graph Colouring: Seconds, Not Hours
On N-Queens and graph colouring, a model can draw several answers for each puzzle. We score two things (the table below): whether the kept answer is valid, and Cov@20, the share of each puzzle’s solutions that 20 samples find.
CRAM’s answers are valid: with 20 samples, it solves 100% and 99.99% of the N-Queens puzzles, and its graph colourings have no conflicts. Its coverage is within a few points of EBR, the strongest looped model here, on every task. CRAM has at most 869 parameters and trains in at most 6.8 seconds; EBR has 7.1 million parameters and trains for at least 3.2 hours.
| Model | N | N-Queens 8×8 | N-Queens 10×10 | Graph colouring 8 | Graph colouring 10 | Params | Fit time | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Solved (%) | Cov@20 | Solved (%) | Cov@20 | Conflicts | Cov@20 | Conflicts | Cov@20 | ||||
| HRM | — | 84.41 | 58.8 | 37.80† | 10.7 | 139.7 | 20.6 | 182.7 | 6.2 | 27.3M | ≥ 41 min |
| TRM | — | 67.39 | 51.4 | 17.50† | 3.3 | 118.0 | 21.8 | 169.0 | 6.9 | 6.8M | ≥ 54 min |
| GRAM | 1 | 99.44 | — | 88.91 | — | 3.3 | — | 52.7 | — | 10.9M | ≥ 53 min |
| 20 | 100.00 | 97.9 | 99.98 | 92.9 | 3.3 | 87.9 | 52.7 | 37.8 | |||
| EBR | 1 | 100.00 | — | 99.31 | — | 0.0 | — | 0.3 | — | 7.1M | ≥ 3.2 h |
| 20 | 99.95 | 98.1 | 99.99 | 92.5 | 2.7 | 88.9 | 0.7 | 54.8 | |||
| CRAM | 1 | 99.95 | — | 99.45 | — | 0.0 | — | 0.3 | — | ≤ 869 | ≤ 6.8 s |
| 20 | 100.00 | 97.9 | 99.99 | 93.6 | 0.0 | 88.9 | 0.0 | 52.6 | |||
| (hand-set) | 1 | 100.00 | — | 99.99 | — | 0.0 | — | 0.0 | — | ≤ 2 | — |
| 20 | 100.00 | 98.4 | 100.00 | 95.5 | 0.0 | 90.6 | 0.0 | 55.2 | |||
On N-Queens and graph colouring, CRAM is as accurate and as diverse as the best looped model, and trains in seconds. N = 1 keeps one sample; N = 20 keeps the best of 20 (the majority vote for GRAM, the lowest energy for EBR and CRAM). HRM and TRM are deterministic, so they have one row. Solved: test puzzles whose kept answer is valid (%). Conflicts: edges whose two nodes have the same colour, summed over the test graphs; lower is better. Cov@20: the share of each puzzle’s solutions that 20 samples find (%). Bold: the best learned value of each column. Test sets from GRAM; mean over three training runs.
Same Accuracy with 282× Fewer Operations
Each method has a setting that limits its inference compute: reasoning steps, restarts, sampled trajectories, rollouts or, for CRAM, search moves. Sweeping that setting gives each method’s accuracy at each compute budget (the figure below).
The looped models spend between and FLOPs per Sudoku-Extreme puzzle. CRAM solves 99.997% with about on average. It matches EBR’s top accuracy (99.86%) with FLOPs per puzzle, against EBR’s : 282× fewer. Against EqR, the ratio is 128,000×.
Each looped model's best, and what CRAM needs for the same accuracy
| Model | Best solved | Gflop per puzzle | CRAM's Gflop at same accuracy |
|---|---|---|---|
| EBR | 99.86% | 542 | 1.92 (282× fewer) |
| TRM | 89.72% | 823 | 1.14 (722× fewer) |
| HRM | 57.10% | 441 | 0.46 (958× fewer) |
| TRMP | 99.87% | 4,734 | 1.92 (2,467× fewer) |
| FRM | 99.42% | 7,810 | 1.59 (4,900× fewer) |
| GRAM | 94.74% | 17,020 | 1.32 (12,894× fewer) |
| EqR | 99.49% | 210,600 | 1.65 (127,869× fewer) |
CRAM matches each looped model’s best accuracy with at least 282× fewer floating-point operations. Each curve shows one method’s most accurate setting at each compute budget, on 10,000 Sudoku-Extreme test puzzles: the mean over three training runs, with bars from the lowest to the highest run. The upper panel zooms into the top 2%. The flop counts include the whole search, every search chain included. Hover over a point for its numbers.
The Energy Lets Compute Follow Difficulty
A good reasoner spends more effort on harder problems. CRAM does this without a halting network: its search stops at the first board below the energy threshold, and a hard puzzle takes longer to get there. Across the dataset’s difficulty ratings, CRAM’s median compute grows 22× from the easiest bin to the hardest, and its accuracy stays at 100% (the figure below).
FRM spends the same compute on every puzzle, and its accuracy falls on the hardest ones. EBR has an early-stopping rule, but its compute barely changes with difficulty, and its accuracy dips on the hardest bin.
CRAM’s compute grows with the difficulty of a puzzle, and its accuracy does not fall. The 10,000 Sudoku-Extreme test puzzles of the compute figure, binned by the dataset’s difficulty rating. Top: median FLOPs per puzzle (log scale), with a band from the 10th to the 90th percentile for the methods whose compute varies. Bottom: puzzles solved, median over three training runs, with a band over the runs. EBR and FRM are at their most accurate settings.
CRAM Never Stops at a Wrong Answer
A stopping rule is only useful if it is right when it stops. The halting rules of HRM, TRM, EqR, TRMP and EBR each stop at an incorrect board on 0.05% to 3.54% of the puzzles that they stop on (the table below). CRAM’s energy threshold never does. CRAM misses a puzzle only when its search reaches its compute budget before any board passes the threshold; that is where its 0.004% of unsolved Sudoku-Extreme puzzles come from.
Only CRAM never stops at a wrong answer. Each looped model runs one rollout in its halting mode. Wrong stops: puzzles on which the rule stopped at an incorrect board, as a share of the puzzles it stopped on (%). Full test sets, pooled over three training runs.
| Wrong stops (%) | ||
|---|---|---|
| Stopping rule | Sudoku | Maze |
| HRM halting head | 0.62 | 0.16 |
| TRM halting head | 2.37 | 3.54 |
| EqR halting head | 1.61 | 1.06 |
| TRMP halting head | 0.05 | 0.73 |
| EBR gradient-norm stop | 0.21 | –* |
| CRAM energy threshold | 0.00 | 0.00 |
* EBR’s gradient-norm stop does not work on Maze-Unique: its gradient norm stays near 2 even at correct mazes, so EBR’s published maze protocol runs a fixed number of segments.
Training Without Unrolling Is Fastest
Is CRAM fast because of its energy, or because of pseudolikelihood? We train the same energy five ways (the figure below).
- Pseudolikelihood reaches 99% of development puzzles after 48 ms.
- Minimum probability flow [MPF], another objective that is local to the training solutions, reaches it after 0.21 s.
- One-step BPTT, which backpropagates through only the last step of the loop, as several looped models do, takes 4.4 s.
- Contrastive divergence [CD], which draws samples from the model with a short Markov chain, takes 33 s.
- Full BPTT through all 10 steps of descent, the way looped models train, solves only 27% after 245 s, and only 48.8% after about 5 hours. Its gradients vanish and explode.
Every method can train this energy, but the objectives that never unroll the loop are faster by orders of magnitude.
Local objectives train the same energy fastest. Mean solve rate on 512 Sudoku-Extreme development puzzles over 20 training runs per method, against training time on one H200 (log scale), with a band from the 25th to the 75th percentile of the runs. A filled circle marks where the mean first reaches 99%. Times include fitting the stopping threshold and exclude each run’s one-time start-up.
CRAM Learns from Few Puzzles
An energy with few parameters should also need few examples. We train each method on a growing number of unique Sudoku-Extreme puzzles, each with 99 symmetric variants, as the looped models are trained (the figure below). CRAM solves 98.9% of 10,000 test puzzles after 30 unique training puzzles. EBR needs 700 to reach 98%. TRM does best with fewer than 10 puzzles, but improves much more slowly after that.
CRAM learns Sudoku-Extreme from about 30 unique puzzles. Puzzles solved out of 10,000 Sudoku-Extreme test puzzles, against the number of unique training puzzles (log scale), each with 99 augmentations. Line: median of six training runs per method. Small dots: single runs.
Hand-Set Weights Solve Every Benchmark
These results come with a warning. All four benchmarks belong to a category of logic puzzles that CRAM’s pairwise energy can represent exactly, as Hopfield and Tank showed for such problems in 1985. If you know the rules, you can set CRAM’s weights by hand. With the same search, a hand-set CRAM energy solves every test puzzle of all four benchmarks, with very few unique weight values:
- Sudoku-Extreme: 1 weight value
- Maze-Unique: 3
- N-Queens: 2
- Graph colouring: 1
On Sudoku, the hand-set energy even uses up to 19× fewer FLOPs than the learned one. So a high score on these benchmarks shows only that a model has learned a few pairwise rules between answer cells. It does not show that a method will scale to harder reasoning.
The Weights Are the Rules of the Puzzle
Because the energy is this small, we can read what CRAM learned (the figure below).
On Sudoku, CRAM is told no rules. In every training run, it learns a positive cost on two equal digits in exactly the 810 pairs of cells that share a row, column or box, and leaves every other cost at zero. Those are the rules of Sudoku.
On Maze-Unique, the learned weights form a 3×3 window around each cell. A cell on the path costs +1.24, and each neighbour on the path at its side lowers that cost by 1.00. So a cell with only one neighbour on the path, a dead end, costs energy and switches off. This is dead-end filling [Pullen], a local rule that solves every maze without loops. Pseudolikelihood finds nearly the hand-set values.
CRAM’s learned weights are the rules of the puzzle. Left: the learned cost between one Sudoku cell and every other cell , digit by digit; it is nonzero only between equal digits in the same row, column or box. Right: the Maze-Unique weights around one cell: a cell on the path costs energy unless neighbours at its sides are also on the path, so dead ends switch off.
Maze-Hard Needs Hidden Neurons
Where does a pairwise energy stop working? Maze-Hard [HRM] is a maze benchmark on which no published looped model reaches 90%. In Maze-Unique, one path joins the start S to the goal G. In Maze-Hard, the mazes have loops, so many paths join them, and the answer is the shortest one; ties go to the path that breadth-first search finds first, with the neighbour order down, left, right, up.
Maze-Unique has one path; Maze-Hard has loops. Each maze is shown with its labeled path in green.
Dead-end filling leaves every loop in place. Which side of a loop to take depends on the distance from each cell to G, and no local window of the maze contains that distance. A pairwise energy over the answer cells alone solves none of 100 development mazes.
So we give CRAM one layer of hidden neurons, one per open cell, whose job is to compute that distance. Their energy has one learned mass , a reward for neighbouring outputs that are both large, and a unit input at the goal:
Reasoning is now two relaxations. First the hidden neurons settle; their settled outputs fall off with distance from G. Then the answer cells relax with the Maze-Unique energy, plus learned links between neighbouring cells whose strength depends on the settled hidden outputs. The model has 29 parameters: Maze-Unique’s 18 and 11 more. It solves 99.9% of the 1,000 Maze-Hard test mazes after less than 30 seconds of training (the table below). In the figure below, press Play to watch the hidden layer settle, then the path.
phase 2 took 112 steps
hidden neurons z (phase 1), darker nearer G visible cells on (phase 2) path at the stop
CRAM, with an added hidden layer of neurons, can solve Maze-Hard. The objective of Maze-Hard is to find the shortest path from start to goal, and if there are multiple shortest paths, to find the one that follows a preferred configuration of turns. The 29 trained weights run in your browser on test mazes. Feel free to shuffle the test maze.
CRAM with a hidden layer solves 99.9% of Maze-Hard with 29 parameters. Exact match to the labeled path on the 1,000 test mazes. Looped models: accuracy published by their authors, parameters and FLOPs counted by us. CRAM: three training runs, each solving 999 of 1,000. FPRM: Fixed-Point Reasoners [FPRM]. NCA: neural cellular automata [NCA].
| Model | Solved (%) | Parameters | FLOPs per maze |
|---|---|---|---|
| HRM | 74.5 | 27M | |
| TRM | 85.3 | 6.8M | |
| FPRM | 87.0 | 6.8M | |
| EBR | 88.3 | 1.8M | |
| NCA | 89.2 | 41K | |
| CRAM with a hidden layer | 99.9 | 29 |
This result needs a plain caveat. We designed this hidden layer because we knew that the answer depends on the distance to the goal. It will not help on a task that has no distance to a goal.
Learning Hidden Variables Is the Open Problem
General reasoning needs hidden quantities that nobody designs in advance. In ARC, the Abstraction and Reasoning Corpus [ARC], every task has a new hidden rule, which a solver must infer from a few examples (the figure below). The rule can depend on how many objects there are, which objects they are, and which of several transformations applies. CRAM’s energy, with one variable per answer cell, cannot represent such rules.
Copy the input into each of its colored cells
Every colored cell falls to the bottom
Red grows yellow corners, blue an orange cross
Three ARC tasks, each with its own hidden rule. Each task shows one example and its test; the dashed box marks the answer.
There is a second limit, in training. Pseudolikelihood compares a solution with every one-cell change of it. That is cheap with 9 digits per cell, but not with tens of thousands of values per position, as in language; there, the competitors would have to be sampled.
Learning hidden variables from data, without knowing the task’s design, is the open problem for scaling energies to harder reasoning, and the next step for this line of work.
Energies Learn to Reason, 1,000× Faster
Looped models rebuild the properties of an energy one at a time: fixed points, halting heads and search, each added on top of a network trained by BPTT. An explicit energy gives these properties by construction. On constraint puzzles, CRAM shows what that is worth:
- at least 1,000× faster training than looped models, from as few as 30 unique puzzles;
- 282× fewer operations at the same accuracy, with compute that follows the difficulty of each puzzle;
- a stopping test that never stops at a wrong answer;
- weights that are the rules of the puzzle.
These properties matter beyond puzzles. A model whose answer improves with every loop, and whose energy says when the answer is good, can stop whenever its compute budget runs out and return the best answer so far.
The warning matters as much as the speed-up. Sudoku, mazes, N-Queens and graph colouring are solved with at most three hand-set weight values, so they are too easy to show whether a reasoning method scales. We think explicit energies are a promising direction for learning to reason from data, and that the harder benchmarks, which need learned hidden variables, are where that should be tested next.
Citation
To cite this work, cite the paper on arXiv:
@article{hoover2026cram,
title = {Classical Energies Learn to Reason 1,000x Faster than Looped Models},
author = {Benjamin Hoover and Hugh Blayney and James C. R. Whittington},
journal = {arXiv preprint arXiv:2611.17309},
year = {2026},
eprint = {2611.17309},
archivePrefix = {arXiv},
primaryClass = {cs.AI},
url = {https://arxiv.org/abs/2611.17309}
}References
Sources are linked in the text. Citation details require JavaScript.