SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.03816 · NeurIPS · 2024

ReST-MCTS * : LLM Self-Training via Process Reward Guided Tree Search

Yisong Yue, Yuxiao Dong, Jie Tang, Dan Zhang, Ziniu Hu, Sining Zhoubian, • Prm

arXiv · PDF · Open in the Atlas

Code that ran

9 of 22 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 1 has no contract verdict; 7 failures of our instrument; 13 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2406.03816.json · badge: /api/ran/2406.03816.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
thudm/rest-mcts canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
THUDM/ReST-MCTS marked official in Papers with Code
Papers with Code archive
5 ran · 7 no recorded run
DIRECT-BIT/SRA-MCTS community
Papers with Code archive
3 ran · 6 no recorded run
FunctionStatusWhere it lives
getBestChild Ran
ran; our contract draft was wrong, not the code
THUDM/ReST-MCTS/MCTS/mcts.py
pointer only (licence: NONE) · get_code("fb7427c831c79168")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, THUDM/ReST-MCTS when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

getBestChild Ran
ran; our contract draft was wrong, not the code
DIRECT-BIT/SRA-MCTS/MCTS/mcts.py
code served (permissive licence) · get_code("a291959b6558d330")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Node. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math
import random

class Node:
    def __init__(self, value=0.0, num_visits=1):
        self.V = value
        self.numVisits = num_visits
        self.children = {}

class MCTSTask:
    def __init__(self):
        self.low = -float('inf')
        self.exploration_constant = 1.414
        self.INF = float('inf')

# Create a parent node with several child nodes
parent_node = Node(value=0.5, num_visits=10)

# Create child nodes with different values and visit counts
child1 = Node(value=0.6, num_visits=3)
child2 = Node(value=0.7, num_visits=5)
child3 = Node(value=0.4, num_visits=2)

parent_node.children['child_1'] = child1
parent_node.children['child_2'] = child2
parent_node.children['child_3'] = child3

mcts_task = MCTSTask()

ARGS = {
    'node': parent_node,
    'mcts_task': mcts_task
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Node — a Node output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Node output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_next_steps_roll Ran
ran; our contract draft was wrong, not the code
THUDM/ReST-MCTS/MCTS/mcts.py
pointer only (licence: NONE) · get_code("91b601baaf0d2b44")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, THUDM/ReST-MCTS when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_next_steps_roll Ran
ran; our contract draft was wrong, not the code
DIRECT-BIT/SRA-MCTS/MCTS/mcts.py
code served (permissive licence) · get_code("d48bb511335b496a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class MockMCTSTask:
    def __init__(self, roll_branch=2):
        self.roll_branch = roll_branch
        self.call_count = 0
    
    def get_next_step(self, y, step_n):
        # Return a proposal string on first call, empty on retry attempts
        self.call_count += 1
        if self.call_count % 2 == 1:
            return f"step_proposal_{self.call_count}"
        return ""

mcts_task = MockMCTSTask(roll_branch=3)

ARGS = {
    "y": "initial_state_string",
    "step_n": 5,
    "mcts_task": mcts_task
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gpt_usage Ran
ran; our contract draft was wrong, not the code
thudm/rest-mcts/models/model.py
pointer only (licence: NONE) · get_code("63ea91a630010b0e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, thudm/rest-mcts when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

isTerminal Ran
ran, violated the contract we drafted
THUDM/ReST-MCTS/MCTS/mcts.py
pointer only (licence: NONE) · get_code("04c9e8ce083656fc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, THUDM/ReST-MCTS when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

selectNode Ran
ran; our contract draft was wrong, not the code
THUDM/ReST-MCTS/MCTS/mcts.py
pointer only (licence: NONE) · get_code("88d52f64be6d8180")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, THUDM/ReST-MCTS when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

selectNode Ran
ran; our contract draft was wrong, not the code
DIRECT-BIT/SRA-MCTS/MCTS/mcts.py
code served (permissive licence) · get_code("3e9b96d2d986aaae")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math
import random

class MCTSNode:
    def __init__(self, value=0.0, num_visits=1, is_fully_expanded=False):
        self.V = value
        self.numVisits = num_visits
        self.isFullyExpanded = is_fully_expanded
        self.children = {}
        self.final_ans_flag = 0

class MCTSTask:
    def __init__(self):
        self.low = -float('inf')
        self.exploration_constant = 1.414
        self.INF = float('inf')
        self.reward_model_type = 'vm'
        self.end_gate = 10.0

# Create root node with some children
root_node = MCTSNode(value=5.0, num_visits=10, is_fully_expanded=True)

# Add child nodes
child1 = MCTSNode(value=7.0, num_visits=5, is_fully_expanded=False)
child2 = MCTSNode(value=6.0, num_visits=3, is_fully_expanded=False)
child3 = MCTSNode(value=8.0, num_visits=2, is_fully_expanded=False)

root_node.children['a'] = child1
root_node.children['b'] = child2
root_node.children['c'] = child3

# Create MCTS task
mcts_task = MCTSTask()

ARGS = {
    'node': root_node,
    'mcts_task': mcts_task
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
treeNode Ran
ran on a synthesized input · constructed an object; no result was computed
THUDM/ReST-MCTS/MCTS/mcts.py
pointer only (licence: NONE) · get_code("ca2e487758bc8d8b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, THUDM/ReST-MCTS when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

MCTS_search Not yet run
unverified (harvested, no recorded run)
THUDM/ReST-MCTS/MCTS/mcts.py
pointer only (licence: NONE) · get_code("9c7f89c86df49382")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, THUDM/ReST-MCTS when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

MCTS_search Not yet run
unverified (harvested, no recorded run)
DIRECT-BIT/SRA-MCTS/MCTS/mcts.py
code served (permissive licence) · get_code("e819d89ad4828066")
How it ran

no invocation recorded.

back_propagate Not yet run
unverified (harvested, no recorded run)
THUDM/ReST-MCTS/MCTS/mcts.py
pointer only (licence: NONE) · get_code("15d94bcdfc2d9d1b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, THUDM/ReST-MCTS when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

executeRound Not yet run
unverified (harvested, no recorded run)
THUDM/ReST-MCTS/MCTS/mcts.py
pointer only (licence: NONE) · get_code("68319c1da6a20dbd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, THUDM/ReST-MCTS when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

executeRound Not yet run
unverified (harvested, no recorded run)
DIRECT-BIT/SRA-MCTS/MCTS/mcts.py
code served (permissive licence) · get_code("0f8338c98de6cd72")
How it ran

no invocation recorded.

expand Not yet run
unverified (harvested, no recorded run)
THUDM/ReST-MCTS/MCTS/mcts.py
pointer only (licence: NONE) · get_code("972b9f317f5321f0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, THUDM/ReST-MCTS when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

expand Not yet run
unverified (harvested, no recorded run)
DIRECT-BIT/SRA-MCTS/MCTS/mcts.py
code served (permissive licence) · get_code("152f75c9b44ec04e")
How it ran

no invocation recorded.

get_next_steps_expand Not yet run
unverified (harvested, no recorded run)
THUDM/ReST-MCTS/MCTS/mcts.py
pointer only (licence: NONE) · get_code("4fd1ea2325d783a5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, THUDM/ReST-MCTS when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_next_steps_expand Not yet run
unverified (harvested, no recorded run)
DIRECT-BIT/SRA-MCTS/MCTS/mcts.py
code served (permissive licence) · get_code("a6cb18e8066512b4")
How it ran

no invocation recorded.

greedyPolicy Not yet run
unverified (harvested, no recorded run)
THUDM/ReST-MCTS/MCTS/mcts.py
pointer only (licence: NONE) · get_code("921b11d38034e3e8")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, THUDM/ReST-MCTS when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

greedyPolicy Not yet run
unverified (harvested, no recorded run)
DIRECT-BIT/SRA-MCTS/MCTS/mcts.py
code served (permissive licence) · get_code("5eb7f8be714f63db")
How it ran

no invocation recorded.

randomPolicy Not yet run
unverified (harvested, no recorded run)
THUDM/ReST-MCTS/MCTS/mcts.py
pointer only (licence: NONE) · get_code("f2cd3cffcc558e0c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, THUDM/ReST-MCTS when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

randomPolicy Not yet run
unverified (harvested, no recorded run)
DIRECT-BIT/SRA-MCTS/MCTS/mcts.py
code served (permissive licence) · get_code("735d77158ce66113")
How it ran

no invocation recorded.

Also present in other papers' code

Of 22 samples lifted from this paper's linked repositories, 22 carry a function identity and 0 do not. Of the 19 distinct functions with an identity, 12 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 12 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
get_next_steps_roll
brick of this paper's assembly: helper
3 other papers
3 later · 2 only as an assembly brick
2412.09078 (2024-12)
Forest-of-Thought: Scaling Test-Time Compute for Enhancing LLM Reasoning
2502.13383 (2025-02)
MM-Verify: Enhancing Multimodal Reasoning with Chain-of-Thought Verification
2503.22165 (2025-03)
Landscape of Thoughts: Visualizing the Reasoning Process of Large Language Models
back_propagate
brick of this paper's assembly: update_rule
2 other papers
2 later · 2 only as an assembly brick
2502.13383 (2025-02)
MM-Verify: Enhancing Multimodal Reasoning with Chain-of-Thought Verification
2503.22165 (2025-03)
Landscape of Thoughts: Visualizing the Reasoning Process of Large Language Models
getBestChild
brick of this paper's assembly: helper
2 other papers
2 later · 2 only as an assembly brick
2502.13383 (2025-02)
MM-Verify: Enhancing Multimodal Reasoning with Chain-of-Thought Verification
2503.22165 (2025-03)
Landscape of Thoughts: Visualizing the Reasoning Process of Large Language Models
get_next_steps_expand
brick of this paper's assembly: helper
2 other papers
2 later · 2 only as an assembly brick
2502.13383 (2025-02)
MM-Verify: Enhancing Multimodal Reasoning with Chain-of-Thought Verification
2503.22165 (2025-03)
Landscape of Thoughts: Visualizing the Reasoning Process of Large Language Models
greedyPolicy
brick of this paper's assembly: sampler
2 other papers
2 later · 2 only as an assembly brick
2502.13383 (2025-02)
MM-Verify: Enhancing Multimodal Reasoning with Chain-of-Thought Verification
2503.22165 (2025-03)
Landscape of Thoughts: Visualizing the Reasoning Process of Large Language Models
isTerminal
brick of this paper's assembly: helper
2 other papers
2 later · 2 only as an assembly brick
2502.13383 (2025-02)
MM-Verify: Enhancing Multimodal Reasoning with Chain-of-Thought Verification
2503.22165 (2025-03)
Landscape of Thoughts: Visualizing the Reasoning Process of Large Language Models
randomPolicy
brick of this paper's assembly: sampler
2 other papers
2 later · 2 only as an assembly brick
2502.13383 (2025-02)
MM-Verify: Enhancing Multimodal Reasoning with Chain-of-Thought Verification
2503.22165 (2025-03)
Landscape of Thoughts: Visualizing the Reasoning Process of Large Language Models
selectNode
brick of this paper's assembly: sampler
2 other papers
2 later · 2 only as an assembly brick
2502.13383 (2025-02)
MM-Verify: Enhancing Multimodal Reasoning with Chain-of-Thought Verification
2503.22165 (2025-03)
Landscape of Thoughts: Visualizing the Reasoning Process of Large Language Models
treeNode
brick of this paper's assembly: helper
2 other papers
2 later · 2 only as an assembly brick
2502.13383 (2025-02)
MM-Verify: Enhancing Multimodal Reasoning with Chain-of-Thought Verification
2503.22165 (2025-03)
Landscape of Thoughts: Visualizing the Reasoning Process of Large Language Models
MCTS_search
brick of this paper's assembly: entry
1 other paper
1 later
2502.13383 (2025-02)
MM-Verify: Enhancing Multimodal Reasoning with Chain-of-Thought Verification
executeRound
brick of this paper's assembly: helper
1 other paper
1 later
2502.13383 (2025-02)
MM-Verify: Enhancing Multimodal Reasoning with Chain-of-Thought Verification
expand
brick of this paper's assembly: sampler
1 other paper
1 later · 1 only as an assembly brick
2503.22165 (2025-03)
Landscape of Thoughts: Visualizing the Reasoning Process of Large Language Models

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Recent methodologies in LLM self-training mostly rely on LLM generating responses and filtering those with correct output answers as training data. This approach often yields a low-quality fine-tuning training set (e.g., incorrect plans or intermediate reasoning). In this paper, we develop a reinforced self-training approach, called ReST-MCTS * , based on integrating process reward guidance with tree search MCTS * for collecting higher-quality reasoning traces as well as per-step value to train policy and reward models. ReST-MCTS * circumvents the per-step manual annotation typically used to train process rewards by tree-search-based reinforcement learning: Given oracle final correct answers, ReST-MCTS * is able to infer the correct process rewards by estimating the probability this step can help lead to the correct answer. These inferred rewards serve dual purposes: they act as value targets for further refining the process reward model and also facilitate the selection of high-quality traces for policy model self-training. We first show that the treesearch policy in ReST-MCTS * achieves higher accuracy compared with prior LLM reasoning baselines such as Best-of-N and Tree-of-Thought, within the same search budget. We then show that by using traces searched by this tree-search policy as training data, we can continuously enhance the three language models for multiple iterations, and outperform other self-training algorithms such as ReST EM and Self-Rewarding LM. We release all code at https://github.com/THUDM/ReST-MCTS. * Equal contribution. † Work done while DZ visited at Caltech. 38th Conference on Neural Information Processing Systems (NeurIPS 2024).

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2406.03816")
get_code_for_paper("2406.03816")
have("2406.03816")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2406.03816.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2406.03816.svg)](https://syntology.ai/paper/2406.03816)

Connect an agent — have() is free.