TL;DR
Standard language models have a fixed depth, and they often reason by writing out long chains of text. Wang and co-authors propose the Hierarchical Reasoning Model (HRM), a small recurrent network with two coupled modules: a slow high-level module that plans and a fast low-level module that does detailed work. The model is trained on about 1000 examples without pre-training or written reasoning traces, and it reaches near-perfect results on the paper's Sudoku and maze tasks.
Builds on: Recurrent Neural Network, Deep Supervision, Adaptive Computation Time · Leads to: the wider line of work on latent and looped reasoning.
Why it mattered
The paper argued that a model can reason in its hidden state rather than in written text. Its results on puzzles where written reasoning methods score zero made latent, iterative computation a serious option for search-heavy tasks. The paper reports 40.3 percent on the ARC-AGI benchmark with a 27M-parameter model trained from scratch on the official training data, above the figures it lists for the two chain-of-thought models it names in the introduction.
The design also made two engineering claims that people now discuss: the training gradient can be computed in constant memory without unrolling through time, and the amount of computation can be raised at inference time without retraining. Both claims rest on specific choices explained below, and both have limits that the paper states itself.
The problem
Three problems are named in the paper.
First, depth. The paper argues that the fixed depth of a standard Transformer limits what it can compute in one pass, and that increasing width does not help on the authors' Sudoku task, while increasing depth is critical.
Second, chain-of-thought. Written reasoning is brittle when the steps are human-defined, needs a lot of training data, and is slow because it generates many tokens.
Third, recurrence. A recurrent network that is trained with backpropagation through time has to store its whole history, and a plain recurrent network tends to converge early, so later steps do little. The paper's goal is a recurrent model that keeps computing for many steps without these two costs.
How it works
The model has four learned parts: an input network that embeds the puzzle, a low-level recurrent module , a high-level recurrent module , and an output network. One forward pass runs high-level cycles, each made of low-level timesteps, so timesteps in total. The walkthrough below follows one forward pass.
- Embed the input. The input is turned into a working representation once, before the loop starts.
- Low-level steps. At every timestep, the low-level module updates its state from its own previous state, the high-level state, and . The high-level state is held fixed during the cycle.
- Settle. Over the steps of a cycle, the low-level state moves toward a local equilibrium that depends on the current high-level state.
- High-level update. At the end of the cycle, the high-level module updates once, using the final low-level state. This gives the low-level module a new context.
- Restart the low level. The next cycle starts the low-level computation again from the new context and settles toward a different equilibrium.
- Read the answer. After cycles, the output network reads the high-level state and produces the prediction.
- Decide whether to stop. A learned halting rule decides whether to output this answer or run another full forward pass.
A tiny trace with and , so four timesteps. The high-level state changes only at timesteps 2 and 4, which are multiples of . The low-level state changes at all four. After timestep 2, the high-level module has absorbed what the low level computed in the first cycle. The low level then starts over in the second cycle, now guided by that update. The paper calls this pattern hierarchical convergence: each module converges, but the high level keeps moving to a new target for the low level, so the whole network does not stop early.
flowchart TD
X[Input x] --> E[Input network: x tilde]
E --> L1[Low-level steps within a cycle]
H0[High-level state] --> L1
L1 --> S{End of cycle?}
S -- no --> L1
S -- yes --> H1[High-level update using final low-level state]
H1 --> L2[Low level restarts under new high-level state]
L2 --> N{N cycles done?}
N -- no --> L1
N -- yes --> O[Output network reads high-level state]
The paper also uses two training devices that the walkthrough depends on. Deep Supervision runs several segments, each a full forward pass, and gives each segment its own loss. Adaptive Computation Time, described in the math, decides how many segments to run. The gradient is approximated by backpropagating only through the last state of each module, which the paper calls the one-step gradient.
Worked examples
Take cycles and low-level steps per cycle.
- Total timesteps in one forward pass: .
- The high-level module updates when the timestep index is a multiple of . Those indices are 4, 8 and 12, so it updates 3 times.
- The low-level module updates at all 12 timesteps.
- Under full backpropagation through time, the memory needed to store the hidden states grows with the number of timesteps. Here that is 12 stored states.
- Under the paper's one-step gradient, only the final state of each module is used for the backward pass, so the stored states do not grow with the number of timesteps. The paper states this as memory compared with for BPTT.
Interpretation: the high-level module's update count equals , and the total depth is . The memory saving is the reason the paper can run long cycles.
Suppose the fixed-point map has a scalar Jacobian . The exact sensitivity of the fixed point to a parameter is , and the Neumann series gives .
- Sum the series with : approaches .
- The exact factor is , which agrees with the series limit.
- The one-step gradient keeps only the first term, so its factor is .
- The one-step gradient therefore gives half the exact sensitivity in this case.
- Now take . The series is and approaches . The one-step factor of is within about 10 percent.
Interpretation: the one-step gradient is accurate when the map's Jacobian is small, and it is less accurate when the state is sensitive to itself. The paper uses it anyway, and its empirical results are the evidence that it trains well for these tasks. The paper does not claim the approximation is exact.
The paper reports participation ratios (PR) for the two modules of the trained model on Sudoku, and for an untrained copy of the same architecture. The paper gives and for the trained model, and and for the untrained model.
- Trained model, ratio of high-level to low-level PR: . The paper reports about 2.98.
- Untrained model, same ratio: .
- The paper compares the trained ratio with mouse cortex, where it reports about 2.25.
- The difference between the two ratios is .
- The untrained network sits near 1, which the paper reads as the absence of hierarchy before training.
Interpretation: after training, the high-level module uses a subspace about three times as wide as the low-level module, and the untrained network shows no such split. The paper says this evidence is correlational. Its ratio is compared with one published measurement from the mouse cortex, and the paper does not claim a causal link.
Try it: suppose a trained model had and . What is the high-to-low ratio, and is the high-level subspace wider or narrower? Answer: , so the high-level subspace is about twice as wide. This is an invented pair of numbers to practise the division, not a result from the paper.
The math
The forward recurrence
Let and be the low-level and high-level states at timestep . With the input representation , the updates are
and, for the high-level module,
In words: the low level always updates, and the high level changes only at the end of each cycle. The prediction is , read from the high-level state after cycles.
The fixed point
Within one cycle the low-level state settles to a fixed point , where is the cycle index. The high-level update is then . Writing this compactly as , the high-level fixed point satisfies .
The implicit gradient and its approximation
Let be the Jacobian of the high-level update. The Implicit Function Theorem gives the exact gradient of the fixed point with respect to the parameters, provided is invertible at the fixed point:
The inverse can be written as a Neumann series , a sum of powers of that converges when is small. The one-step gradient keeps only the first term, so . This turns the gradient into
and the low-level terms are approximated the same way, with . The worked example above used this step with .
Deep supervision in symbols
Run segments on one example, where segment maps the detached state and input to a new state and prediction . Each segment has its own loss , and the parameters are updated after each segment. The state is detached before it is passed on, so the gradient of segment does not flow back into segment . The sequence-level loss in the paper is the average over output tokens of , the log probability the model gives the correct token, which is negative; training pushes it toward zero.
Adaptive computation time in symbols
A Q-head reads the high-level state and outputs two values, , through a sigmoid, which squashes each value into the range 0 to 1. The halting decision is treated as a small episodic MDP. Halting gives a reward of 1 if the prediction is correct and 0 otherwise. Continuing gives a reward of 0. The Q-targets are
Here is 1 when the condition holds and 0 otherwise, and is the maximum number of segments. The segment loss adds a binary cross-entropy term on the Q-values to the sequence loss. The halting rule also uses a minimum number of segments , which is set at random during training, so that the model sometimes thinks for longer.
Participation ratio
The paper measures effective dimensionality with the participation ratio, computed from the eigenvalues of the covariance matrix of the state trajectories:
If variance is spread evenly over many directions, PR is large. If one direction dominates, PR is close to 1. The paper's Figure 8 uses this measure for both modules.
Results
Setting. The main experiments use a 27M-parameter model, trained from random weights on about 1000 examples per task, without pre-training and without written reasoning traces. The paper uses a sequence-to-sequence setup in which the input and output grids are flattened into token sequences.
Sudoku-Extreme. The paper's Sudoku-Extreme set has 1000 training examples in the main experiments. The paper reports a mean difficulty of 22 search backtracks per puzzle, compared with 0.45 for the Sudoku-Bench puzzles it cites. The text reports that the HRM reaches near-perfect accuracy on the full Sudoku-Extreme set and that written reasoning methods fail completely on it. The exact per-model figures are in the paper's Figure 1, which this lesson does not reproduce.
Maze-Hard. The task is the shortest path through a 30 by 30 maze, with training and test sets of 1000 examples each, filtered to keep only mazes whose shortest path is longer than 110. The paper reports near-perfect optimal paths and says that written reasoning methods score 0 percent. Again, the per-model numbers are in Figure 1.
ARC-AGI. The paper reports 40.3 percent on ARC-AGI with HRM, trained from scratch on the official training data (about 1000 examples), against 34.5 percent for o3-mini-high and 21.2 percent for Claude 3.7 with an 8K context, as listed in the introduction. The evaluation takes the two most popular answers from 1000 augmented variants of each test input. The paper also states that extra compute gave minimal gains on ARC-AGI, unlike on Sudoku.
Direct prediction baseline. A Transformer with the same size and training setup but no hierarchy, called "Direct pred" in the paper, fails entirely on the 1000-example Sudoku-Extreme and Maze-Hard. When trained on the full Sudoku-Extreme set of about 3.8 million examples, it reaches 16.9 percent accuracy. The paper also cites a 175M-parameter Transformer trained on 1 million examples across multiple trials, which reached below 20 percent on 30 by 30 mazes with the pass-at-64 metric.
Inference-time scaling. A model trained with a given keeps improving when run with a larger at inference, which the paper shows on Sudoku. The paper reports that adaptive halting uses substantially fewer steps on average than a fixed budget with comparable accuracy.
Limits. The paper reports results on three benchmark families and one analysis of internal representations. It does not test on general language tasks. Its brain-correspondence analysis is correlational, and the authors say a causal test is left for future work. The one-step gradient is an approximation, and the paper's stability argument for Q-learning relies on its own architecture and optimiser choices rather than a general proof.
Reading guide
- Introduction (Section 1). Read after Recurrent Neural Network and Transformer. It uses Chain-of-Thought Prompting as the main comparison.
- Section 2, Hierarchical Reasoning Model. The core. Read the forward recurrence first, then the hierarchical convergence paragraph, which needs Recurrent Neural Network for the idea of a fixed point. The gradient subsection needs Backpropagation Through Time and Implicit Function Theorem, and it uses Jacobian Matrix for the Jacobian.
- Deep supervision and adaptive computation time. Read after Deep Supervision and Adaptive Computation Time. The Q-learning targets need Q-Learning.
- Architectural details. Needs Residual Connection and Automatic Differentiation for the implementation notes. Other choices, such as normalisation and the optimiser, are standard components that the paper names without a full explanation.
- Section 3, Results. Read 3.1 for the benchmarks and 3.2 for the evaluation protocol, then the figures. The baselines need the background on Chain-of-Thought Prompting.
- Section 4, Brain Correspondence. Needs Covariance Matrix for the participation ratio. This section is optional for the main method.
- Section 5, Related Work and Section 6, Discussions. Mention Linear Attention and looped Transformers; useful for context.
Check yourself
QuestionIn one sentence, what does the high-level module do differently from the low-level module in the HRM?Show answer
The high-level module updates once per cycle, after the low-level module has finished its steps, and it holds the slow planning state. The low-level module updates at every timestep and does the fast, detailed work within a cycle.
QuestionAn HRM runs cycles with low-level steps each. How many total timesteps does one forward pass use, and how many times does the high-level module update?Show answer
The total is timesteps. The high-level module updates once per cycle, so it updates 5 times, at timesteps 3, 6, 9, 12 and 15.
QuestionWhy does the one-step gradient give an approximation rather than the exact gradient of the fixed point, and when is the approximation close?Show answer
The exact gradient needs the inverse , which the Neumann series writes as an infinite sum. The one-step gradient keeps only the first term, which is the identity, so it drops the higher powers of the Jacobian. It is close when is small, because then the dropped terms are small.
QuestionThe paper reports PR values of 30.22 for the low-level module and 89.95 for the high-level module. What is the ratio, and what does a ratio above 1 mean here?Show answer
The ratio is . A ratio above 1 means the high-level state spreads its variance over more effective dimensions than the low-level state, so the high-level module uses a wider subspace.
QuestionA research team wants a chain-of-thought-free model for a long search problem with only a few thousand examples. Which parts of HRM would they most likely keep, and what is one risk they should check?Show answer
They would likely keep the two-timescale recurrence, since it lets the model compute for many steps, and the one-step gradient, since it keeps memory constant. A key risk to check is whether the one-step approximation is accurate for their state dynamics, since the approximation drops terms that matter when the state is sensitive to itself. They should also verify the result on their own task, since the paper's evidence is on its chosen benchmarks.