如何训练react类型多轮人机对话(非深度探索的多轮)
对于REACT类型多轮人机对话,同时加载工具调用(”非深度探索”的多轮,自我持续迭代),如何训练,没有找到样例,有样例吗?
实际训练等同拆成多个单轮,只是上下文不同?
In current AgentLoop design, one input prompt has only one output trajectory with multi-turn:
AgentLoopOutput only output one trajectory for a given prompt, multiple trajectories output is still under discussion.
For more complex react agent with reflection, refinement, finalize, ... one input prompt may has multiple output trajectories.
For example, Gemini Fullstack LangGraph Quickstart
For multiple output trajectories, user must calculate reward score for each sub-trajectory in agent loop.
For the multiturn talk with human inside the dialogue, e.g. trun1: user->assistant->tool->assistant, turn2: user->assistant, turn3: user->assistant->tool->assistant .... do i have to split this dialgue into 3 samples to train so that I will have multiple trajectories? sample1: turn1 sample2: turn1 + turn2 sample3: turn1 + turn2 + turn3
is that like this?
We also have some discussion in https://github.com/volcengine/verl/issues/1147
对于REACT类型多轮人机对话,同时加载工具调用(”非深度探索”的多轮,自我持续迭代),如何训练,没有找到样例,有样例吗?
实际训练等同拆成多个单轮,只是上下文不同?
噢!我好像理解错了,你这个场景不是指REACT有多个trajectories输出,而是还是一个trajectory: [user, assistant, tool, assistant, tool, assistant]。这种目前是支持的:
- Gsm8k多轮对话: https://verl.readthedocs.io/en/latest/start/agentic_rl.html
- LangGraph ReAct: https://github.com/volcengine/verl/tree/main/recipe/langgraph_agent/example
这种情况, 每个assistant的输出采样不是都不一样,第一个assitant输出不同,导致第2个assistant上下文变化,感觉就走不下去了。算第2个assistant的时候,就用第一个assitant的ground truth做上下文,还是用采样?这种场景,目前是可以训的?还是我要手工拆成多组对话,当成多个单轮?您给的样例目前支持这种场景?我看着有点像deep research持续迭代那种
sample1: turn1 sample2: turn1 + turn2 sample3: turn1 + turn2 + turn3
gsm8k_multiturn_w_tool.py这个样例我看也是只有一个user和assistant,我指的是这种的:
conversations.append(
{
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"},
{"role": "assistant", "content": "The capital of France is Paris."},
{"role": "user", "content": "And what about Germany?"},
{"role": "assistant", "content": "The capital of Germany is Berlin."},
]
}
)
中间的user turn是从哪输入的呢?
就是多轮对话。有不少数据集不都是好多轮的吗。用户那块儿就是事先写好的对话。比如说用户需要写一段代码,第1轮问完模型回答完可能不太完善,用户第2轮提出进一步改进的方案。
---原始邮件--- 发件人: @.> 发送时间: 2025年7月23日(周三) 晚上10:03 收件人: @.>; 抄送: "Optimus @.@.>; 主题: Re: [volcengine/verl] 如何训练react类型多轮人机对话(非深度探索的多轮) (Issue #2683)
wuxibin89 left a comment (volcengine/verl#2683)
中间的user turn是从哪输入的呢?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
就是多轮对话。有不少数据集不都是好多轮的吗。用户那块儿就是事先写好的对话。比如说用户需要写一段代码,第1轮问完模型回答完可能不太完善,用户第2轮提出进一步改进的方案。 …
RL中一个样本多轮对话rollout的过程是自动的,用户是怎么在rollout过程中介入的?这块我不是很理解。
[system, user, assistant, user, assistant]
^
|
这一轮user是怎么输入的
第2个user是静态的,多轮对话里事先写好的,不与环境交互。算loss的时候,相当先基于system, user算第一个assistant的loss, 第2个assistant是基于[system, user, assistant, user来算。SFT流程,就是把system、user都mask掉,算全部assitant的loss。也就不需要我手动拆成多个单轮对话。
但强化学习流程,涉及到GRPO后续采样存在多个输出,如果说我在第一个assistant用采样结果,没有用groud truth,那就导致上下文变了,第2个assitant就要基于新的上下文输出。所以我想到的,就是把多轮对话拆成多个单轮对话来训,但这样又显得太冗余。需要手工拆解吗,还是当前代码有什么特别的处理方法,可以直接训这种多轮?
就是多轮对话。有不少数据集不都是好多轮的吗。用户那块儿就是事先写好的对话。比如说用户需要写一段代码,第1轮问完模型回答完可能不太完善,用户第2轮提出进一步改进的方案。 …
RL中一个样本多轮对话rollout的过程是自动的,用户是怎么在rollout过程中介入的?这块我不是很理解。
[system, user, assistant, user, assistant] ^ | 这一轮user是怎么输入的
请问如果这里的user回复是实时生成的,例如使用另一个LLM和agent进行实时的交互,现有的代码有办法实现训练吗?
第2个user是静态的,多轮对话里事先写好的,不与环境交互。算loss的时候,相当先基于system, user算第一个assistant的loss, 第2个assistant是基于[system, user, assistant, user来算。SFT流程,就是把system、user都mask掉,算全部assitant的loss。也就不需要我手动拆成多个单轮对话。
但强化学习流程,涉及到GRPO后续采样存在多个输出,如果说我在第一个assistant用采样结果,没有用groud truth,那就导致上下文变了,第2个assitant就要基于新的上下文输出。所以我想到的,就是把多轮对话拆成多个单轮对话来训,但这样又显得太冗余。需要手工拆解吗,还是当前代码有什么特别的处理方法,可以直接训这种多轮?
我也有同样的疑惑,请问大佬有解决思路了吗
就是多轮对话。有不少数据集不都是好多轮的吗。用户那块儿就是事先写好的对话。比如说用户需要写一段代码,第1轮问完模型回答完可能不太完善,用户第2轮提出进一步改进的方案。 …
RL中一个样本多轮对话rollout的过程是自动的,用户是怎么在rollout过程中介入的?这块我不是很理解。
[system, user, assistant, user, assistant] ^ | 这一轮user是怎么输入的请问如果这里的user回复是实时生成的,例如使用另一个LLM和agent进行实时的交互,现有的代码有办法实现训练吗?
我也想问,这种human/LLM in loop 能用Verl训练吗
我也想问,我理解react in loop是不是跟anthropics做的agent in loop做法差不多,只是把tool的步骤改成human,然后不mask
同问,请问大佬们有方案了吗?尤其是如果assistant的输出是COT或者json的结果
我也想问,其实就是把SFT的多轮对话中,只计算并回传assitant的回答loss一样;把这一套搬到RL上,不知道是否可行。还是说是需要拆为两个sample ,做成 sample1: turn1 sample2: turn1 + turn2 的形式呢?
中文
定时清理检查发现:此 issue 最近一次非当前运行账号的公开回复或引用时间是 2025-12-19T12:52:52Z(comment,来自 AdvancingEther),相对于本轮运行日期 2026-07-12 已超过 6 个月。因此按社区 issue 定时清理标准关闭。
已检查证据:Latest non-self public reply/reference: 2025-12-19T12:52:52Z (comment by AdvancingEther).
Comments API: https://api.github.com/repos/verl-project/verl/issues/2683/comments
Timeline API: https://api.github.com/repos/verl-project/verl/issues/2683/timeline
如果作者或社区成员仍能提供新的复现、证据或需求背景,请在此 issue 下继续评论请求重开,或创建新的 issue 并链接到这里。
English
Scheduled cleanup check found that the latest public reply or reference by an account other than the current automation account was 2025-12-19T12:52:52Z (comment by AdvancingEther), which is more than 6 months before this run date 2026-07-12. Therefore this issue is being closed under the scheduled stale-issue cleanup rule.
Evidence checked: Latest non-self public reply/reference: 2025-12-19T12:52:52Z (comment by AdvancingEther).
Comments API: https://api.github.com/repos/verl-project/verl/issues/2683/comments
Timeline API: https://api.github.com/repos/verl-project/verl/issues/2683/timeline
If the author or community members can still provide a fresh reproduction, evidence, or requirement context, please comment here to request reopening, or open a new issue and link back to this one.
This response was generated by a scheduled Codex GPT5.5 issue processing task.