RewardFlow: Can Action-Level Reward Be Estimated from State-Graph Topology in Agentic RL?

Xiao Feng, Bo Han, Zhanke Zhou, Jiaqi Fan, Jiangchao Yao, Ka Ho Li, Dahai Yu, Michael NgNeurIPS 2026

TL;DR

When training LLM agents via reinforcement learning, judging an entire multi-step attempt solely by whether it succeeded at the very end penalizes smart early moves in failed runs and rewards clumsy detours in successful ones. RewardFlow solves this by weaving separate attempts at the same task into a shared map—a state graph—and letting reward "flow" backward from winning endpoints. Without needing expensive human labels or separate judge models, agents learn exactly which individual actions move the needle.

What Problem Does This Paper Address?

Imagine an AI shopping assistant tasked with buying a specific pair of running shoes. It navigates the search bar brilliantly, filters by size, finds the exact shoe—and then clicks "Cancel" instead of "Buy." In standard reinforcement learning (RL), the agent gets a big fat zero at the end of this trajectory (sequence of actions). Because the final outcome failed, standard algorithms like GRPO treat every step along the way as a mistake, discouraging the brilliant search skills right alongside the fatal final click. Conversely, if an agent wanders aimlessly through twenty wrong menus before accidentally stumbling onto the "Buy" button, every detour gets reinforced.

This is the classic credit-assignment problem: figuring out which specific actions deserve praise or blame when feedback only arrives at the finish line.

Existing workarounds have headaches of their own. Training a separate Process Reward Model (PRM) to grade every step requires heavy compute and is notorious for "reward hacking" (where the agent learns to trick the grader rather than solve the task). Meanwhile, methods like GiGPO compare actions across attempts, but still judge each action only by how its own trajectory ended. The authors ask: What if we pool all the agent's attempts together to map out the environment, and deduce step-by-step rewards purely from the geometry of that map?

Methods

RewardFlow builds on standard group-based RL (where an agent tries the same task $G$ times per training step), introducing a clever graph-based middle layer before updating the model via a standard clipped PPO objective.

Figure 2: From trajectory outcomes to graph-derived action rewards. Given sampled trajectories (a), GRPO (b) uses terminal rewards, PRMs (c) score actions, and GiGPO (d) compares trajectory- local returns at shared states. RewardFlow (e) connects observed transitions into a graph that partially captures the environment’s transition structure (f). Shared states link actions to successful continuations from other trajectories. Graph distances to success define potentials, whose differences yield action rewards. Right: Action and terminal rewards yield action- and trajectory-level advantages. The index j identifies action occurrences at graph node ˆs.

Here is how the pipeline works:

  1. Stitching Trajectories into a State Graph: Across multiple attempts at a task, agents frequently visit the exact same situations—like standing at the same desk or viewing the same product page. RewardFlow groups equivalent (or semantically similar, via text embeddings) states into single nodes and connects them using the valid actions the agent took. Suddenly, isolated attempts merge into a directed graph. If Trajectory A finds the right shoe and fails, while Trajectory B stumbles onto that same shoe page and buys it, the graph links Trajectory A's smart search directly to Trajectory B's victory.
  2. Propagating State Potentials: Any terminal state where the task succeeded gets a value (or potential) of $1$. Using a fast reverse breadth-first search (BFS), this signal propagates backward through the graph, decaying by a factor $\gamma \in (0,1)$ with each hop along the shortest path to success. Closer to victory means higher potential.
  3. Action Rewards as Potential Differences: Every valid action's reward is simply the potential of the state it lands in minus the potential of the state it left ($\tilde{r}_t = \phi_{t+1} - \phi_t$). Actions that step closer to success get positive rewards; detours that step away get penalized.
  4. Complementary Advantages: RewardFlow normalizes these action rewards among all actions taken from the same node to get an action-level advantage, and adds it to the standard trajectory-level advantage (from final pass/fail outcomes).

Datasets

The authors evaluate existing benchmarks spanning four distinct domains (no new datasets are introduced):

  • ALFWorld: Text-based household tasks (including an out-of-distribution split featuring unseen room layouts).
  • WebShop: Simulated online shopping requiring search and option selection.
  • Sokoban: Visual grid-world box-pushing puzzles (evaluating vision-language models).
  • Retrieval-based Search QA: Trained on NQ and HotpotQA, and tested both in-distribution and out-of-distribution on TriviaQA, PopQA, 2Wiki, Musique, and Bamboogle.

Key Insights and Ideas

  • Cross-trajectory rescue: Because paths merge at shared states, a good action trapped inside a failed attempt is "rescued" if any other attempt figures out how to win from that shared state onward.
  • Shortest-path beats averaging: When propagating rewards backward through the graph, taking the shortest path (via BFS) dramatically outperforms averaging paths or using Personalized PageRank—especially in puzzles like Sokoban (49.5% success vs. 33.6% for mean aggregation), where one optimal route matters far more than five clumsy loops.
  • Micro and macro signals need each other: Using only graph-derived action advantages tanks performance on ALFWorld (7.0% success), while trajectory outcomes alone hit 59.4%. Combining them jumps to 75.5%—local step guidance keeps the agent on track, while global outcome supervision ensures it actually crosses the finish line.
  • Skipping external PRMs works better: Off-the-shelf 7B–8B Process Reward Models actually hurt GRPO training on ALFWorld due to out-of-distribution scoring errors, whereas RewardFlow's parameter-free graph math boosts it significantly.

Key Results

Across Qwen2.5 (1.5B, 3B, 7B) and Qwen2.5-VL (3B, 7B) models, RewardFlow consistently outperforms RLOO, GRPO, and GiGPO.

Figure 1: RewardFlow improves agent learning. (a) Averaged across evaluated model scales, RewardFlow achieves higher success rates on ALFWorld, WebShop, and Sokoban and higher search accuracy than the RL baselines. (b) On ALFWorld, Qwen2.5-1.5B trained with RewardFlow achieves a 62.8% success rate, compared with 50.0% for GRPO and 48.4% for GRPO with Selene-8B, the strongest evaluated PRM baseline. (c) Graph construction and reward estimation take 1.47-2.39 s per training step, using Qwen2.5-3B on ALFWorld and WebShop and Qwen2.5-VL-3B on Sokoban.
  • Big leaps on puzzles and tasks: Averaged across model scales, RewardFlow beats GiGPO by 6.2% absolute success rate on ALFWorld and WebShop combined, and by a massive 29.7% on visual Sokoban (e.g., jumping from 37.8% to 67.4% at 7B).
  • Search & Generalization: On search benchmarks, it improves average accuracy over GiGPO by 2.2% (3B) and 1.9% (7B), despite relying on approximate cosine-similarity matching to group varied search passages. On unseen ALFWorld rooms at 1.5B, it hits 66.1% success compared to GiGPO's 46.9%.
  • Virtually free compute: Because graph building and reverse BFS run on CPU without extra neural network calls, RewardFlow adds just 1.47 to 2.39 seconds per training step on 3B models—a tiny fraction of the ~200+ seconds spent sampling and updating weights.

Limitations and Future Work

  • All-failure groups yield no signal: Because potentials are anchored strictly to observed successes, if all $G$ sampled trajectories in a batch fail, every potential is zero and no learning signal is generated for that step.
  • Defining "shared states" in open-ended worlds: In structured games or web pages, matching identical states is straightforward. In open-ended tasks like search or math reasoning, observations rarely match word-for-word, requiring semantic embeddings and similarity thresholds. While preliminary math-reasoning tests look promising, developing more reliable ways to group states across free-form reasoning paths remains a key target for future work.

Summary updated

Abstract

In agentic tasks such as household assistance and web shopping, large language model (LLM) agents take multiple actions before receiving a final outcome indicating success or failure. For reinforcement learning (RL), this outcome obscures individual actions' contributions: a shopping trajectory may find the right product but fail to complete the purchase. To address this credit-assignment problem, we introduce RewardFlow, which connects multiple trajectories for the same task through *shared states* (states grouped by task-relevant equivalence or semantic similarity). The resulting directed *state graph* links observed trajectory segments. Therefore, an action in a failed trajectory may reach a state from which another trajectory succeeds. It propagates reward signals backward from states where the task succeeds, assigning *state potentials* that decrease with shortest-path distance to success in the graph. *Potential differences* then reward actions that reduce this distance, bringing the agent closer to success in the graph. These estimated rewards yield action-level advantages that complement trajectory-level advantages from outcome rewards during policy optimization, without a learned process reward model or manual action-level annotations. Experiments on ALFWorld, WebShop, Sokoban, and search tasks show gains over RL baselines across model scales. With 3B policies, graph construction and reward estimation take $1.47$-$2.39$ seconds per training step on ALFWorld, WebShop, and Sokoban (Fig. 1). Code is available at https://github.com/tmlr-group/RewardFlow.
BibTeX
@inproceedings{feng2026rewardflow,
  author = {Xiao Feng and Bo Han and Zhanke Zhou and Jiaqi Fan and Jiangchao Yao and Ka Ho Li and Dahai Yu and Michael Ng},
  title = {{RewardFlow: Can Action-Level Reward Be Estimated from State-Graph Topology in Agentic RL?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=vgqdqXYwsC},
}
Figure