6.4
One run proves nothing一次運行證明不了什麼一次运行证明不了什么
This chapter assumes you have used an AI coding agent and that you have seen it do something slightly different when you asked for the same thing twice. Nothing else.
讀這一章,你需要用過 AI 寫程式的 agent,而且看過你把同一件事要求兩次,它做得有點不一樣。不需要別的。
读这一章,你需要用过一个写代码的 AI agent,并且见过你两次提同样的要求,它做出来的东西略有不同。别的都不需要。
The Knowledge經驗分享经验分享
In one sentence
An agent never does exactly the same thing twice, so one run proves nothing. Run the task several times, look at the spread, and report numbers together with their conditions.
一句話
agent 從不會把同一件事做得一模一樣兩次,所以一次運行證明不了什麼。把任務跑好幾次,看分布的範圍,報告數字時連同條件一起報告。
一句话
agent 从来不会把同一件事做得一模一样,所以一次运行什么也证明不了。把任务多跑几次,看看波动有多大,报告数字时要连同条件一起写。
For leaders
- The decision: require that every claim that one setup is better states how many times each side was run and under what conditions. For unattended work, ask for "works every time", not the average.
- The risk: one run each proves nothing. In the textbook example in this chapter, 4 passes out of 5 runs is compatible with a true pass rate anywhere from about 38 to 96 percent. To tell 50 from 70 percent reliably takes roughly ninety runs a side. These are rough numbers for a pass/fail task, not measurements of any agent.
- The cost of doing it right: runs multiply: tasks times setups times runs. Mostly money and time.
- Ask the team: "How many times was each side run, do the ranges overlap, and is everything equal except the thing being tested?"
給主管
- 要做的決定:要求每一個「某種設定比較好」的說法,都要說明兩邊各跑了幾次、在什麼條件下。對無人值守的工作,要看「每次都成功」,不要看平均。
- 風險:各跑一次證明不了什麼。以這一章的教科書例子來說,5 次運行通過 4 次,和真實通過率在大約 38% 到 96% 之間的任何值,都相容。要可靠地分辨 50% 和 70%,每一邊大約要跑九十次。這些是通過或失敗型任務的粗略數字,不是對任何 agent 的測量。
- 做對的成本:運行次數會相乘:任務數乘以設定數乘以次數。大多是錢和時間。
- 可以問團隊:「兩邊各跑了幾次?範圍有沒有重疊?除了被測的東西,其他一切都相同嗎?」
写给管理者
- 要拍板的事:要求凡是说“某套配置更好”,都必须写明两边各跑了多少次、在什么条件下跑的。对无人值守的工作,要看“每次都行”,不要看平均值。
- 风险:每边只跑一次,什么也证明不了。本章的教科书例子里,5 次运行通过 4 次,和真实通过率在约 38% 到 96% 之间的任何值都吻合。要可靠地分清 50% 和 70%,每边大约要跑九十次。这些是针对通过/失败类任务的粗略数字,不是对任何 agent 的实测。
- 做对的代价:运行次数会相乘:任务数乘配置数乘运行次数。主要是钱和时间。
- 可以问团队:“每一边各跑了多少次?范围有没有重叠?除了被测的那一样,其他是不是都一样?”
The problem
Every number in Use subagents sparingly comes from one run per task. The team cost about 4.5 times the usage and about 6 times the time of a single agent. Those two ratios are the most quoted figures in that chapter, and also the weakest. If I ran the same four tasks again, the ratios would move. I do not know by how much.
That is the problem this chapter is about. You ran the old setup once and the new setup once, and the new one scored higher. Is the new one better? Or would the old one have scored higher the next time?
Two words first.
- A run is one attempt by the agent at one task, from the start to the end.
- The spread is how much the results differ between runs of the same setup on the same task.
問題
慎用子 agent 裡的每一個數字,都來自每個任務跑一次。團隊花的用量大約是單一 agent 的 4.5 倍,時間大約是 6 倍。這兩個比例是那一章被引用最多的數字,也是最弱的。如果我把同樣四個任務再跑一次,這些比例會動。我不知道會動多少。
這就是這一章的問題。你把舊的設定跑了一次,新的設定跑了一次,新的分數比較高。新的比較好嗎?還是舊的下一次會得到比較高的分數?
先交代兩個詞。
- 一次運行(run),是 agent 對一個任務從頭到尾的一次嘗試。
- 分布範圍(spread),是同一種設定在同一個任務上,各次運行之間結果差多少。
问题
慎用子 agent里的每个数字,都来自每个任务跑一次。团队的用量约是单个 agent 的 4.5 倍,时间约 6 倍。这两个倍数是那一章里引用最多的数字,也是最站不稳的数字。如果我把同样四个任务再跑一遍,这两个倍数会变。我不知道会变多少。
这就是本章要讲的问题。旧配置你跑了一次,新配置你跑了一次,新的得分更高。新的更好吗?还是说,下一次旧的会得分更高?
先交代两个词。
- 一次运行(run),是 agent 对一个任务从头到尾做一次。
- 波动(spread),是同一套配置在同一个任务上,多次运行的结果之间相差多少。
How it works
Why runs differ
If you ask a person to do the same job twice, you get two slightly different results. An agent is the same, for plain reasons.
- The model picks its words with some chance in it. It does not always take the single most likely next move. Two runs begin with the same request and may take different first moves.
- Small differences grow. An agent works in a loop (The agent loop, and where you can step in). If run A reads file X first and run B reads file Y first, everything afterwards is built on a different picture. One early choice can end in a different answer.
- The world around it changes. Tools return what they return at that moment. A command takes a different time, or times out, or is slowed by a rate limit. A search lists results in a different order.
- The model itself can change. If the platform can change the model behind a name without telling you, two runs a week apart may not be the same model. Note the model and the date next to every run.
I have not measured how much of the spread comes from each of these. For this chapter that does not matter. What matters is that the spread exists, and you have to see it before you decide anything.
One run against several
- One run of each. B scored higher. It looks like B is better.
- Run each several times. A single setup now gives a spread of scores, not one score.
- The ranges overlap. The one run that made B look better could have come from either setup. Report the spread.
Look at the picture. With one run each, setup B looks better than setup A. With several runs each, you see that the two overlap. The one run that made B look better could have come from either setup. This is a picture, not data: it shows the shape of the problem, not how big it is for your agent.
How many runs?
There is no number that is right for every case. The size of the difference you want to see decides it. A large gap shows up in a few runs. A small gap needs many.
To feel why, count a single setup. Suppose it passed 4 of 5 runs. The usual 95 percent interval for that (the Wilson interval, which I computed by hand) runs from about 38 percent to 96 percent. With 5 of 5 it is still only about 57 percent to 100 percent. Five runs cannot tell a setup that passes 40 percent of the time from one that passes 95 percent. Two setups need more: the standard sample-size formula says that to see 50 against 70 percent reliably you need roughly ninety runs on each side. These are rough, textbook numbers for a pass/fail task, not measurements of any agent.
What I do:
- Start with a few runs of the setup you already have, on one task. Five per side is a starting point, not a conclusion. See how much the results differ by themselves. If they differ a lot, you cannot see small effects with a few runs.
- Add runs until the picture stops changing. If another run does not move the range much, you have a rough idea of the spread.
- Compare in pairs. Run both setups on the same tasks, and look at the difference task by task. A task that is hard for both sides stops adding noise to the comparison, so you need fewer runs than if you compared two averages.
- Run more for the changes you care about. You do not need a lot of runs for everything.
This costs money, and it grows fast: tasks times setups times runs. That is a reason to keep the set of tasks small and well chosen (Fixed tasks, scored by a script), and a reason to be honest when you could not afford more.
"All k succeeded" and "at least one of k succeeded"
When you run a task k times, there are two questions, and they have very different answers.
- At least one success in k runs. If a person can try several times and pick the best, this is what matters. It is called pass@k (Anthropic: "the likelihood that an agent gets at least one correct solution in k attempts"). It goes up as k grows.
- All k runs succeed. If the agent runs alone, nobody is watching, and it must work every time, this is what matters. It is called pass^k. It goes down as k grows: "demanding consistency across more trials is a harder bar to clear." (Demystifying evals for AI agents)
The tau-bench paper proposed pass^k for this reason. It reported that the agents it tested in 2024 were "quite inconsistent (pass^8 <25% in retail)". Here pass^8 means that all eight tries of the same task succeeded. That figure is for their retail tasks and those models, and it is not a statement about your tasks. (tau-bench) What carries over is the question. If the agent runs unattended, an average pass rate of 80 percent is not the number you need. You need to know how often it works every time. The same goes for a pilot: judge it by that, not by the average pass rate.
Pick the question that matches how you use the agent. Your agent with a person watching asks the first. An agent running overnight asks the second (Unattended: when it must stop).
Direction yes, ratio no
My result in Use subagents sparingly has a limited kind of strength. A gap of four to six times is large, and for that reason I trust the direction: the team cost much more for the same result. I do not trust "4.5" or "6". Each task ran once, and the two sides were not set up the same way. This is the shape of an honest claim from few runs: say which way it points, and do not say how far.
Common misreadings
- One run each. The case above.
- The average of a few runs, reported as one number. It hides the spread. Two setups with the same average can behave very differently: one always lands in the middle, the other swings between very good and very bad.
- Counting only the runs that succeeded. If you drop the failures to "get clean numbers", you have measured something else.
- Stopping when the result looks good. If you run until the new setup wins and then stop, you chose the answer. Three good runs in a row can come from a setup that passes half the time. Decide the number of runs before you start.
- Comparing sides that are not equal. A top model against a smaller one, with or without a knowledge base (A knowledge base: an honest index of the code), with different rules. Then the gap is the sum of several differences. Keep everything the same except the thing you test.
- Leaving out the hidden costs. If the usage you report does not include the subagents, the setup that uses them looks cheap (Use subagents sparingly).
How to write one honest sentence
Put the conditions next to the number. A number with no conditions cannot be checked and cannot be repeated. The conditions I write down:
- How many runs, and of how many tasks.
- Which model and setup, on each side.
- How it was scored, and by whom or what.
- What the usage counts (main conversation only, or subagents too).
- What the spread was, or "I ran it once" when I did.
Here is my own result, written that way: "Four tasks, one run each; one agent on a top model against a three-role team with a knowledge base; scored by the same script; usage in AI credits from the platform. Both got all four right. The team used about 4.5 times the usage and about 6 times the time. One run each, so I trust the direction and not the ratio."
It is a worse-looking sentence than "the team costs 4.5 times as much". It is the one that is true.
Test your own setup
Three questions for any claim that something is better:
- How many times was each side run?
- Do the ranges overlap?
- Is everything equal except the thing being tested?
A test you can run today. Take one task you know the right answer to. Give it to your agent five times, each in a new chat, with the same request. A new chat matters: an old chat carries what it learned, so the later runs would not be fair. Make a small table with one row per run: pass or fail, minutes, usage. Look at the five results next to each other. That is the spread of your own setup on that task, and it is usually bigger than people expect.
原理
為什麼各次運行不同
請一個人把同一件工作做兩次,你會得到兩個稍微不同的結果。agent 也一樣,原因很平常。
- 模型選字時帶著一點機率。它不是每次都走最可能的那一步。兩次運行從同樣的要求開始,第一步可能不同。
- 小差異會長大。agent 在一個循環裡工作(agent 循環,和你能插手的地方)。如果運行 A 先讀檔案 X,運行 B 先讀檔案 Y,之後的一切都建立在不同的畫面上。早期的一個選擇,可以走到不同的答案。
- 周圍的世界會變。工具在那一刻回傳什麼就是什麼。一個指令花的時間不同,或逾時,或被速率限制拖慢。搜尋列出結果的順序不同。
- 模型本身可能改變。如果平台可以在不通知你的情況下,換掉一個名字背後的模型,相隔一週的兩次運行,可能不是同一個模型。每次運行旁邊,都記下模型和日期。
這些原因各占分布範圍多少,我沒有測過。對這一章來說,這不重要。重要的是分布範圍存在,而你在做任何決定之前,得先看到它。
一次運行對比好幾次
- 各跑一次。B 的分數比較高,看起來 B 比較好。
- 各跑幾次。同一個設定現在給出的是一段分數的分佈,不是一個分數。
- 兩段範圍重疊。讓 B 看起來比較好的那一次,可能來自任何一個設定。要報告分佈。
看圖。各跑一次時,設定 B 看起來比設定 A 好。各跑好幾次時,你看到兩者重疊。讓 B 看起來比較好的那一次運行,可能來自任何一種設定。這是一張示意圖,不是資料:它顯示問題的形狀,不顯示它對你的 agent 有多大。
要跑幾次?
沒有一個數字對每種情況都對。你想看到的差距有多大,決定了次數。大的差距,幾次運行就看得出來。小的差距,需要很多次。
要感受為什麼,先數一種設定。假設它 5 次通過了 4 次。對這個通常的 95% 區間(Wilson 區間,我用手算的)是大約 38% 到 96%。5 次全過,也只有大約 57% 到 100%。五次運行,分不出一個通過率 40% 的設定,和一個 95% 的。兩種設定需要更多:標準的樣本數公式說,要可靠地看出 50% 對 70%,每一邊大約要九十次。這些是通過或失敗型任務的粗略教科書數字,不是對任何 agent 的測量。
我的做法:
- 先用你已經有的設定,在一個任務上跑幾次。每邊五次是起點,不是結論。看結果自己會差多少。如果差很多,幾次運行就看不出小的效果。
- 一直加次數,直到圖不再變。如果再多一次運行,範圍動得不多,你就大致知道分布範圍了。
- 成對比較。兩種設定在相同的任務上都跑,逐個任務看差異。對兩邊都難的任務,不再給比較增加雜訊,所以需要的運行次數,比比較兩個平均值少。
- 對你在乎的改動多跑幾次。不需要每件事都跑很多次。
這要花錢,而且成長得快:任務數乘以設定數乘以次數。這是把任務集保持小而精的理由(固定的任務,用腳本打分),也是你負擔不起更多時,要誠實說出來的理由。
「k 次都成功」和「k 次裡至少一次成功」
把一個任務跑 k 次,有兩個問題,答案差很多。
- k 次運行裡至少一次成功。如果人可以試好幾次再挑最好的,在乎的是這個。它叫 pass@k(Anthropic:「agent 在 k 次嘗試中,至少得到一個正確解的可能性」)。k 越大,它越高。
- k 次運行全部成功。如果 agent 獨自執行、沒人看著、必須每次都成功,在乎的是這個。它叫 pass^k。k 越大,它越低:「要求更多次試驗都一致,是更難跨過的門檻。」(Demystifying evals for AI agents)
tau-bench 論文就是為了這個原因提出 pass^k。它報告說,2024 年它測的 agent「相當不一致(零售領域的 pass^8 <25%)」。這裡的 pass^8,指的是同一個任務的八次嘗試全部成功。這個數字是它們的零售任務和那些模型的,不是對你的任務的說法。(tau-bench)可以帶走的是那個問題。如果 agent 是無人值守地執行,平均通過率 80% 不是你需要的數字。你需要知道的是,它有多常是每次都成功。試辦也一樣:用這個來判斷,不要用平均通過率。
挑符合你使用 agent 方式的問題。有人看著你的 agent,問的是第一個。通宵執行的 agent,問的是第二個(無人值守:什麼時候必須停)。
方向可以信,比例不行
我在 慎用子 agent 的結果,有一種有限的強度。四到六倍的差距很大,因此我相信方向:團隊花的錢多得多,結果卻一樣。我不相信「4.5」或「6」。每個任務只跑一次,而且兩邊的設定方式也不一樣。從很少的運行得出的誠實說法,就是這個樣子:說它指向哪個方向,不說走了多遠。
常見的誤讀
- 各跑一次。就是上面的情況。
- 把幾次運行的平均當成一個數字報告。它藏起了分布範圍。平均相同的兩種設定,行為可能差很多:一個總是落在中間,另一個在很好和很差之間擺盪。
- 只算成功的運行。如果你為了「得到乾淨的數字」而丟掉失敗的,你量到的是別的東西。
- 結果看起來不錯就停。如果你一直跑到新設定贏了才停,是你選了答案。連續三次好的運行,可能來自一個只有一半時間會通過的設定。開始之前先決定運行的次數。
- 比較不對等的兩邊。頂級模型對小一點的模型、有沒有知識庫(知識庫:程式碼的誠實索引)、規則不同。那麼差距就是好幾個差異的總和。除了你測試的東西,其他都保持一樣。
- 漏掉隱藏的成本。如果你報告的用量不含子 agent,用了它們的設定就會看起來很便宜(慎用子 agent)。
怎麼寫一句誠實的話
把條件放在數字旁邊。沒有條件的數字,沒辦法檢查,也沒辦法重複。我會寫下的條件:
- 跑了幾次,涵蓋幾個任務。
- 兩邊各用哪個模型和設定。
- 怎麼打分, 由誰或什麼來打。
- 用量算了什麼(只有主對話,還是也含子 agent)。
- 分布範圍是多少, 或者我只跑一次時,就寫「我只跑了一次」。
這是我自己的結果,照這樣寫:「四個任務,各跑一次;一個頂級模型的單一 agent,對一個帶知識庫的三角色團隊;由同一個腳本打分;用量是平台給的 AI credits。兩邊四個都做對。團隊用了大約 4.5 倍的用量、大約 6 倍的時間。各只跑一次,所以我相信方向,不相信比例。」
這句話比「團隊貴 4.5 倍」難看。但它是真的那一句。
測你自己的設定
對任何「某個東西比較好」的說法,問三個問題:
- 兩邊各跑了幾次?
- 範圍有沒有重疊?
- 除了被測的東西,其他一切都相同嗎?
今天就能跑的測試。拿一個你知道正確答案的任務。用同樣的要求,交給你的 agent 五次,每次都開新的對話。新的對話很重要:舊的對話帶著它學到的東西,後面的運行就不公平了。做一張小表,每次運行一列:通過或失敗、幾分鐘、用量。把五個結果並排看。這就是你自己的設定在那個任務上的分布範圍,它通常比大家預期的大。
原理
为什么每次运行都不一样
让一个人把同一件活干两遍,得到的结果会略有不同。agent 也一样,原因很平常。
- 模型选词带有一定的随机性。它不总是选最可能的那一步。两次运行从同一个需求开始,第一步可能就不同。
- 小差别会越滚越大。agent 在一个循环里干活(agent 循环,以及你能插手的地方)。如果运行 A 先读文件 X,运行 B 先读文件 Y,之后的一切就建立在不同的认识上。早期的一个选择,可能导向不同的答案。
- 周围的环境会变。工具返回的是那一刻它返回的东西。一条命令的耗时不一样,或者超时,或者被速率限制拖慢。一次搜索列出结果的顺序也可能不同。
- 模型本身也可能变。如果平台能在不告诉你的情况下,换掉某个名字背后的模型,那么相隔一周的两次运行,可能就不是同一个模型。每次运行旁边,都记下模型和日期。
这几个因素各占多少波动,我没有测过。对本章来说这不要紧。要紧的是波动是存在的,在你做任何决定之前,必须先看到它。
一次运行和多次运行
- 各跑一次。B 的分数比较高,看起来 B 更好。
- 各跑几次。同一套配置现在给出的是一段分数的分布,不是一个分数。
- 两段范围重叠。让 B 看起来更好的那一次,可能来自任何一套配置。要报告波动范围。
看这张图。每边只跑一次时,配置 B 看起来比配置 A 好。每边多跑几次,你就会看到两边有重叠。让 B 看起来更好的那一次运行,两种配置都可能跑出来。这是示意图,不是数据:它显示的是问题的形状,不是你的 agent 上这个问题有多大。
要跑几次?
没有一个数字对所有情况都对。取决于你想看出多大的差别。差距大,几次运行就能看出来。差距小,就需要很多次。
想体会为什么,先数一套配置。假设它 5 次运行通过了 4 次。对这个结果,常用的 95% 区间(Wilson 区间,我是手算的)大约是从 38% 到 96%。就算 5 次全过,也只能说大约是 57% 到 100%。五次运行分不清一套通过率 40% 的配置和一套通过率 95% 的配置。两套配置对比,需要更多:标准的样本量公式说,要可靠地看出 50% 对 70%,每边大约要跑九十次。这些是针对通过/失败类任务的粗略的教科书数字,不是对任何 agent 的实测。
我的做法:
- 先对你已有的配置,在一个任务上跑几次。每边五次是起点,不是结论。看看结果自己会相差多少。如果相差很大,几次运行就看不出小的效果。
- 一直加运行,直到图不再变。如果再多跑一次,范围没怎么动,你就大致知道波动有多大了。
- 成对比较。两套配置在同样的任务上都跑,逐个任务看差值。对两边都很难的任务,不会再给比较增加噪声,所以比起比较两个平均值,需要的运行次数更少。
- 对你在意的改动多跑几次。不必每件事都跑很多次。
这要花钱,而且涨得很快:任务数乘配置数乘运行次数。这是让任务集保持小而精的理由(固定的任务,用脚本打分),也是在你付不起更多次数时要老实说明的理由。
“k 次全部成功”和“k 次里至少成功一次”
一个任务跑 k 次,有两个问题,答案差别很大。
- k 次运行里至少成功一次。如果人可以多试几次,挑最好的,要看的就是这个。它叫 pass@k(Anthropic 的定义:“agent 在 k 次尝试中至少得到一个正确解的可能性”)。k 越大,它越高。
- k 次运行全部成功。如果 agent 独自运行,没人看着,而且必须每次都行,要看的就是这个。它叫 pass^k。k 越大,它越低:“要求在更多次试验里都保持一致,门槛更高。”(Demystifying evals for AI agents)
tau-bench 的论文正是为此提出了 pass^k。它报告说,它在 2024 年测的那些 agent “相当不稳定(零售任务上 pass^8 低于 25%)”。这里的 pass^8,是指同一个任务试 8 次全部成功。这个数字只针对他们的零售任务和那些模型,不是对你的任务的论断。(tau-bench)能迁移过来的是这个问题。如果 agent 无人值守地运行,平均通过率 80% 不是你要的数字。你要知道的是它有多大概率每次都行。试点也一样:按这个来评判,不要按平均通过率。
挑和你用 agent 的方式相符的那个问题。有人盯着的 agent,问的是第一个。通宵运行的 agent,问的是第二个(无人值守:什么时候必须停)。
方向可以信,倍数别当真
我在慎用子 agent里的结果,只有有限的说服力。四到六倍的差距很大,所以我相信方向:同样的结果,团队贵得多。我不信“4.5”或者“6”。每个任务只跑了一次,而且两边的配置也不一样。这就是靠很少几次运行做出的诚实结论该有的样子:说它指向哪边,不说差多远。
常见的误读
- 每边只跑一次。上面讲过的情况。
- 几次运行的平均值,只报一个数。它把波动藏起来了。两套平均值相同的配置,行为可能差别很大:一套总落在中间,另一套在很好和很差之间摆动。
- 只算成功的那几次。如果你为了“数字好看”把失败的去掉,你量的就是另一样东西了。
- 结果看起来好就停。如果你一直跑到新配置赢了才停,那就是你选了答案。连续三次好结果,可能来自一套只有一半时间能通过的配置。开跑之前就定好运行次数。
- 比较不对等的两边。顶级模型对小模型,有知识库对没有(知识库:代码的诚实索引),规则也不一样。这时差距是好几处差别的总和。除了被测的那一样,其他都保持一致。
- 漏掉隐藏的成本。如果你报告的用量不含子 agent,用了子 agent 的配置就显得便宜(慎用子 agent)。
怎么写出一句诚实的话
把条件放在数字旁边。没有条件的数字,没法检查,也没法重复。我会写下的条件:
- 跑了多少次,多少个任务。
- 每一边用的模型和配置。
- 怎么打分的,由谁或什么打的。
- 用量算了哪些(只算主对话,还是连子 agent 一起算)。
- 波动有多大,如果只跑了一次,就写“我只跑了一次”。
这是按这个写法写出来的我自己的结果:“四个任务,各跑一次;一个用顶级模型的 agent,对一个带知识库的三角色团队;由同一个脚本打分;用量是平台给的 AI credits。两边四个都做对了。团队的用量约是 4.5 倍,时间约是 6 倍。每边只跑了一次,所以我信方向,不信倍数。”
这句话看起来比“团队贵 4.5 倍”差。但它才是真的。
测你自己的配置
对任何“某样东西更好”的说法,问三个问题:
- 每一边各跑了几次?
- 范围有没有重叠?
- 除了被测的那一样,其他是不是都一样?
今天就能跑的一个测试。挑一个你知道正确答案的任务。用同样的需求,让你的 agent 做五次,每次开一个新对话。新对话很重要:旧对话带着它学到的东西,后面几次运行就不公平了。做一张小表,每次运行一行:通过还是失败、几分钟、用量。把五个结果放在一起看。这就是你自己的配置在那个任务上的波动,通常比人预想的大。
Costs and traps
More runs cost real money. If the budget does not allow enough runs, say that, and use the weaker words: "points toward", "I ran it twice".
Spread is not a fault to remove. You can lower it with a tighter setup, but part of it stays. Plan for it: checks, a person at the gates, and a limit on retries (Make a pass count).
A statistic does not replace reading. Five runs tell you the spread. They do not tell you why one failed. Read the failures (Fixed tasks, scored by a script).
My own results have no confidence interval. With one run each there is nothing to compute an interval from, and with a handful of runs it would be very wide, as the example above shows. So I show the runs and say which way they point.
代價和陷阱
多跑要花真的錢。如果預算不夠跑足夠的次數,就說出來,並用比較弱的措辭:「指向」、「我跑了兩次」。
分布範圍不是要消除的缺點。你可以用更嚴謹的設定降低它,但一部分會留下來。為它做計畫:檢查、門上有人,和重試的上限(讓「通過」可信)。
統計不能取代閱讀。五次運行告訴你分布範圍。它們不告訴你一次為什麼失敗。要讀失敗的運行(固定的任務,用腳本打分)。
我自己的結果沒有信賴區間。各跑一次,沒有東西可以拿來算區間;跑幾次的話,區間也會很寬,上面的例子就是這樣。所以我把運行擺出來,說它們指向哪個方向。
代价和坑
多跑要花真金白银。如果预算不够跑足次数,就直说,并用弱一点的措辞:“倾向于”“我跑了两次”。
波动不是要消除的故障。配置收紧可以让它小一些,但总有一部分留着。要把它考虑进去:检查、关卡处有人、对重试设上限(让“通过”可信)。
统计不能代替阅读。五次运行告诉你波动。它不告诉你其中一次为什么失败。要去读失败的运行(固定的任务,用脚本打分)。
我自己的结果没有置信区间。每边只跑一次,没有东西可以拿来算区间;只跑几次,区间也会非常宽,上面的例子就是这样。所以我给出每次运行,再说它们指向哪边。
When to delete it Industry practice
The hand-made habit of running a task again and again exists because I have no tool that does it and reports the spread. If a platform runs the same task several times and shows the spread, use that. If the models become so steady that the spread is small on my tasks, I can run fewer. I would have to measure that, not assume it.
The reasoning stays as long as the agent chooses its moves with some chance in them: one run cannot say how good a setup is.
什麼時候可以刪掉 業界做法
手動把任務一次又一次重跑的習慣存在,是因為我沒有工具做這件事並報告分布範圍。如果平台能把同一個任務跑好幾次並顯示分布範圍,就用那個。如果模型變得很穩,在我的任務上分布範圍很小,我可以少跑幾次。這得靠測量,不能靠假設。
只要 agent 選下一步時還帶著一點機率,道理就會留著:一次運行,說不出一種設定有多好。
什么时候可以删掉 业界做法
把任务一遍遍重跑的这个手工习惯之所以存在,是因为我没有工具能做这件事并报告波动。如果哪个平台能把同一个任务跑几次并显示波动,就用它的。如果模型变得足够稳定,在我的任务上波动很小,我可以少跑几次。但这得靠测,不能靠假设。
只要 agent 选下一步时还带着一定的随机性,这背后的道理就不变:一次运行说不清一套配置有多好。
Try it on your own setup
No harness needed. Open your agent in your own repository and paste:
Search this repository's README, docs, pull request templates and any decision records for claims about AI agent results: words like faster, better, cheaper, saves, fewer errors. For each claim, list the evidence given: how many runs, how many tasks, which model and setup on each side, how it was scored, and what the usage counted. Mark each claim as "conditions stated", "partly stated" or "no conditions". Do not change any files.在你自己的環境試試
不用裝 harness。在你自己的倉庫裡打開 agent,貼上:
搜尋這個倉庫的 README、文件、pull request 範本和任何決策紀錄,找出關於 AI agent 成果的說法:像是更快、更好、更便宜、節省、更少錯誤這類字眼。對每一個說法,列出所給的證據:跑了幾次、幾個任務、兩邊各用哪個模型和設定、怎麼打分、用量算了什麼。把每個說法標成「條件有寫」、「條件寫了一部分」或「沒有條件」。不要改任何檔案。在你自己的环境里试试
不需要 harness。在你自己的仓库里打开 agent,粘贴:
在这个仓库的 README、文档、pull request 模板和任何决策记录里,搜索关于 AI agent 效果的说法:比如更快、更好、更便宜、节省、错误更少这类词。对每一条说法,列出它给出的证据:跑了多少次、多少个任务、两边各用什么模型和配置、怎么打分、用量算了什么。把每条说法标成“写明了条件”“部分写明”或“没有条件”。不要修改任何文件。Go deeper
- Anthropic: Demystifying evals for AI agents, on multiple trials, pass@k and pass^k
- tau-bench: τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains
- In this book: Fixed tasks, scored by a script, Use subagents sparingly
延伸閱讀
- Anthropic:Demystifying evals for AI agents,講多次試驗、pass@k 和 pass^k
- tau-bench:τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains
- 本書:固定的任務,用腳本打分、慎用子 agent
延伸阅读
- Anthropic:Demystifying evals for AI agents,讲多次试验、pass@k 和 pass^k
- tau-bench:τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains
- 本书内:固定的任务,用脚本打分、慎用子 agent
You can stop here: that is the whole idea. The next part shows where it runs, so you can look inside.讀到這裡就夠了,這就是整個想法。下一部分告訴你它在哪裡運行,可以進去看看。读到这里就够了,核心思路就是这些。下一部分告诉你它在哪里跑,可以进去看看。
In my practice (Copilot Harness)實作实战
Copilot Harness is my open-source harness for VS Code Copilot.
Repository: https://github.com/Smars-Bin-Hu/copilot-agentic-harness
Get started: clone it, open it in VS Code, and type /harness-rookie-get-me-ready in Copilot Chat. You need Python 3.9 or later and git.
Copilot Harness 是我開源的 VS Code Copilot harness。
倉庫: https://github.com/Smars-Bin-Hu/copilot-agentic-harness
開始:clone 下來,用 VS Code 打開,在 Copilot Chat 裡輸入 /harness-rookie-get-me-ready。需要 Python 3.9 以上和 git。
Copilot Harness 是我开源的 VS Code Copilot harness。
仓库: https://github.com/Smars-Bin-Hu/copilot-agentic-harness
上手:把仓库 clone 下来,用 VS Code 打开,在 Copilot Chat 里输入 /harness-rookie-get-me-ready。需要 Python 3.9 及以上版本和 git。
Explore it in the harness
Copilot Harness does not run its scenarios several times; each one runs once, by hand. What the harness has is the material this chapter builds on: the log and the report that tell you what each run did. The harness can show you where a run's time and usage are recorded, so you can build your own repeated runs on top. After the setup above, type:
/harness-rookie-wondering I have read the chapter "One run proves nothing". Teach me what this harness records for a single run (topic 12): the log, the usage and time of a task, and the fixed scenarios. Help me see what I would need to add to run one scenario five times and compare the results.It teaches one small piece at a time, stops to ask if you are following, and opens the files with you.
在 harness 裡探索
Copilot Harness 不會把它的情境跑好幾次;每個只手動跑一次。harness 有的,是這一章所依據的材料:告訴你每次運行做了什麼的日誌和報告。harness 可以給你看,一次運行的時間和用量記在哪裡,讓你在上面建自己的重複運行。照上面的說明準備好之後,輸入:
/harness-rookie-wondering 我讀完了「一次運行證明不了什麼」這一章。請教我這個 harness 為單次運行記錄了什麼(主題 12):日誌、一個任務的用量和時間,以及固定情境。幫我看出,要把一個情境跑五次並比較結果,我還需要加什麼。它一次教一小塊,停下來確認你跟得上,然後和你一起打開檔案。
在 harness 里探索
Copilot Harness 不会把场景跑好几次;每个场景都是手动跑一次。harness 有的,是本章所依赖的材料:告诉你每次运行做了什么的日志和报告。harness 能给你看一次运行的时间和用量记在哪里,这样你就能在它上面搭自己的重复运行。完成上面的配置后,输入:
/harness-rookie-wondering 我读过“一次运行证明不了什么”这一章。请教我这个 harness 对单次运行记录了什么(主题 12):日志、一个任务的用量和时间,以及固定场景。帮我看看,要把一个场景跑五次并比较结果,我还需要补上什么。它一次只教一小块,会停下来问你跟不跟得上,并和你一起打开文件。