让大模型技能可编程,提升执行效率与准确性
Formal Skill: Programmable Runtime Skills for Efficient and Accurate LLM Agents
- 用JSON元数据和可执行代码封装技能,实现结构化控制
- 在Harness-Bench上得分接近顶尖水平,用词量减少显著
- 适合需要可靠流程执行的自动化任务开发者
大型语言模型代理正越来越多地运行于真实工作空间中,其工具与技能决定了模型推理能否转化为可靠行动。现有技能大多非正式:Markdown技能和指令包以长篇自然语言文档编码流程;函数调用、模型上下文协议(MCP)服务器及框架工具虽能组织单个动作,但通常将工作流状态、策略执行与完成规范留于技能之外。本文提出形式化技能(Formal Skill),一种原生运行时抽象,通过JSON元数据与动作模式、可靠的Python执行器、钩子驱动的控制逻辑、技能路由机制以及技能内运行时状态,实现可复用能力的结构化表达。通过将重复提示中的可复用流程转化为可执行状态机与钩子策略,形式化技能为代理提供了高效且可强制执行的控制面。我们在FairyClaw中实现该抽象,一个开源的事件驱动运行时系统,支持可执行、可观测、可组合的形式化技能。在Harness-Bench测试中,FairyClaw取得极具竞争力的平均分,同时使用显著更少的令牌,尤其在凸显形式化技能作用的任务上表现突出。
原文摘要 · Abstract (English)
Large Language Model (LLM) agents increasingly act inside real workspaces, where tools and skills determine whether model reasoning becomes reliable action. Existing skills remain largely informal: Markdown skills and instruction packs encode procedures as long natural-language documents, while function calling, Model Context Protocol (MCP) servers, and framework tools structure individual actions but usually leave workflow state, policy enforcement, and completion discipline outside the skill itself. We introduce Formal Skill, a runtime-native abstraction that represents reusable capability with JSON metadata and action schemas, reliable Python executors, hook-governed control logic, Formal Skill routing, and skill-local runtime state. By moving reusable procedure from repeated prompt text into executable state machines and hook policies, Formal Skill gives agents a token-efficient and enforceable control surface. We implement the abstraction in FairyClaw, an open-source event-driven runtime for executable, observable, and composable Formal Skills. On Harness-Bench, FairyClaw obtains highly competitive average scores while using substantially fewer tokens, with especially strong results on tasks that expose the role of Formal Skill.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。