On this page
TreeRL is work I co-authored on using tree search during reinforcement learning for language models. The central question is: after a model finishes a problem, how can the outcome tell us which earlier reasoning steps were useful?
A common approach generates several complete answers to a question and trains on their outcomes. TreeRL organizes these attempts into a tree. It retains shared prefixes, branches where the model is uncertain, and checks where the different continuations lead.
Where to branch
Some parts of a solution are straightforward for the model; others allow several plausible next steps. With a limited generation budget, the choice of where to explore matters.
TreeRL uses a sampling method called EPTree. It measures uncertainty with the entropy of the model's token distribution, selects uncertain positions in existing reasoning paths, and generates new continuations to a final answer. The branches retain their shared prefix, allowing more of the generation budget to be spent exploring what follows it.
This uncertainty is a signal from the model. It identifies a position where another continuation may be worth trying; it does not establish that the original step is wrong. The final answers still need to be checked.
Feedback for each step
Paths in a tree share parts of their reasoning. Once their final answers have been checked, the outcomes of continuations through a particular step provide evidence about that step.
The paper combines two advantage signals. A global advantage compares the step's potential with the overall performance on the question. A local advantage compares it with its parent in the tree. Their definitions and combination are described in Section 3.2.
These signals come directly from the generated tree and the checked answers. The method therefore does not require a separately trained process reward model. It still needs a task environment or verifier that can check final outcomes.
On-policy training
On-policy samples come from the policy currently being trained. As that policy changes, the updated model generates new trees. This keeps the explored reasoning paths tied to the model's current behavior.
The training method can be read through three practical questions:
| Question | TreeRL's approach |
|---|---|
| Where should another solution path begin? | Branch at token positions where the model is uncertain. |
| How do we assess the attempts? | Check final answers and use the tree structure to compare intermediate steps. |
| Where does the training signal come from? | From trees generated by the current policy and their outcomes. |
The paper compares TreeRL with ChainRL on mathematical and code-reasoning tasks. When reading those comparisons, check the base model, sampling budget, and answer-verification setup together. The experimental settings and results are in Section 4.
Code and experiments
- Project README: the method, experiments, and main implementation entry points.
- EPTree sampler: tree sampling and branch management.
- Training
scripts: the supplied training configurations, used with the
implementation under
openrlhf.
I am Rui Lu (鲁睿), a co-first author of TreeRL and a Ph.D. student at Tsinghua University's KEG Lab. For related work, DeepDive explains multi-turn reinforcement learning for search, while AgentTuning explains how agent training can start from interaction demonstrations. More projects are on my homepage.