通过复用历史轨迹经验,减少大模型工作流生成的冗余开销。
WorkflowGen:an adaptive workflow generation mechanism driven by trajectory experience
- 基于执行轨迹提取可复用知识,仅重写变动节点。
- 相比实时规划降低40%以上令牌消耗,中等相似度查询成功率提升20%。
- 适合需要高效、稳定且可解释工作流的业务自动化场景。
大型语言模型代理在处理业务查询、工具调用和工作流编排等复杂任务时,常面临高推理开销、过度令牌消耗、执行不稳定及无法复用过往经验的问题。传统方法对每个查询都从头生成工作流,导致成本高、响应慢、鲁棒性差。我们提出 WorkflowGen,一种由轨迹经验驱动的自适应工作流生成框架,能有效降低令牌使用量并提升效率与成功率。早期执行中,WorkflowGen捕获完整轨迹,提取节点与工作流层级的可复用知识,包括错误指纹、最优工具映射、参数模式、执行路径和异常规避策略。随后通过闭环机制,仅对变量节点进行轻量级生成,结合轨迹重写、经验更新与模板归纳。采用三层自适应路由策略,根据语义相似度动态选择直接复用、重写生成或全初始化。无需大规模标注数据,定性对比显示:相比实时规划,令牌消耗降低超40%;在中等相似度查询上,通过主动避错与自适应回退,成功率提升20%;并通过模块化、可追溯的经验实现跨场景适应性,显著增强可部署性。WorkflowGen在效率、鲁棒性与可解释性间取得实用平衡,解决了现有方法的关键局限。
原文摘要 · Abstract (English)
Large language model (LLM) agents often suffer from high reasoning overhead, excessive token consumption, unstable execution, and inability to reuse past experiences in complex tasks like business queries, tool use, and workflow orchestration. Traditional methods generate workflows from scratch for every query, leading to high cost, slow response, and poor robustness. We propose WorkflowGen, an adaptive, trajectory experience-driven framework for automatic workflow generation that reduces token usage and improves efficiency and success rate. Early in execution, WorkflowGen captures full trajectories and extracts reusable knowledge at both node and workflow levels, including error fingerprints, optimal tool mappings, parameter schemas, execution paths, and exception-avoidance strategies. It then employs a closed-loop mechanism that performs lightweight generation only on variable nodes via trajectory rewriting, experience updating, and template induction. A three-tier adaptive routing strategy dynamically selects among direct reuse, rewriting-based generation, and full initialization based on semantic similarity to historical queries. Without large annotated datasets, we qualitatively compare WorkflowGen against real-time planning, static single trajectory, and basic in-context learning baselines. Our method reduces token consumption by over 40 percent compared to real-time planning, improves success rate by 20 percent on medium-similarity queries through proactive error avoidance and adaptive fallback, and enhances deployability via modular, traceable experiences and cross-scenario adaptability. WorkflowGen achieves a practical balance of efficiency, robustness, and interpretability, addressing key limitations of existing approaches.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。