arXiv:2611.02706cs.LGNov 2026

Manuscript Offprint

arXiv:2611.02706

Hindsight Credit Assignment over Trees for Agentic RL

Penghong Zhao, Yihao Chen, Maoheng Yuan, Yunjian Zhang, Abudukelimu Wuerkaixi, Haoran Xu, Man Lv, Yaolong Wang, Zhijie Sun, Guohua Liu, Yuewei Zhang

Abstract

Reinforcement learning for long-horizon LLM agents faces a fundamental dilemma: successful experiences are essential for policy improvement, yet limited policy capabilities make such experiences difficult to discover. Sparse outcome rewards compound this challenge, leaving sampled trajectories with little relative feedback for learning. In this paper, we propose TriGRPO, a tree-based reinforcement learning framework that turns scarce successes into exploration and learning signals through hindsight credit assignment within and across rollout trees. TriGRPO constructs rollout trees through hindsight-guided branching: when an ongoing trajectory reaches a matched decision state, a successful action discovered during rollout initiates a sibling branch that continues autonomously, enabling further exploration and parent-sibling comparisons. Three complementary groups organize policy optimization over these trees: root groups capture within-prompt relative returns, node groups assign credit from parent-sibling outcome differences, and cross groups supplement sparse feedback with historical performance on related tasks. Experimental results demonstrate consistent gains in task performance and rollout efficiency across model scales, highlighting structured hindsight credit assignment as an effective approach to long-horizon agent learning.

1 Introduction

Large language models (LLMs) increasingly act as agents that sustain progress through sequential decisions and environmental feedback. Reinforcement learning (RL) improves these capabilities from interaction outcomes (Wang et al., 2026a; Zhang et al., 2026; Yang et al., 2026), but must turn behaviors discovered during exploration into reliable strategies for independent task solving.

*Equal contribution. †Corresponding author.

Figure

(b)

Figure 1: TriGRPO enhances agentic RL through hindsight credit assignment. (a) Credit assignment across trees, within a tree, and at branch nodes. (b) Superior Pareto frontier of success versus cost.

Existing approaches compare sampled trajectories: GRPO (Shao et al., 2024) uses within-group returns without a learned critic, while GSPO (Zheng et al., 2025) refines sequence-level optimization. For multi-turn agents, GiGPO derives step-level credit from recurring states (Feng et al., 2025), and Tree-GRPO compares prefix-sharing continuations (Ji et al., 2025). CAST uses game-solver values for turn-level supervision (Wang et al., 2026b); PVPO addresses degenerate groups through difficulty filtering and pre-estimated baselines (Feng et al., 2026).

Yet autonomous exploration limits the experi-ence available for learning. Under sparse rewards, failures can dominate sampling without providing within-group relative signals. The policy needs successful experience to improve, yet its limited capability makes that experience difficult to obtain. Occasional successes offer a foothold: repeating useful decisions enables deeper exploration (Oh et al., 2018), while replay supports further updates (Zhan et al., 2026). We seek to make scarce successes guide new interactions, helping other trajectories build on discovered behaviors and learn to complete tasks independently.

We propose TriGRPO (Triple Group Relative Policy Optimization), a unified framework that operationalizes hindsight successes into multi-scale relative optimization. Rather than passive offline replay, TriGRPO exploits discovered successes strictly online along two dimensions: within-tree hindsight branching to actively guide exploration, and across-tree hindsight credit assignment to enrich sparse learning signals. Under exact matching of sufficient decision states, our analysis shows that success-conditioned action replacement yields a nonnegative expected gain in task success probability, motivating state-aligned branching at action disagreements (Figure 1).

TriGRPO structures multi-scale credit assignment around three comparison groups derived from this hindsight mechanism. At the prompt level, standard unguided rollouts form a root group evaluated against within-prompt returns. Within each tree, when an ongoing rollout reaches an observable state previously visited by a completed successful trajectory, a new branch splits off by executing the corresponding hindsight action and continues autonomously, forming a node group; this branched trajectory receives only node credit from parent-sibling outcome differences. Across trees, unguided rollouts reference related tasks' historical performance to form a cross group without generating additional rollouts, receiving cross credit against this historical benchmark. Injected actions are supervised solely with behavior cloning, while autonomous decisions are optimized via reinforcement learning with their corresponding credits. No external demonstrations or preliminary sampling are required. Our contributions are summarized as follows:

  • We establish a theoretical guarantee that success-conditioned action replacement yields nonnegative expected gains, which motivates an online hindsight-branching strategy requiring no offline replay, external demonstrations, or auxiliary sampling overhead.

  • We propose TriGRPO, a unified framework that translates hindsight experience into complementary policy optimization signals across three comparison groups: root groups for within-prompt relative credit, node groups for branch-level credit, and cross groups for historical feedback across related tasks.

  • Extensive experiments demonstrate that TriGRPO improves success rates by up to 6.2% over state-of-the-art baselines while reducing rollout token consumption by up to 39.4%.

References (22)