verl icon indicating copy to clipboard operation
verl copied to clipboard

Pass tool rewards to compute_score

Open zhxieml opened this issue 1 year ago • 1 comments

Feature request

In the tool agent loop, we should expose more trajectory information to the compute_score function. As illustrated in the Gsm8kTool example, tool_reward is returned by execute():

https://github.com/volcengine/verl/blob/c0e2b9d2493509cf3168cf240625b8efba7f1fbb/verl/tools/gsm8k_tool.py#L98

However, it's immediately discarded in ToolAgentLoop._call_tool:

https://github.com/volcengine/verl/blob/c0e2b9d2493509cf3168cf240625b8efba7f1fbb/verl/experimental/agent_loop/tool_agent_loop.py#L419

I believe tool rewards should be passed down to the final compute_score function along with other existing metadata like num_turns.

https://github.com/volcengine/verl/blob/c0e2b9d2493509cf3168cf240625b8efba7f1fbb/recipe/retool/retool.py#L112

Motivation

To provide more fine-grained supervision for agentic RL.

Your contribution

I can submit a PR for this simple fix, but I'm also open to suggestions for better implementation logic!

zhxieml avatar Sep 18 '25 23:09 zhxieml

Can you submit a PR? Thanks!

Maxwell-Jia avatar Sep 19 '25 05:09 Maxwell-Jia