TreeHCA: Hindsight-Guided Exploration and Credit Assignment for Multi-Turn LLM Agents
Organizations: Department of Electrical and Computer Engineering, Texas A&M University, College Station, Texas, USA
Abstract
Outcome-supervised group-relative policy optimization (GRPO) assigns the same advantage to every token in an LLM agent trajectory, leaving useful and unhelpful decisions undifferentiated. Hindsight credit assignment (HCA) can refine this feedback, but its estimates rely on trajectories containing informative alternatives at consequential histories. We introduce TreeHCA, which couples hindsight-guided exploration with hindsight credit assignment. TreeHCA uses changes in reference-answer likelihood to revisit intermediate histories and sample alternative continuations, forming a tree of reasoning and tool interactions. Because this exploration changes the distribution of sampled continuations, we derive the corresponding inverse-hindsight importance correction, including an exact finite-pool identity. We use this structure in a normalized tree backup that propagates terminal outcomes into turn-level advantages. This shared hindsight structure is TreeHCA's central design principle, linking informative exploration with hindsight-guided credit assignment. Across seven question-answering benchmarks and three Qwen backbones, TreeHCA outperforms all baselines in aggregate exact match, validating the effectiveness of paired exploration and credit assignment for multi-turn LLM agent training. Our code is available at github.com/TheBlackCat22/TreeHCA.
Figures & tables
| Method | Type | Multi-hop QA | Single-hop QA | Avg. | |||||
|---|---|---|---|---|---|---|---|---|---|
| Hotpot | 2Wiki | MuSiQue | Bamb. | NQ | TriviaQA | PopQA | |||
| Backbone: Qwen2.5-3B | |||||||||
| Search-R1 | Chain-based | 32.4 | 31.9 | 10.3 | 26.4 | 34.1 | 54.5 | 37.8 | 37.4 |
| ZeroSearch | Chain-based | 27.4 | 30.0 | 9.8 | 11.1 | 41.4 | 57.4 | 44.8 | 39.1 |
| GiGPO | Chain-based | 36.8 | 36.2 | 12.2 | 29.6 | 43.1 | 60.5 | 46.1 | 43.3 |
| IGPO | Chain-based | 37.5 | 36.4 | 11.8 | 25.6 | 44.9 | 61.8 | 46.5 | 43.6 |
| Method | Type | Multi-hop QA | Single-hop QA | Avg. | |||||
|---|---|---|---|---|---|---|---|---|---|
| Hotpot | 2Wiki | MuSiQue | Bamb. | NQ | TriviaQA | PopQA | |||
| Backbone: Qwen2.5-3B | |||||||||
| Tree-GRPO | Tree-based | 31.1 | 31.7 | 11.9 | 28.0 | 44.5 | 60.4 | 43.7 | 40.8 |
| IGRPO | Tree-based | 38.0 | 39.0 | 14.3 | 29.6 | 45.1 | 60.0 | 45.2 | 43.9 |
| TreeHCA (n=5) | Tree-based | 39.9 | 39.4 | 14.8 | 32.4 | 45.3 | 61.5 | 44.4 | 44.9 |
| Method | Multi-hop QA | Single-hop QA | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Hotpot | 2Wiki | MuSiQue | Bamb. | W. Avg. | NQ | TriviaQA | PopQA | W. Avg. | |
| Backbone: Qwen3-4B | |||||||||
| ReAct | 30.42 | 32.92 | 12.83 | 44.80 | 30.01 | 26.75 | 53.53 | 35.34 | 41.31 |
| GRPO | 44.76 | 51.40 | 21.60 | 50.40 | 46.02 | 45.98 | 65.17 | 49.18 | 54.97 |
| GSPO | 47.07 | 49.25 | 22.68 | 50.40 | 45.69 | 46.01 | 64.24 | 48.50 | 54.28 |
| TreeGRPO | 46.40 | 51.10 | 20.27 | 53.60 | 46.26 | 46.31 | 64.91 | 49.75 | 55.19 |
| Exploration | Credit | EM | F1 |
|---|---|---|---|
| Hindsight | TreeHCA | 51.76 | 65.88 |
| Entropy | TreeHCA | 51.17 | 64.17 |
| Entropy | AT 2 PO | 50.78 | 63.85 |
| Hindsight | AT 2 PO | 49.60 | 62.74 |
| Random | TreeHCA | 49.02 | 61.60 |
| Policy chains | GSPO | 47.46 | 60.76 |
| Backbone | Hotpot | 2Wiki | MuSiQue | Bamb. | W. Avg. |
|---|---|---|---|---|---|
| Qwen3-4B | |||||
| Qwen3-8B |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | Value |
|---|---|
| Policy optimization | |
| Optimizer | AdamW |
| Learning rate | 1e-6 |
| Clip_ratio | 0.2 |
| Training batch size | 64 |
| PPO mini-batch size | 8 |
| Hyperparameter | Value |
|---|---|
| Training | |
| Number of training steps | 200 |
| Exploration threshold | |
| Sequence and interaction limits | |
| Maximum turns | 4 |
| Maximum rollout length | 512 |
| Hyperparameter | Value |
|---|---|
| Reference-answer score smoothing | 0.05 |
| Exploration threshold | |
| Sibling penalty | 0.05 |
| Candidates per selected parent | 2 |
| Model | AT 2 PO | TreeHCA |
|---|---|---|
| Qwen3-4B | 31.50 | 34.40 |
| Qwen3-8B | 32.58 | 36.20 |
| Shared Prefix (identical in both continuations) |
|---|
| Question: Juwan Howard beat what team to win his first NBA Final? |
| Labeled Answer: Oklahoma City Thunder |
| <think> Okay, I need to find out which team Juwan Howard beat to win his first NBA Finals. First, I should confirm who Juwan Howard is. He was an NBA coach, right? Wait, but the question says he beat a team to win his first NBA Final. Hmm, maybe I’m mixing up some details. Let me check. </think> <search> Juwan Howard NBA coach </search> |
| Page 1: “Juwan Howard” Juwan Antonio Howard (born February 7, 1973) is an American former professional basketball player who is an assistant coach for the Miami Heat of the National Basketball Association (NBA). Howard formerly played for the Heat from 2010 until 2013. A one-time All-Star and one-time All-NBA power forward, he began his NBA career as the fifth overall pick in the 1994 NBA draft, selected by the Washington Bullets. |
| Page 2–3: *** Omitted for brevity *** |
| <think> Wait, the search result says Juwan Howard was a player, not a coach. But the original question says he beat a team to win his first NBA Final. Maybe there’s confusion here. Perhaps I should search for “Juwan Howard NBA Finals” to see if he was a coach or player in the Finals. </think> <search> Juwan Howard NBA Finals </search> |
| Unsuccessful Continuation Terminal reward |
|---|
| *** Shared prefix omitted; see Table 10 *** |
| <think> Wait, the first search result says the 2012 NBA Finals were between Miami Heat and the San Antonio Spurs. So, the Heat beat the Spurs. Therefore, the answer is San Antonio Spurs. </think> |
| Juwan Howard won his first NBA championship with the Miami Heat in the 2012 NBA Finals. The team he beat to achieve this victory was the San Antonio Spurs. |
| <answer> The final answer is San Antonio Spurs </answer> |
| Successful Continuation Terminal reward |
|---|
| *** Shared prefix omitted; see Table 10 *** |
| <think> Hmm, the first search result says that in the 2012 NBA Finals, the Miami Heat were in the series, but it doesn’t mention the opponent. The first paragraph says the Heat had previously appeared in 2006 and 2011 against the Mavericks. The Spurs were the team that beat the Heat in the 2014 Finals. So the answer isn’t in the search result. Let me think again. Since Howard was on the Heat team that won the 2012 NBA Finals, but the search result is not clear, maybe I should search for “2012 NBA Finals Miami Heat opponent” directly. </think> <search> 2012 NBA Finals Miami Heat opponent </search> |
| Page 1: “2012 NBA Finals” *** Identical to Page 1 above; omitted for brevity *** |
| Page 2: “2012 NBA Finals” The 2012 NBA Finals was the championship series of the 2011–12 season of the National Basketball Association (NBA), and the conclusion of the season’s playoffs. The Eastern Conference champion Miami Heat defeated the Western Conference champion Oklahoma City Thunder 4 games to 1 to win their second NBA title. Heat Small forward LeBron James was named the Finals MVP. |
| Page 3: “2011–12 Miami Heat season” …On June 21, the Miami Heat won the NBA Championship at home against the Oklahoma City Thunder, |
| <think> Wait, according to this, the Miami Heat defeated the Oklahoma City Thunder in the 2012 NBA Finals. So, the answer would be the Oklahoma City Thunder. But let me check again. From the last search result, the 2012 NBA Finals were between the Miami Heat and the Oklahoma City Thunder. So, the team Juwan Howard beat was the Oklahoma City Thunder. </think> |
LLM Agent Training
Large language model agent training teaches models to plan, use tools, and learn from multi-step interaction with environments.
See all 586 papers