Energy-guided Recursive Model (ERM)
- ERM is an inference-time framework that leverages explicit energy minimization and structured memories to select optimal recursive reasoning candidates.
- It decomposes tasks into local and global factors using a Hopfield-style energy formulation, enabling rule-consistent candidate verification.
- Experiments on Sudoku, PPBench, and Maze demonstrate that ERM nearly closes the selection gap, outperforming traditional heuristic selectors.
Energy-guided Recursive Model (ERM) is an inference-time framework for recursive reasoning in which selection among multiple latent trajectories is posed as explicit energy minimization rather than as heuristic voting, token confidence, or auxiliary q-head scoring. In the formulation introduced under the title “Energy-guided Recursive Model,” ERM assigns each decoded candidate a Hopfield-style energy that measures compatibility with task-specific local and global structures, and then returns the minimum-energy trajectory. The same energy also induces a tempered distribution that can be used with parallel tempering for exploration and ranking. On Sudoku, Pencil Puzzle Bench (PPBench), and Maze, ERM is reported to improve selection under a fixed rollout budget of recurrent depth and breadth , reaching , , and optimal-solution rates, respectively (Zhao et al., 11 Jul 2026).
1. Definition and problem setting
ERM addresses what the paper terms the selection gap in test-time scaling: recursive reasoners can generate more candidate trajectories by increasing recurrent depth or stochastic breadth , but existing selection mechanisms often remain heuristic. Majority voting, token confidence, and learned q-heads may correlate with local certainty while failing to capture global correctness, particularly on tasks whose validity depends on structured constraints such as connectivity or permutation consistency (Zhao et al., 11 Jul 2026).
The framework assumes a small neural network that recursively updates a latent state,
where is the input instance, 0 indexes recurrent steps, and 1 introduces stochasticity that creates breadth. A decoder 2 maps the final latent state to a structured output 3. From 4 rollouts, the model obtains a candidate pool
5
ERM then defines a scalar compatibility score 6 and selects
7
This makes the final decision a task-aware energy minimization problem rather than a post hoc heuristic (Zhao et al., 11 Jul 2026).
The energy is built from task-derived memories rather than learned verification heads. A task is decomposed into factors 8, and each factor has an input-conditioned memory set 9 containing valid local or global patterns. These memories are not trained in the main ERM experiments; they are constructed from task rules (Zhao et al., 11 Jul 2026).
2. Hopfield-style energy formulation
ERM is explicitly derived from Modern Hopfield retrieval energy. The paper recalls the classical Hopfield energy
0
and the modern retrieval energy over a query 1 and memory set 2,
3
where 4 is a retrieval temperature. Low 5 approximates nearest-memory retrieval (Zhao et al., 11 Jul 2026).
ERM adapts this principle from continuous retrieval to candidate selection over decoded outputs. Its general energy is
6
where:
- 7 is a factor-specific distance between candidate 8 and memory 9;
- 0 scales memory distance;
- 1 controls sharpness of retrieval;
- 2 is a global rule-violation score;
- 3 weights the global term (Zhao et al., 11 Jul 2026).
The factorized form can also be written as
4
5
6
with 7 and 8 in the paper’s Equation (3) (Zhao et al., 11 Jul 2026).
The authors state that this construction subsumes confidence and hard verification as special cases. A one-cell factor with memories equal to labels recovers nearest-label behavior, while a single complete memory 9 yields energy proportional to distance from a fully specified verifier (Zhao et al., 11 Jul 2026). This suggests that ERM is not merely an alternative selector, but a more general compatibility formalism in which standard confidence-based rules appear as degenerate cases.
3. Inference mechanism and energy-based sampling
ERM is an inference-time method. In the main experiments, the base reasoner is an EqR checkpoint that generates candidate trajectories through depth-0 recurrent computation; no additional ERM training is performed. Memory sets and global penalties are defined directly from task rules. The appendix includes a training-side energy-transformer variant on Sudoku, but the paper identifies that as motivation rather than the main focus (Zhao et al., 11 Jul 2026).
The reported test-time procedure for 1 and 2 has four stages:
- Candidate generation: run 3 stochastic rollouts of the recursive reasoner to obtain decoded candidates 4.
- Energy evaluation: compute 5 for each candidate.
- Selection without parallel tempering: return the lowest-energy candidate.
- Optional parallel tempering: sample and swap candidates across a temperature ladder, then return the lowest-energy candidate among replicas (Zhao et al., 11 Jul 2026).
A diagnostic extension tracks per-step energies 6 and may aggregate them as
7
but the reported results select using the final-step energy rather than a trajectory-aggregated score (Zhao et al., 11 Jul 2026).
The same scalar energy defines a tempered distribution
8
which enables parallel tempering (PT). With replicas at temperatures 9, ERM periodically proposes swaps between neighboring temperatures with acceptance probability
0
The paper interprets this as allowing hot chains to explore broadly while cold chains exploit low-energy basins, with swaps transmitting promising candidates discovered at higher temperature to lower-temperature replicas (Zhao et al., 11 Jul 2026).
A common misunderstanding is to view ERM as primarily a sampling algorithm. In the reported system, PT is optional. The core method is the explicit energy selector itself; PT uses the same energy for improved exploration when needed (Zhao et al., 11 Jul 2026).
4. Task-specific energies and representations
The paper instantiates ERM on three structured reasoning domains, each with a different memory design.
Sudoku
For 9×9 Sudoku-Lite, each candidate is a grid assignment over digits 1. If 2 denotes the base model’s log-probability that cell 3 has digit 4, then for each structural unit 5 (row, column, or box), the memory set 6 contains all 7 permutation matrices enforcing “each digit appears exactly once.” The unit score is
8
where 9 are the cells in unit 0. This log-sum-exp over permutations is evaluated exactly via dynamic programming, described as log-permanent computation. The Sudoku energy is then
1
with clue cells clamped to the provided digits (Zhao et al., 11 Jul 2026).
Pencil Puzzle Bench
PPBench contains heterogeneous puzzle types with enumerable local patterns and global constraints. The paper lists several examples: Lightup uses numbered-clue exact-count memories and line-of-sight at-most-one-bulb memories; Tapa uses cyclic run-pattern memories around clues; Heyawake uses room-count and adjacency memories; Nurikabe uses no-2×2-sea memories and island/sea potentials; and a Sudoku subset reuses permutation memories. Local energies are defined through distances to valid pattern memories using normalized Hamming distance inside the log-sum-exp term. Global energy 2 captures connectivity and coverage violations, since enumerating all fully global valid boards is intractable. The reported configuration is 3, 4, and 5 (Zhao et al., 11 Jul 2026).
Maze
For unique-path 30×30 mazes, the paper emphasizes that local path-degree memories are insufficient because they admit disconnected cycles. ERM therefore uses a global input-conditioned shortest-path memory 6 computed by BFS. Similarity and energy are
7
where 8 is the fraction of matching tokens and 9. The reported Maze configuration sets the local memory weight to zero so that the global verifier dominates (Zhao et al., 11 Jul 2026).
These three instantiations illustrate a central feature of ERM: the energy is not a generic learned scalar, but a structured verifier grounded in the combinatorics of each task. A plausible implication is that ERM’s effectiveness depends strongly on whether the relevant validity constraints can be encoded as tractable memories or global penalties.
5. Quantitative performance, oracle gaps, and ablations
Under a shared-candidate selection protocol with 0 and 1, ERM is compared against baseline one-rollout prediction, majority voting, q-head selection, and confidence-based selection. The paper reports the following exact-accuracy results (Zhao et al., 11 Jul 2026):
| Task | Non-ERM selectors | ERM |
|---|---|---|
| Sudoku (2048 puzzles) | Baseline 89.31%; Majority 97.90%; q-head 98.54%; confidence 98.58% | 98.83% |
| PPBench (301 puzzles) | Baseline 68.44%; Majority 79.07%; confidence 80.73%; q-head 83.39% | 88.04% |
| Maze (1000 mazes) | Baseline 89.10%; Majority 97.80%; q-head 97.30%; confidence 97.80% | 99.30% |
ERM matches the candidate oracle on Sudoku and PPBench at 2 and 3, respectively, and also matches the candidate oracle on Maze at 4 (Zhao et al., 11 Jul 2026). The paper interprets this as closing, or nearly closing, the selector-oracle gap under the same rollout budget.
With parallel tempering, ERM remains the strongest selector. The reported selected/oracle accuracies are:
- Sudoku: PT-q-head 5; PT-confidence 6; PT-ERM 7 selected and 8 oracle, with swap rate approximately 9.
- PPBench: PT-q-head 0; PT-confidence 1; PT-ERM 2 selected and 3 oracle, with swap rate approximately 4.
- Maze: PT-q-head 5; PT-confidence 6; PT-ERM 7 selected and 8 oracle, with swap rate approximately 9 (Zhao et al., 11 Jul 2026).
The ablation analysis isolates several conditions under which ERM is effective:
- Energy choice on PPBench: pure memory-distance energy with 0 avoids elevating confident but invalid candidates; 1 and 2 are identified as critical.
- Global memory on Maze: BFS-derived global memory is necessary because local degree memories cannot reject disconnected cycles.
- Memory capacity on Sudoku: exact log-permanent dynamic programming makes large permutation memories computationally feasible.
- Depth and breadth: increasing 3 improves candidate quality and increasing 4 raises the oracle; ERM’s advantage grows when ordinary selectors lag behind a substantially better oracle.
- Failure cases: if the oracle is low, the bottleneck is candidate generation rather than selection; if PT is ineffective under weak base models, the paper attributes this to misaligned landscapes rather than to the PT mechanism itself (Zhao et al., 11 Jul 2026).
The theoretical discussion is correspondingly modest. ERM does not update latent states by energy descent, but its selector is described as choosing the minimum of a Lyapunov-like function over a discrete candidate set. The paper also states that the factor energies are log-sum-exp over memory distances, making 5 convex in the logits and sharp in the low-temperature limit (Zhao et al., 11 Jul 2026).
6. Relation to earlier energy-guided sequence modeling and terminological scope
The label “ERM” has close conceptual neighbors in earlier work on text generation, but those systems address a different setting. “Residual Energy-Based Models for Text” defines a globally normalized joint model
6
where a base autoregressive LLM 7 is corrected by a sequence-level residual energy 8. The paper derives an exact step-wise decomposition in which local token probabilities are multiplicatively corrected by expectations of 9 over suffixes sampled from the base model, and it uses importance resampling for generation rather than heuristic reranking. It reports improvements in perplexity and human evaluation, including CCNews test perplexity improving from 00 for a 12-layer base LM to 01–02 with Joint BiT-Base, and human preferences favoring joint samples over base LM samples on CCNews (Bakhtin et al., 2020).
A later single-network method, E-ARM, makes the autoregressive model itself an energy-based model by reinterpreting softmax logits as energies without adding parameters. It trains with a contrastive-divergence objective and uses ancestral samples from the autoregressive model for the negative phase via importance weighting, rather than MCMC. The paper reports gains in neural machine translation, language modeling, and image generation; for example, on language modeling with Transformer-Base it improves CC-News perplexity from 03 to 04 without resampling and to 05–06 with Top-K energy resampling (Wang et al., 2022).
These earlier methods share ERM’s broad intuition that energy can guide recursive or autoregressive generation, but they differ materially from the 2026 ERM formulation. The 2026 ERM is an inference-time selector for recursive reasoning trajectories built from explicit Hopfield-style task memories; the text-generation methods are probabilistic generative models over token sequences with learned energy terms (Zhao et al., 11 Jul 2026). The terminological overlap therefore reflects a family resemblance rather than identity.
A separate probabilistic model, the Derrida–Retaux recursive model, also uses the language of “free energy” and recursion, with update
07
but this is a distinct mathematical object from the neural ERM framework. Its “free energy” is the asymptotic normalized expectation
08
studied in the context of hierarchical pinning and critical exponents rather than test-time candidate selection (Hu et al., 2017). The shared vocabulary should not be conflated with the 2026 reasoning model.
In this broader lineage, ERM can be situated as a task-structured, selector-centric variant of energy-guided computation: explicit energy defines what constitutes a valid candidate, and test-time inference chooses or samples according to that criterion rather than according to confidence heuristics alone.