让智能体在执行中实时优化规划,提升复杂任务的完成率。
In-the-Flow Agentic System Optimization for Effective Planning and Tool Use
- 用四个模块协同工作,通过动态记忆实时训练规划器。
- 在十项任务中平均准确率提升14.9%,超越GPT-4o等大模型。
- 适合需要持续优化、多步推理的自动化系统研发者。
以结果为导向的强化学习推动了大语言模型的推理能力发展,但现有工具增强方法通常采用单一、整体化的策略,在完整上下文中交织思考与工具调用,难以应对长时序和多样化工具,且泛化能力弱。智能体系统通过将任务分解到专业化模块提供新思路,但多数仍为无训练或离线训练,脱离实时多轮交互动态。本文提出AgentFlow,一个可训练的、在执行流程中进行优化的智能体框架,通过演化记忆协调规划、执行、验证和生成四个模块,并在多轮对话中直接优化规划器。为实现在线策略训练,提出基于流的分组精炼策略优化(Flow-GRPO),将长时序稀疏奖励的信用分配问题转化为一系列可处理的单轮更新,通过广播全局可验证轨迹结果对齐每一轮的决策,利用组归一化优势稳定学习过程。在十项基准测试中,采用70亿参数主干模型的AgentFlow,在搜索、智能体、数学和科学任务上平均准确率分别提升14.9%、14.0%、14.5%和4.1%,甚至超过更大规模的专有模型如GPT-4o。进一步分析证实,在流优化带来的规划改进、工具调用可靠性提升及模型规模与推理轮次的正向扩展效应。
原文摘要 · Abstract (English)
Outcome-driven reinforcement learning has advanced reasoning in large language models (LLMs), but prevailing tool-augmented approaches train a single, monolithic policy that interleaves thoughts and tool calls under full context; this scales poorly with long horizons and diverse tools and generalizes weakly to new scenarios. Agentic systems offer a promising alternative by decomposing work across specialized modules, yet most remain training-free or rely on offline training decoupled from the live dynamics of multi-turn interaction. We introduce AgentFlow, a trainable, in-the-flow agentic framework that coordinates four modules (planner, executor, verifier, generator) through an evolving memory and directly optimizes its planner inside the multi-turn loop. To train on-policy in live environments, we propose Flow-based Group Refined Policy Optimization (Flow-GRPO), which tackles long-horizon, sparse-reward credit assignment by converting multi-turn optimization into a sequence of tractable single-turn policy updates. It broadcasts a single, verifiable trajectory-level outcome to every turn to align local planner decisions with global success and stabilizes learning with group-normalized advantages. Across ten benchmarks, AgentFlow with a 7B-scale backbone outperforms top-performing baselines with average accuracy gains of 14.9% on search, 14.0% on agentic, 14.5% on mathematical, and 4.1% on scientific tasks, even surpassing larger proprietary models like GPT-4o. Further analyses confirm the benefits of in-the-flow optimization, showing improved planning, enhanced tool-calling reliability, and positive scaling with model size and reasoning turns.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。