让大模型技能可执行,自动纠错提升复杂任务表现
Harnessing LLM Agents with Skill Programs

- 将经验转化为可触发的程序函数,动态干预模型决策
- 网页搜索任务性能提升25%~30.4%,优于现有方法
- 适合需要长期规划与自我改进的智能体系统
为大模型智能体赋予可复用的技能已成为解决复杂、长周期任务的有效方法。然而,这些技能通常以文本形式存在,仅提供被动建议,缺乏在何时何地介入的具体机制。为此,我们提出HASP(Harnessing LLM Agents with Skill Programs)框架,将技能升级为可执行的程序函数(PFs)。PFs不再是被动指导,而是在高风险状态自动激活,修改下一步动作或注入纠正性上下文。HASP高度模块化:可在推理时直接干预智能体流程,也可在后训练阶段提供结构化监督,或通过教师审核的验证函数实现自我演化。实证表明,相比无训练与有训练的方法,HASP在网页搜索、数学推理和编程任务上均有显著提升。例如,在网页搜索任务中,仅推理时使用PFs即可使平均性能比多轮ReAct Agent提高25%;后训练与受控演化方法相较Search-R1提升30.4%。机制分析揭示了PFs的触发逻辑、干预方式及技能内化过程,强调稳定技能库演化的必要性。
原文摘要 · Abstract (English)
Equipping LLM agents with reusable skills derived from past experience has become a popular and successful approach for tackling complex and long-horizon tasks. However, such lessons are often encoded as textual guidance that remains largely advisory, lacking explicit mechanisms for when and how to intervene in the agent loop. To bridge the gap, we introduce HASP(Harnessing LLM Agents with Skill Programs), a new framework that upgrades skills into executable Program Functions (PFs). Rather than offering passive advice, PFs act as executable guardrails that activate on failure-prone states and modify the next action or inject corrective context. HASP is highly modular: it can be applied at inference time for direct agent-loop intervention, during post-training to provide structured supervision, or for self-improvement by evolving validated, teacher-reviewed PFs. Empirically, HASP drives substantial gains compared to both training-free and training-based methods on web-search, math reasoning, and coding tasks. For example, on web-search reasoning, inference-time PFs alone improve the average performance by 25% compared to (multi-loop) ReAct Agent, while post-training and controlled evolution achieve a 30.4% gain over Search-R1. To provide deeper insights into HASP, our mechanism analysis reveals how PFs trigger and intervene, how skills are internalized, and the requirement for stable skill library evolution.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。