FlashScript:将重复的智能体工作流编译为可复用的神经符号程序
FlashScript: Compiling Recurring Agent Workflows into Reusable Neuro-Symbolic Programs
AI总结:
该研究提出FlashScript方法,将智能体重复工作流编译为神经符号程序(NSP),经实验验证其在120个分析任务中准确率高、一致性强,且泛化性能优异。
摘要:
许多智能体任务会随新数据或微小变化重复出现,但智能体每次运行都会重新生成推理和动作,产生不同结果。将之前的运行提炼为技能可帮助智能体避免早期错误,但每次仍会重新运行完整流程,导致运行结果存在差异并产生相应成本。我们通过一套称为FlashScript的指南,将成功的智能体运行编译为可复用的神经符号程序(NSP)。动作和数据转换成为代码,特定实例的值成为参数,需要模型判断的决策成为大语言模型(LLM)调用。我们确定了这些调用所属的三个层级,以及用代码替代大部分调用的三种技术。编译不会消除不确定性,而是将其局部化,因此确定性程序及其神经调用可分别进行审查和测试。在使用Claude Haiku 4.5的120个WorkBench分析任务中,NSP每次运行均正确且生成相同的工具调用,输入令牌用量约为技能引导智能体的1/70,运行时间为其1/3,而技能引导智能体的运行结果不一致。在任务的复合版本中,技能引导智能体的准确率降至23%,输出不一致性增加,而NSP在所有运行中仍保持正确且一致。NSP成功泛化到相同模板的全部108个未见实例。我们的研究结果表明,来自智能体轨迹的NSP可被视为供终端用户在重复工作流中测试、维护和复用的累积软件资产。
英文摘要:
Many agent tasks recur with new data or small changes, yet agents regenerate their reasoning and actions on each run, producing different results. Distilling a prior run into a skill helps the agent avoid earlier mistakes, but it still re-runs the full process each time, so runs can vary and incur that cost. We compile a successful agent run into a reusable neuro-symbolic program (NSP) with a set of guidelines we call FlashScript. Actions and data transformations become code, instance-specific values become parameters, and decisions that need model judgment become LLM calls. We identify three layers where these calls belong and three techniques that replace most of them with code. The compilation does not remove nondeterminism; it localizes it, so the deterministic program and its neural calls can be reviewed and tested separately. Across 120 WorkBench analytics tasks with Claude Haiku 4.5, the NSPs were correct and made identical tool calls on every run, using about 70 times fewer input tokens and a third of the runtime of a skill-guided agent whose runs were inconsistent. In a composite version of the tasks, the skill-guided agent's accuracy fell to 23%, and its output inconsistency increased, while the NSPs remained correct and identical across all runs. The NSPs successfully generalized to all 108 unseen instances of the same templates. Our findings suggest that NSPs from agent trajectories can be considered cumulative software assets for end-users to test, maintain, and reuse in their recurring workflows.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。