SKILL.md 的哪些内容模型已经知道|Nikolay Petrov
原题Your SKILL.md Is 70% Stuff the Model Already Knows - Nikolay Petrov, Intel
推荐理由这场演讲逐条测试 Skill 带来的新知识,再用任务级评测验证精简效果。它帮助维护者区分模型已知概念、具体参数和有害指令,减少凭感觉增删规则。
看前速览
Nikolay Petrov 用有无 Skill 的对照实验,找出哪些指令带来新知识,再用任务评测验证删改。
用任务比较 Skill 加载前后的表现
除了任务解决率,还观察耗时和 token。示例中,加载 Skill 后从解出 5 题中的 3 题提高到全部解出。
把指令拆成可检查的小条目
两组使用同样的问题,避免题目泄露答案,并可考虑请不同模型家族的模型判分。
区分概念理解与精确细节
模型可能知道大概怎么做,具体的键名、参数值和操作步骤仍然有价值。
修改后重跑任务评测
看似多余的条目可以先尝试删掉,再验证删减是否保留了 Skill 的实际效果。
完整摘要
Nikolay Petrov 用相同任务比较加载与未加载 Skill 的表现,同时观察用时和 token 用量。为了找出是哪条指令发挥了作用,他把内容拆成可问可判的小条目,对比模型在两组中的答案,并区分新增能力、已有知识、性能退化和两组都答不出来的情况。在一组比较里,Opus 对一般概念的掌握约为 70%,对精确细节只有 22%。这类结果适合用来确定修改方向,最终仍要靠任务级评测确认精简后的 Skill 能做成原来的事。
章节
文字稿
简要说明Brief Description
Nikolay Petrov 解释了如何衡量单项技能指令是否为模型增加了可用知识,然后通过任务级评估测试任何修改。Nikolay Petrov explains how to measure whether individual skill instructions add knowledge the model can use, then test any edits against task-level evaluations.
目录Table of Contents
- 针对任务测试该技能Test the skill against tasks
- 逐项评估新颖性主张Measure novelty claim by claim
- 阅读四种可能的结果Read the four possible outcomes
- 使用评估测试更短的版本Test shorter versions with evals
针对任务测试该技能Test the skill against tasks
你好。我叫 Nikolay Petrov,今天我们要聊聊技能,以及智能体对这些技能的了解。我们会从简单的提示词开始,也就是我们一直用来尝试新东西、尝试智能体正在完成的新工作的那些提示词。我们一遍又一遍地重复使用这些提示词,然后开始把它们封装成技能,创建可重复、可复现、可移植的功能或能力,让我们能够教会智能体如何使用它们。其中一些技能非常重要,在 GitHub 上有数百颗星。技能有不同类型。有些技能会教给模型一些新东西,为模型带来新的知识或能力;还有一些属于引导型或流程型技能,它们不会提供任何额外信息,只是让我们能够以可重复的流程执行希望智能体完成的一系列操作。Hello. My name is Nikolay Petrov and we will be talking about skills and agents knowledge of those skills. We'll start it with the simple prompts where we've been playing with the new stuff, new work being done by the agents, repeating those prompts over and over again, and then we start packing those into the skills, creating repeatable, reproducible, portable type of the functionality or capabilities that we can teach agents to work with. And some of those skills are very important, hundreds of stars on GitHub. There are different types of the skills. Some teach models something new, bringing new knowledge or capabilities to the model, but they're also type of steering or process skills where we do not bring any additional information but just getting repeatable flow of the actions that we want agents to perform.
两者都有用。本节我们将讨论一种新的技能知识类型,并探讨如何利用模型对这些技能的理解。我们会先准备好第一批技能,然后开始使用,基本上先凭直觉判断它们是否有效。不过,也有更技术、更确定的方法来检查技能是否有效,以及这些技能会产生什么影响,这就是评估(evals)。评估可以采用不同的格式来定义,但从本质上说,它们就是你希望智能体能够解决的任务定义。你需要把任务放在一个尽可能确定、便于验证的环境中。然后我们可以运行两组测试:一组不加载任何技能,另一组则加载技能,并向上下文提供这些额外信息。Both are useful. In this session we will be talking about new knowledge type of the skills and we'll see what we can get from the model's understanding of those skills. So we get our first skills packed, start using them basically starting with the feel of does it work or not. But there is also the more technical way and more deterministic way for the checking if skills are working or not and what's the impacts of those skills are evals. There are different formats where evals can be defined, but at the sense this is task definition that you want your agent to be able to solve. You put it in the place, ideally more deterministic, so we can validate it. And we can run two arms. One where no skill loaded and the second one where we're loading the skill and providing this additional information to the context.
然后我们比较它们的运行情况。需要考察多个方面。其中一个是解决了多少个评测任务。在这个例子中,不使用技能时,我们解决了五个任务中的三个;使用技能时,我们解决了全部五个,也就是说多完成了两个任务。此外,还可以考察 token 用量、完成这些任务所花的时间以及其他因素。但最终,我们会对这些方面进行比较,判断哪些方案有效、哪些无效。这是评估技能的主要工具之一,可以用来证明技能并非只是一些不错的想法,而是能够切实发挥作用的指令和上下文。不过接下来呢?我们已经有了一个可用的技能,它解决了一些评测任务。但我们知道,一定有更好的方法。模型在不断演进;在某些情况下,我们或许希望让技能更高效,也就是减少 token 消耗。And we compare how they runs. There are multiple things. One is how many evals been solved. In this case with no skill we're solving three out of five. With skill we're solving all five, meaning that we get two more tasks. There also would be implications on the tokens usage or time that it took those tasks to be completed and other factors. But at end we are comparing those and seeing what makes sense and what does not. And this is one of the main tools for evaluating the skills and saying that they not just nice ideas but actually working pieces of instructions and context for the agents. But what next? We get to the stage where we have the working skill. It solved some evals. But we know that there should be a better way. We have models evolving. We have some maybe cases where we want to get skill more efficient, meaning consuming less tokens.
逐项评估新颖性主张Measure novelty claim by claim
那么有哪些选择呢?一种是逐行修改,然后尝试用暴力法穷举所有不同的组合。另一种是仔细想想什么做法合理,比如把用户对技能的反馈作为依据,看看技能在哪些方面表现良好、哪些方面表现不佳。对于新模型,也可以直接运行技能看看效果。那么有哪些选择呢?修改的幅度应该有多大?是改几行、几句话,还是一些想法?我们发现,与其依赖运气,不如利用事实评分中的条目,在这里采用更具确定性的流程。我们可以把技能和指令拆分成这些条目,并为每个条目准备一组成对的问题和答案,作为预期结果。它们可以是一般性的想法,比如本例中的命题;也可以是契约,对动作提出更明确的预期。So what's the options there? One is just change line by line and try brute force all the different combinations. Another would be to think through what makes sense so maybe use something as the user feedback on the skills to see where skills perform well where it doesn't. And with new models just running skill and seeing how it works, what's the options there? And how large those modification should be? Just lines, sentences, ideas. So what we found to be useful is instead of relying on the luck, we can put more deterministic process here using idea of the items from the fact score. We can split the skill and instructions into those items and for each of those have pair of question and answer that we expect. This could be either general ideas like proposition in this case or contracts where we put more definitive expectation on the action.
通常,我们会为每项技能预先设定一定数量的题目,比如每项技能 25 或 30 道。然后针对每道题,我们会再次设置两组测试:一组不使用技能,另一组使用技能。我们还会安排一位或一组评审来评估模型的回答。我们会向模型提出我们感兴趣的问题,并由评审进行评估;理想情况下,评审应来自不同的模型系列,或者由多个评审组成。我们会确保题目不会泄露答案。根据具体情况,我们可以在不使用工具或额外信息的情况下进行比较,以检验模型的内部理解能力;也可以为模型提供一些工具,例如网页访问权限。后一种方式会更实用。这样,我们就能得到一个简单的四格计数矩阵,基本上用于检查模型是否知道某件事,以及这与技能对模型的影响有何关联。And in general, we will be getting some predefined amount of the items per skill and we will have let say 25 or 30 items per skill. Then for each of the items, we will again run two arms, one without skill and one with skill. And we will have judge or panel of judges that will be evaluating model answers. So we asking those questions to the model that we interested in. We evaluating those questions with the judge, ideally different family of the models or panel of judges. We will ensure that the question do not leak answers. We depending on the case can compare with no tools or additional information to check the internal model understanding or provided with some tools like web access. So it would be more practical. And we can get the simple four-way counts matrix. Basically where we are checking that the model knows or do not know something and how this maps to the skill impact on this.
阅读四种可能的结果Read the four possible outcomes
因此,最简单的情况是,模型无论是否使用技能,都能够回答这个特定问题。这意味着技能对此没有影响,而且这本来就在模型的知识范围内。第二种情况是,模型在不使用技能时就能正确回答这个问题;而添加技能后,我们发现模型的表现以及讨论或解释特定方面的能力反而有所下降。理想的情况是,模型在不使用技能时无法回答某个问题,但使用技能后,我们开始看到它能够回答这些新的问题类型和场景。这正是我们的目标:教会模型一些新东西。不过,也可能存在第四种情况:技能的编写不够理想,或者不够清晰,导致模型无论是否使用技能都无法回答问题。即使这个主题可能与模型相关且很重要,模型还是会漏掉其中的一些概念。So the simplest option is where model was able to answer this particular questions even without skill or with skill. This means that skill have no impact on this and this was already part of the model's knowledge. The second one is where without skill actually model was able to answer this correctly. And by adding skill we saw degradation in performance and model capability to talk or explain particular aspects. The ideal case is where without skill model wasn't able to answer something and with skill we start seeing that it can answer those new type of the questions and scenarios and this is what we were aiming for teach model something new. But there also can be there fourth option where skills were written not ideally or in some might be not clean way where model wasn't able to answer it either without skill or with skill and while this topic might be relevant and important for the model it still sort of misses some of those concepts.
最容易修正的是那些确实会损害性能的指令或条目。对于热门技能来说,这类情况相当少见。下面的方框中可以看到,在 Anthropic Skills 将近 400 个条目里,只有一个这样的例子,其他技能则没有。不过,对于不那么热门的小型技能,这类问题可能会更多。这也是我们在一些实验中观察到的情况。修正这类问题很直接,也最简单:确保你的技能不会削弱模型的能力和性能,并且只提供相关的上下文。在这个例子中,我们还可以用颜色来标注:这里是按行标注的,但如果针对具体条目,也可以对单行或单个句子进行不同的颜色标注。这样就能直观地展示哪些细节和指令是你为模型带来的新内容,哪些是模型本来就知道的。The simplest thing to fix are instructions or items that actually hurts performance and for popular skills those are pretty rare. So in the box below you see that it's just one case out of the almost 400 items in Anthropic skills and others don't have those. But for the smaller skills that are less popular you probably having more of those. This is what we are seeing with some of our experiments. And this is just straightforward the simplest thing to fix to ensure that your skill do not reduce model capabilities and performance and bring only prevalent context there. And we also can actually color this in this scenario this is done by lines but actually going with items you might have there different coloring for a single line or a single sentence. And this just gives your example there visualization where this would be helpful details and instructions in terms what new stuff you bring to the model and what is something that model already knows.
从成本上看,虽然我们运行了所有这些问题并向模型提问,但相对而言,评估 29 项技能的成本仍然很低:调用 Sonnet 和 Haiku 总共花了 14 美元,其中 Sonnet 用作评判模型。我们还可以通过几种方式来检查知识掌握得有多严格。我们有宽松和严格两种检查方式:前者检查总体思路,后者则检查准确细节。你可以把它们的区别理解为:掌握一般知识、理解主题,与理解确切的关键参数、具体数值或步骤之间的区别。从各个模型的表现来看,这种差异很大,尤其是在规模较大的前沿模型中。以 Opus 为例,它对技能的理解率从考查总体理解时的 70% 降到了考查具体细节时的 22%。Cost wise we are running all those questions and asking model but still relatively this is cheap for 29 skills, $14 in Sonnet and Haiku calls, with Sonnet used as a judge. And there couple ways how we also can check the strictness of some knowledge. We have lenient and strict ways of the checking this where first checks the general idea while the second one is checking for exact details and you can think about the difference between general knowledge and understanding of the topic to the understanding of the exact keys parameters and exact values or steps. And what we see across the models is the difference is large especially with the larger frontier models where we see Opus dropping from 70% understanding of the skill in case of the general understanding to just 22% of the specific details.
使用评估测试更短的版本Test shorter versions with evals
这与我们的预期相当一致。我们发现,新模型的泛化能力相当不错,也能理解各种概念。不过,提供准确的细节和数据仍然很有帮助,这些信息有助于解决相关问题。下面是对比这三种流行封装工具在不同模型上的技能表现。这里一个有趣的观察是,总体而言,较小的模型对这些技能的理解较弱,而更大的 Sonnet 模型理解得更好,这也是我们需要更大模型的原因。不过,我们也看到,整体而言,这些模型已经理解了这些技能中的许多细节和上下文。我们可以预期,随着新模型不断推出,以及训练能力进一步提升,模型的理解能力也会越来越强。And this is much our expectations. We see that new models are pretty well generalized and understand concepts. But it's still helpful to provide the with exact details and data that will be useful for the solving those problems. Here is outlook of the comparing those three popular wrappers with the skills across different models. So one of the interesting observations here is that smaller model have in general lower understanding of the skill with the larger Sonnet having better understanding, which is why we have bigger models. But also we see that overall the models already understand a lot of the details and context of those skills. And you would expect that with the newer models and more advances in the better training capabilities, we will have more and more in terms of the model's understanding.
但我们也看到,不同技能之间的差异相当显著。这并不是坏事。有些技能本来就是为了引导模型而设计的。不过,了解这些技能如何为不同的模型及模型系列带来新知识也很有用,而且理想情况下,应在更广泛的模型集合上进行测试。但新颖性这一信息只是诸多信号之一,基本上只是优化的初始方向。归根结底,我们仍然必须运行评估,并验证我们尝试通过技能做出的所有更改确实有效。一种比较简单的做法是查看技能,尝试从中移除部分或全部已知信息,然后运行评估。最终得分可能会保持不变。But also we see that this pretty significantly differs skill to skill. And it's not bad. Some skills are intended to be directional. But it's also useful piece of information to see how those skills bring new knowledge to the different model and different families and this should be run ideally in the broader set of the models. But just having the this novelty piece of information is just one of the signals. It's basically initial vector for optimization. At the end, we still have to run evals and validate that all changes that we try to make with the skill actually works. So the one of the simpler scenarios would be we can look on the skill and try to remove some or all of the already known pieces of information from the skill and run evaluation. It might come up with the same scoring.
基本上,我们仍然能获得相同的结果,模型也依然能够解决那些问题。这样就很好:我们可以缩减技能的大小,节省 token 和上下文。这样一来,我们就不必再靠蛮力尝试、猜测该删掉或添加什么,或者该如何修复性能退化,而是可以获得明确的指导。 所有这些测量和实验都是用 [framework name unclear] 完成的。它是一个用于比较与智能体及其上下文相关的一切内容的框架,包括 skill、agents MD、MCP 工具等等。新颖性是其中一项功能,可以为 skill 优化和评估提供一个初始向量;此外还有各种评估,包括对上下文影响的评估、路由评估、描述和命名的比较,以及许多其他与 skills 相关的内容。通过这些评估,我们就能更确定地做出判断,从而有依据地决定该如何处理 skills。Basically we will be getting the same results model still capable of solving those problems. Then great we can reduce skill size, save tokens, save context. And instead of the brute forcing and guessing what we can or should remove or add or how to fix the degradations we can have a guidance. So all of those measurements experiments been done with the [framework name unclear] which is a framework for the comparing everything related to the agents and context where it's is skill, agents MD, MCP tools, whatever. And novelty is one of the pieces of the functionality where you can get this initial vector for the skill optimization and evaluation but there are also evals. There is assessment of the context impact, routing, comparing the descriptions, naming, bunch of the things that related to the skills where it would be helpful to actually get the more deterministic evaluations to make conscious decisions in terms of the what should be done with the skills.
因此,感谢您抽出时间,请继续撰写更好的技能。So thank you for your time and please go ahead and write better skills.