Searching over steps
Best-of-N writes whole solutions and judges them at the end, so a solution that goes wrong in its first line still costs its full length. A process reward model scores partial solutions, so it can judge while the solution is being written: drop the prefixes that look wrong and spend the remaining samples on the ones that look right. That turns generation into a search over a tree whose nodes are partial solutions and whose edges are reasoning steps.
This tab runs the simplest such search, a step-level beam search: Qwen2.5-Math-1.5B-Instruct writes the steps and Skywork-o1-Open-PRM-Qwen-2.5-1.5B, the PRM tab's model, scores them, on the same GSM8K test rows 0–39 as every Reasoning tab. A step is the text up to and including the next blank line, or to the end of the answer, and at most 192 tokens.
The beam search
With beams and samples per beam (here ), each depth does three things:
- Expand. Sample next steps from every kept partial solution (at depth 1, first steps from the question), at temperature 0.7 with top-k 40, the Best-of-N answers' settings.
- Score. Give every candidate the PRM's score at its last line, , the estimate that the solution is still right so far.
- Select. Keep the best candidates, where is the number of answers already finished, and prune the rest. A kept candidate that ends the answer is finished; every other kept one is a beam for the next depth.
The search stops when no beam is left or after 24 depths, and its answer is the finished candidate with the highest score. The panel The search draws one problem's search as a lattice: a column per depth, every candidate a chip with its score, siblings grouped under their parent, kept ones green, finished ones purple, pruned ones grey; the ringed chip is the answer. The panel One expansion shows a parent and its candidates, and The path to it every line of the selected candidate's solution with its PRM score, the number beside it the depth that wrote it.
Because the PRM reads a solution left to right, a child's lines get exactly the scores they had in its parent, as the page checks on 3,472 parent and child pairs; only a line that a step cut at the 192-token cap left unfinished can change its score once it is finished, by up to 0.11 here.
What the search costs
Each depth costs sampled steps plus PRM passes. Averaged over the 40 problems, the search generated 4,566 tokens a problem, as many as 14.6 of the Best-of-N tab's samples, built 103 candidate steps, and the PRM read 26,078 tokens a problem, because it reads each candidate's whole prefix again. The column headings count how many of a depth's candidates are different texts: sampled at temperature 0.7 from the same prefix, the model often writes the same step more than once, and a duplicate costs as much as a new idea.
The chart in the strip plots right answers against generated tokens per problem. The search is right on 87.5 % of the problems. At best-of-16, slightly more tokens than the search, the PRM's last-step score picks right on 90.0 %, the outcome reward model on 87.5 %, the majority vote on 83.8 %, and some answer is right on 97.5 %. On these problems the search does not beat best-of-N with the same verifier.
Search against sampling
A search exploits its verifier harder than best-of-N does: at every depth it throws away whatever the PRM rates low, so a PRM error early on removes good partial solutions for good, and a step the PRM overrates fills every beam. Snell et al. compared beam search guided by a PRM with best-of-N at equal compute and found that the better choice depends on the problem's difficulty: search helped most on harder problems and at small budgets, while on easy problems with larger budgets best-of-N did as well or better, and they traced part of that to search over-optimising the PRM. GSM8K is easy for this model, which a single sample answers right 79.7 % of the time.
Later variants keep the beams apart to stay diverse: Hugging Face's reproduction splits the initial beams into independent subtrees (diverse verifier tree search), and other methods replace beam search with lookahead or Monte Carlo tree search.
Where it came from
Beam search is the classic way to decode sequence models; searching over larger units with a model judging partial results came with Tree of Thoughts (Yao et al., 2023), which explored a tree of reasoning steps with breadth- or depth-first search and the language model itself as evaluator, and with Xie et al.'s self-evaluation guided stochastic beam search the same year. Trained process reward models (see the PRM tab) gave such searches a better evaluator, and Snell et al. made the PRM-guided beam search here a reference point for spending test-time compute. Reasoning models such as those on the Thinking tab learn to do some of this inside a single long chain of thought, checking and backtracking without an outside search.
Papers
- Tree of Thoughts: Deliberate Problem Solving with Large Language Models Search over a tree of reasoning steps, keeping the best partial solutions as judged by the language model.
- Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters Beam search against a process reward model compared with best-of-N at equal compute, and why the better one depends on difficulty.
- Self-Evaluation Guided Beam Search for Reasoning Stochastic beam search over reasoning steps, scored by the model's own evaluation of each step.
- Scaling test-time compute for open models: How we implemented DeepMind’s compute-optimal recipe to solve hard math problems like OpenAI’s o1 An open reproduction of PRM-guided beam search with small models, and diverse verifier tree search.
- Let's Verify Step by Step Process reward models trained on human step labels, the kind of verifier the search relies on.
- Skywork-o1-Open-PRM-Qwen-2.5-1.5B The model card of the PRM that scores every candidate step here.
- Qwen2.5-Math Technical Report: Toward Mathematical Expert Model via Self-Improvement The model that writes the steps.