Agent-R1 icon indicating copy to clipboard operation
Agent-R1 copied to clipboard

max_prompt_length,max_response_length,max_response_length_single_turn和tool.max_tool_response_length这几个参数分别表示什么作用呢,我在训练时应该如何设置这几个参数

Open myjpgit opened this issue 1 year ago • 3 comments

myjpgit avatar Jun 09 '25 12:06 myjpgit

also curious why max_response_length_single_turn is not used in the training code

ccclyu avatar Jun 11 '25 23:06 ccclyu

以一个简单的多轮工具调用为例,假设生成的完整样本为:[system, user, assistant1, tool1, assistant2, tool2, assistant3]

要求:

  • [system, user, assistant1, tool1, assistant2, tool2] 的总 token 数不大于 max_prompt_length
  • [assistant1, tool1, assistant2, tool2, assistant3] 的总 token 数不大于 max_response_length
  • [assistant1], [assistant2], [assistant3] 的 token 数均不大于 max_response_length_single_turn
  • [tool1],[tool2] 的字符数均不大于 max_tool_response_length

PS: max_response_length_single_turn没有显式的在训练代码中被使用,而是作为vllm/sglang的参数之一限制模型每一轮的输出长度。

0russwest0 avatar Jun 24 '25 14:06 0russwest0

[system, user, assistant1, tool1, assistant2, tool2] 的总 token 数不大于 max_prompt_length 这个过长,有没有处理方法。除了提高max_prompt_length

jzl20 avatar Jul 31 '26 07:07 jzl20