你无法改进你看不见的东西。研究助手交回一份烂报告时,你看到的是「报告不对」,看不到的是「第三步它把一个标题党网页当成了可信来源」。这一章讲怎么让它的每一步可见、可度量、可回归 —— 评估不是发布前跑一次 benchmark,是持续的可观测性。You can't improve what you can't see. When the research assistant returns a bad report, you see 'the report is off,' not 'on step three it trusted a clickbait page as a source.' This chapter covers making every step visible, measurable, and regressable — evaluation isn't a benchmark run once before launch, it's continuous observability.
— I
先能看见,才能改 —— TracingSee It Before You Fix It — Tracing.
agent 是个多步黑盒。不给每一步装上 trace,你调的就是黑盒 —— 只能猜。An agent is a multi-step black box. Without a trace on each step, you're debugging the black box — guessing.每一步都要可追溯:模型的决策、调了哪个工具、参数、结果、token、延迟。OpenTelemetry 的 GenAI 语义约定给了这些字段一套标准,1注 1Note 1OpenTelemetry · GenAI 语义约定 —— 为 LLM / agent 调用定义标准的 trace / span 字段(模型、token、工具调用等),让可观测性可移植、可对接现有监控。截至 2026-05。OpenTelemetry · GenAI semantic conventions — standard trace / span fields for LLM / agent calls (model, tokens, tool calls), making observability portable and pluggable into existing monitoring. As of 2026-05.好处是你的 agent trace 能直接接进现有的监控体系,而不是另造一套。落到工具上,Langfuse 这类平台把 trace、评估、回归集放在一起。3注 3Note 3Langfuse —— 开源 LLM / agent 可观测性平台,把 trace、评估、回归集放在一起。作为「把 tracing 落到工具」的一个代表。Langfuse — an open-source LLM / agent observability platform bringing traces, evals, and regression sets together. A representative of 'tracing made concrete in a tool.'Every step must be traceable: the model's decision, which tool it called, the arguments, the result, tokens, latency. OpenTelemetry's GenAI semantic conventions give these fields a standard,1注 1Note 1OpenTelemetry · GenAI 语义约定 —— 为 LLM / agent 调用定义标准的 trace / span 字段(模型、token、工具调用等),让可观测性可移植、可对接现有监控。截至 2026-05。OpenTelemetry · GenAI semantic conventions — standard trace / span fields for LLM / agent calls (model, tokens, tool calls), making observability portable and pluggable into existing monitoring. As of 2026-05. so your agent traces plug straight into existing monitoring instead of a bespoke one. Made concrete, platforms like Langfuse bring traces, evals, and regression sets together.3注 3Note 3Langfuse —— 开源 LLM / agent 可观测性平台,把 trace、评估、回归集放在一起。作为「把 tracing 落到工具」的一个代表。Langfuse — an open-source LLM / agent observability platform bringing traces, evals, and regression sets together. A representative of 'tracing made concrete in a tool.'没有 trace 的 agent,在 demo 里很美,在生产里没法维护 —— 因为你修不了你看不见的东西。tracing 不是上线后才加的运维项,是从第一个循环就该埋的线。An untraced agent is beautiful in a demo and unmaintainable in production — because you can't fix what you can't see. Tracing isn't an ops item added after launch; it's a wire to lay from the first loop.
— II
评估不是一次 benchmark,是一套回归集Evaluation Isn't One Benchmark — It's a Regression Set.
跑一次 benchmark 漂亮,证明不了什么。能证明的是一套每次改动都重跑的回归集。One pretty benchmark proves little. What proves something is a regression set you rerun on every change.建一个 golden set:一组输入,配上每个的期望行为(调对了工具?给对了答案?步数合理?)。每次改 prompt、换模型、加工具,重跑一遍,挡住「修好一个、弄坏三个」。规模大了人工评不过来,就用 LLM-as-judge —— 让一个强模型评判输出,便宜可扩展,但它有偏差,得先用人工标注校准过。2注 2Note 2Zheng et al. · 「Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena」(2023,arXiv:2306.05685)—— 用一个强模型评判另一个模型输出的方法、效力与偏差,是 agent 自动评估的常用手段。Zheng et al. · 'Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena' (2023, arXiv:2306.05685) — the method, effectiveness, and biases of using a strong model to judge another's output; a common technique for automated agent evaluation.Build a golden set: a group of inputs, each with its expected behavior (called the right tool? gave the right answer? reasonable step count?). On every prompt change, model swap, or new tool, rerun it to block 'fix one, break three.' When it grows past hand-grading, use LLM-as-judge — have a strong model judge outputs, cheap and scalable, but biased, so calibrate it against human labels first.2注 2Note 2Zheng et al. · 「Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena」(2023,arXiv:2306.05685)—— 用一个强模型评判另一个模型输出的方法、效力与偏差,是 agent 自动评估的常用手段。Zheng et al. · 'Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena' (2023, arXiv:2306.05685) — the method, effectiveness, and biases of using a strong model to judge another's output; a common technique for automated agent evaluation.回归集不用大,要稳。20 个覆盖真实场景和已知坑的用例,比 1000 个随机用例有用 —— 它每次都告诉你「这次改动有没有让 agent 变笨」。A regression set need not be big, but it must be stable. Twenty cases covering real scenarios and known traps beat a thousand random ones — they tell you, every time, whether this change made the agent dumber.
— III
度量任务成功率,不是「看起来对」Measure Task Success, Not 'Looks Right'.
agent 的质量不是「回答流不流畅」,是「任务做没做成」。度量要落在可检验的成功标准上。An agent's quality isn't 'fluent answers' — it's 'task done or not.' Measurement must land on a checkable success criterion.给每类任务定义可检验的成功:订单查询 —— 查到的状态对不对;代码任务 —— 跑起来、测试过没过;研究任务 —— 引用真不真实。把这些指标连同 token 成本、步数、延迟一起持续盯着(第一节的 trace 就是数据源)。一个成功率 70% 但你以为 95% 的 agent,比一个老老实实告诉你 70% 的更危险。Define checkable success per task type: order lookup — is the status correct; code task — does it run and pass tests; research — are the citations real. Track these alongside token cost, step count, and latency continuously (section I's traces are the data source). An agent at 70% success you believe is 95% is more dangerous than one that honestly reports 70%.把成功率和成本合成一个数,就有了 cost-of-pass:成本 ÷ 成功率 —— 一次「成功通过」的期望花费。Efficient Agents 用它在 GAIA 上量各模块值不值,做到保留 96.7% 性能、成本从 $0.398 降到 $0.228。4注 4Note 4Wang et al. · 「Efficient Agents: Building Effective Agents While Reducing Cost」(2025,arXiv:2508.02694)—— 定义并使用 cost-of-pass = 成本 ÷ 成功率(一次成功通过的期望花费)在 GAIA 上度量各模块值不值;其框架保留 96.7% 性能、成本从 $0.398 降到 $0.228。Wang et al. · 'Efficient Agents: Building Effective Agents While Reducing Cost' (2025, arXiv:2508.02694) — defines and uses cost-of-pass = cost ÷ success rate (expected spend per correct pass) to weigh each module on GAIA; its framework retains 96.7% of performance while cutting cost from $0.398 to $0.228.它给「这一格值不值得加」一个能横向比的数,而不是凭感觉。Fold success rate and cost into one number and you get cost-of-pass: cost ÷ success rate — the expected spend per correct pass. Efficient Agents uses it on GAIA to weigh whether each module earns its keep, retaining 96.7% of performance while cutting cost from $0.398 to $0.228.4注 4Note 4Wang et al. · 「Efficient Agents: Building Effective Agents While Reducing Cost」(2025,arXiv:2508.02694)—— 定义并使用 cost-of-pass = 成本 ÷ 成功率(一次成功通过的期望花费)在 GAIA 上度量各模块值不值;其框架保留 96.7% 性能、成本从 $0.398 降到 $0.228。Wang et al. · 'Efficient Agents: Building Effective Agents While Reducing Cost' (2025, arXiv:2508.02694) — defines and uses cost-of-pass = cost ÷ success rate (expected spend per correct pass) to weigh each module on GAIA; its framework retains 96.7% of performance while cutting cost from $0.398 to $0.228. It turns 'is this slot worth adding' into a number you can compare, instead of a hunch.这事整个行业都做得不好。MIT 的《2025 AI Agent Index》盘点了 30 个已部署的 agent,发现 25/30 不披露任何内部安全评测、只有 4 个有 agent 专属的 system card —— 能力大家抢着说,评估和安全没人晒。5注 5Note 5Staufer et al. · 「The 2025 AI Agent Index」(MIT 等,2026,arXiv:2602.17753;aiagentindex.mit.edu)—— 按 6 大类、45 字段记录 30 个已部署 agent;发现 25/30 不披露内部安全评测、23/30 无第三方测试、仅 4 个有 agent 专属 system card —— 能力披露多,安全与评估披露极少。Staufer et al. · 'The 2025 AI Agent Index' (MIT et al., 2026, arXiv:2602.17753; aiagentindex.mit.edu) — documents 30 deployed agents across 6 categories / 45 fields; finds 25/30 disclose no internal safety results, 23/30 no third-party testing, and only 4 have an agent-specific system card — much capability disclosure, very little on safety and evaluation.别成为那 25/30:评估做了,还要留得下记录。The whole industry is bad at this. MIT's 2025 AI Agent Index catalogued 30 deployed agents and found 25 of 30 disclose no internal safety results, and only 4 have an agent-specific system card — everyone races to claim capability, no one shows the evals or safety.5注 5Note 5Staufer et al. · 「The 2025 AI Agent Index」(MIT 等,2026,arXiv:2602.17753;aiagentindex.mit.edu)—— 按 6 大类、45 字段记录 30 个已部署 agent;发现 25/30 不披露内部安全评测、23/30 无第三方测试、仅 4 个有 agent 专属 system card —— 能力披露多,安全与评估披露极少。Staufer et al. · 'The 2025 AI Agent Index' (MIT et al., 2026, arXiv:2602.17753; aiagentindex.mit.edu) — documents 30 deployed agents across 6 categories / 45 fields; finds 25/30 disclose no internal safety results, 23/30 no third-party testing, and only 4 have an agent-specific system card — much capability disclosure, very little on safety and evaluation. Don't be one of the 25/30: evaluate, and keep the record.
— IV
评测作为常设能力:门禁、判官校准、别让平均掩盖尾部Evaluation as a Standing Capability — Gates, Judge Calibration, and the Tail the Average Hides.
在企业里,评测不是发布前的一个动作,是一条常设的产线。三件事把它从「跑一次」升成「一直在跑」:把回归集接进 CI 当门禁、校准你的判官、以及盯住平均分背后的尾部。In an enterprise, evaluation isn't an act before release — it's a standing line. Three things lift it from 'run once' to 'always running': wiring the regression set into CI as a gate, calibrating your judge, and watching the tail behind the average.第一件:回归集当 CI 门禁。第二节那个 golden set,价值只有接进 CI 才兑现 —— 每次改 prompt、换模型、动工具,CI 自动重跑,成功率掉到阈值以下就挡住合并,像单元测试挡住会崩的代码一样。这把「评估」从一份季度报告,变成一道每个 PR 都要过的闸。没有这道闸,「修好一个、弄坏三个」迟早会悄悄合进主干。First: the regression set as a CI gate. Section II's golden set pays off only wired into CI — on every prompt change, model swap, or tool edit, CI reruns it and blocks the merge if the success rate drops below threshold, the way a unit test blocks code that crashes. This turns 'evaluation' from a quarterly report into a gate every PR must pass. Without it, 'fix one, break three' eventually merges to main unnoticed.第二件:校准判官。LLM-as-judge 便宜可扩展,但它有系统性偏差 —— 位置偏差(偏爱两个候选里的某个位置)、长度偏差(把更长的当更好)、自我偏好(偏爱同族模型的输出)。2注 2Note 2Zheng et al. · 「Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena」(2023,arXiv:2306.05685)—— 用一个强模型评判另一个模型输出的方法、效力与偏差,是 agent 自动评估的常用手段。Zheng et al. · 'Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena' (2023, arXiv:2306.05685) — the method, effectiveness, and biases of using a strong model to judge another's output; a common technique for automated agent evaluation.这些不是玄学,是可测的。校准的做法:拿一小批人工标注当「判官的 golden set」,量判官和人的一致率;一致率不够高,判官的分数就不能当真。评分标准(rubric)该由业务持有 —— 什么叫「答对」是产品决定的,不是判官模型自己发挥。judge 是工具,rubric 是业务契约,别把后者外包给前者。Second: calibrate the judge. LLM-as-judge is cheap and scalable, but it carries systematic biases — position bias (favoring a slot among candidates), length bias (treating longer as better), and self-preference (favoring same-family outputs).2注 2Note 2Zheng et al. · 「Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena」(2023,arXiv:2306.05685)—— 用一个强模型评判另一个模型输出的方法、效力与偏差,是 agent 自动评估的常用手段。Zheng et al. · 'Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena' (2023, arXiv:2306.05685) — the method, effectiveness, and biases of using a strong model to judge another's output; a common technique for automated agent evaluation. These aren't mysticism; they're measurable. To calibrate: take a small batch of human labels as the 'judge's golden set' and measure judge-vs-human agreement; if agreement is low, the judge's scores can't be trusted. The rubric should be owned by the business — what counts as 'correct' is a product decision, not the judge model's improvisation. The judge is a tool, the rubric is a business contract; don't outsource the latter to the former.第三件:别让平均掩盖尾部。「平均成功率 92%」听着好,但如果那 8% 的失败集中在某一类高价值任务、或某一个租户身上,平均分正好把它藏了起来。企业级评测要看分布:按任务类型、按租户切开的成功率,和最坏情况(p95 延迟、最差那一档的准确率)。再加一层 guardrail 指标 —— 不是「答得多好」,是「有没有越界」:越权工具调用率、注入命中率、PII 泄露率、人闸触发率。这些和线下评测互补:线下用 golden set 回归,线上盯 guardrail 指标 + 真实成功率。两头都要,缺一头你就是在用一个漂亮的平均分,赌你没看见的那条尾巴。Third: don't let the average hide the tail. '92% average success' sounds fine, but if that 8% of failures clusters in one class of high-value task or on one tenant, the average is exactly what hid it. Enterprise evaluation reads the distribution: success rate sliced by task type and by tenant, plus worst-case (p95 latency, the accuracy of the worst bucket). Add a layer of guardrail metrics — not 'how good is the answer' but 'did it cross a line': unauthorized-tool-call rate, injection-hit rate, PII-leak rate, human-gate-trigger rate. These complement offline eval: offline you regress the golden set, online you watch guardrail metrics plus real success rate. You need both ends; miss one and you're betting a pretty average against the tail you can't see.动手 · 给你的 agent 装上度量:Hands-on · instrument your agent:
给循环每一步打 trace:决策、工具、参数、结果、token、延迟,至少先写进日志。Trace every loop step: decision, tool, arguments, result, tokens, latency — at minimum into logs first.
建一个 10 个用例的 golden set,每个配一条可检验的成功标准。Build a 10-case golden set, each with one checkable success criterion.
改一次 prompt,跑改前改后的回归,量出成功率的变化 —— 别靠感觉判断「变好了」。Make one prompt change, run the regression before and after, and measure the success-rate delta — don't judge 'better' by feel.
demo 看一次就够,
回归集要天天跑。.
A demo you watch once;
a regression set you run every day..
Aklman Library
— 讨论Discussion
讨论Discussion.
评论区初始化中…Initializing comments…
01 / 01
没有匹配结果No matches.
换个关键词,或按 Esc 回到页面Try another keyword, or press Esc to return