读见

别盲信 AI 智能体:像科学家一样测试它们|Omni Analytics 的 Stephanie Jarmak

原题Don't Trust Your AI Agents. Test Them Like a Scientist — Stephanie Jarmak, Omni Analytics

约 8 分钟原文英文已翻译

视频由 YouTube 提供

推荐理由工具明明可用却未被调用、搜索召回太多反而偏离目标,案例让评估问题更具体。适合据真实任务设计重复试验和生产追踪。

看前速览

5 个要点

Stephanie Jarmak 结合一线实践,说明如何通过真实任务、受控实验、可信追踪记录与强制执行的质量门禁,让智能体评估真正服务工程决策。

  1. 先明确决策问题,再选择评估指标

    成本降低 28%,并没有解决原本的工具调用问题。只看搜索召回率,也无法体现返回 295 个文件而实际只需 6 个的代价;测量必须对准真正的目标。

  2. 用有代表性的任务评估完整配置

    公共基准可以帮助缩小选择范围,但运行框架一变,模型比较结果就可能逆转。测试应覆盖不同任务类型、重复运行及配置交互,并贴近实际环境。

  3. 从工具是否可用,一直追查到最终结果

    保留上下文、调用、返回信息、失败尝试与未调用行为的证据。如果智能体没有利用工具结果改善最终任务,仅提升工具调用表现仍然不够。

  4. 强制执行停止条件,并估算人工复核负载

    智能体发出警告,与代码执行质量门禁是两回事。误报可能淹没领域专家,因此复核负载、错误后果和明确的人工接手边界需要一起设计。

  5. 检查追踪记录可信度,并在生产环境验证离线结论

    独立记录的案例说明,依赖智能体自身历史可能漏掉问题。结合真实使用分类,以及生产或影子观测,才能检验测试中的任务和改进是否反映实际价值。

完整摘要

Stephanie Jarmak 结合在 Sourcegraph 和 Omni Analytics 建设智能体评估体系的经历,强调每次测量都应回答一个明确的产品或工程问题。一次代码搜索实验中,修改提示词让运行成本降低了 28%,却仍未让智能体使用指定工具。另一案例中,更换运行框架就改变了模型的比较结果,说明公共基准适合帮助筛选候选方案,却不足以证明整套配置在具体组织中的表现。

她建议按真实工作划分任务类型,通过重复运行观察非确定性,并关注不同配置变更之间的交互影响。保留完整追踪记录,逐步检查工具是否可用、是否被调用、是否返回有效信息,以及这些信息是否改善了最终任务结果。搜索返回 295 个文件、实际只需 6 个的案例说明:即使召回率满分,也可能偏离重视精确率的业务目标。

评估还必须连接实际运行中的控制措施。智能体发现异常,并不等于系统会停止,质量门禁和升级人工处理的边界需要由代码执行。讲者引用的场景中,1% 的误报会带来 10,000 次人工复核,因此专家处理能力也必须纳入设计。独立记录比对的案例则提醒团队审视智能体自身追踪记录是否可信。最后,应通过生产数据和影子观测检验离线测试能否反映真实工作负载。演讲结合了一线工程经验和第三方案例,但没有提供可复现的实验数据,字幕中的部分基准与模型名称也存在歧义。

章节

文字稿

查看原文

简要说明Brief Description

Omni Analytics 的 Stephanie Jarmak 探讨如何以科学家的怀疑精神评估 AI 智能体:测试贴近实际的工作负载和完整配置,追踪整个流程,选择有助于决策的衡量指标,并设置质量门禁,同时平衡人工审查与运营风险。Stephanie Jarmak of Omni Analytics discusses how to evaluate AI agents with a scientist's skepticism: test realistic workloads and complete configurations, trace the whole pipeline, choose measurements that support decisions, and enforce quality gates while balancing human review and operational risk.

目录Table of Contents

  • 简介
    Intro
  • 当智能体忽略你的工具时
    When the agent ignores your tool
  • 测试框架会改变结果
    The harness changes the results
  • 公开基准测试与自有评估
    Public benchmarks vs. your own evals
  • 像科学家一样设计评估
    Designing evals like a scientist
  • 追踪整个处理流程
    Trace the whole pipeline
  • 选择你要衡量的指标
    Choose what you measure
  • 真正能阻止工作的质量门禁
    Quality gates that actually stop work
  • 人工审核瓶颈
    The human review bottleneck
  • 当无法信任代理的记录时
    When the agent's record can't be trusted
  • 生产环境才是真相。
    Production is truth
  • 何时升级至人工处理
    When to escalate to a human

简介Intro

我叫 Stephanie Jarmak。几周前,我加入 Omni Analytics,成为一名 AI 工程师。我们有一个平台,其中包含治理语义层,旨在借助我们钟爱的智能体 Bloopy,帮助大家对业务数据形成共同的理解。My name is Stephanie Jarmak. I became an AI engineer a couple of weeks ago at Omni Analytics, where we have a platform with a governance semantic layer to provide a shared understanding of business data, using our beloved agent Bloopy.

在那之前,我在 Sourcegraph 工作了一年。我先是担任 Amp(一个编程智能体)的解决方案工程师,之后转到一个职责范围更宽泛的岗位,主要负责他们的评测平台。我构建了一个规模非常大的公开基准测试,名为 Code Scale Bench,用来了解智能体在非常复杂的代码库中的运行情况。再往前,我是一名天文学家。Before that, I spent a year at Sourcegraph. I was a solutions engineer for Amp, a coding agent, and then moved into a more amorphous role largely working on their evaluation platform. I built a very large public benchmark called Code Scale Bench to understand how agents work across very complex code bases. Before that, I was an astronomer.

我从研究科学家的视角来看待这个问题,不断质疑一切。因此有了这个标题:“谎言、该死的谎言和评测”。标题说的是如何信任你的智能体,但这场演讲主要讲的是如何不信任你的智能体。I approach this from a research scientist's point of view, relentlessly questioning everything. Hence the title, “Lies, Damned Lies, and Evals.” It says how to trust your agents, but this talk is mainly about how not to trust your agents.

当代理忽略你的工具时When the agent ignores your tool

这是我在 Sourcegraph 测试他们的代码搜索 MCP 工具时进行的一次运行示例。它展示了运行评估后可能得到的不同数字。我当时想弄清楚的是:为什么这个编码智能体没有使用我希望它使用的工具?Here is an example of a run I did at Sourcegraph while testing their code search MCP tool. It shows the different numbers you can get after running an evaluation. What I was trying to figure out was: why isn't this coding agent using the tool I want it to use?

我拿到了所有追踪记录,也查看了评估工具整体效果的主要指标。我修改了给智能体的初始提示词并运行了它,因为我希望它使用该工具。我看到的是,成本降低了 28%。这很有意思,但这不应该改变我对究竟想衡量和了解工具框架及设置变更的哪些方面的判断,因为它最终还是没有使用该工具。I had all the traces and looked at the primary metrics for evaluating the overall effectiveness of a tool. I had changed the initial prompt given to the agent and run it because I wanted it to use the tool. What I saw was that it was 28% cheaper. That is interesting, but it should not change my decisions about what I am actually interested in measuring and understanding about changes to the harness and setup, because it still did not use the tool.

你需要了解自己正在设置什么来进行测量。28%或许是一个值得探索的方向:我们有一些实验空间,可以调查其中的差异以及成本测量方面的情况。但我们仍然没有看到它使用本应使用的工具。You need to understand what you are setting up to measure. The 28% may be an interesting avenue to explore: we have some experimental space to investigate the variance and what is happening with cost measurements. But we still were not seeing it use the tool it was supposed to use.

我们有迹象表明,它接收到了某些信息,随后却相信这些信息并不存在。这完全是因为它没有使用那个工具。We had an indication that it was receiving certain information and then trusting that the information was not there. That was purely because it did not use that tool.

测试框架会改变结果。The harness changes the results

我还想谈谈 harness 本身的影响。下面是一个来自第三方来源的示例:该来源在 Turbo Bench 4 上设置了大约 63 项任务。Turbo Bench 4 是一个广受欢迎、使用广泛的编码智能体基准测试。假设你正要挑选一个模型放进你的 harness 中。I also want to talk about the impact of the harness itself. Here is an example from a third-party source with 63 or so tasks on Turbo Bench 4, a popular, widely used benchmark for coding agents. Suppose you are trying to pick which model to put into your harness.

他们比较了 Opus 5 和 Astra。使用开源框架之一 Open Hands 时,Opus 5 胜过了 Astra。但当他们只更换框架时,Astra 的表现就好得多。这些配置的效果相差 30% 以上。They compared Opus 5 and Astra. With Open Hands, one of the open harnesses, Opus 5 beat it out. But when they swapped just the harness, Astra did a much better job. There was a 30-plus percent difference in the effectiveness of these configurations.

关键在于,尽可能评估与要测量的工作负载和环境最接近的配置,因为其中涉及的变量非常多。你可能会看到一些结果亮眼的基准测试,但系统在你的实际环境中未必会表现得如你所料。The takeaway is to evaluate the closest configuration you can to the work and environment you will be measuring, because there are so many variables involved. You might see benchmarks with fancy results, but the system might not do what you expect within your actual environment.

公开基准测试与自有评测Public benchmarks vs. your own evals

这就引出了如何区分公开基准测试和评估,以及如何解读它们。评估是指通过测量,为产品或流程及其变更做出决策。公开基准测试主要有助于了解更广泛的行业现状,并筛选出组织或工具中值得进一步探索的方向。That leads into distinguishing public benchmarks from evaluations and how to interpret them. An evaluation means making measurements to make a decision about your product or process and changes to it. Public benchmarks are primarily helpful for understanding the broader landscape and creating a shortlist of what to explore within your organization or tooling.

不要过分看重这些结果,因为不同模型的训练表现起伏较大。如果你是一家律师事务所,除非打算让开发人员使用编码智能体,否则不一定需要关注终端基准测试结果。确保配置能够反映你的实际环境。You do not want to over-index on those results because of the spiky nature of the training of different models. If you are a law firm, you do not necessarily want to look at terminal bench results, unless you are looking to incorporate coding agents with your developers. Make sure the configurations reflect your actual environments.

将基准测试视为用于比较的标准化参考集。除了公开基准测试,你还可以在组织内部建立基准测试,尽可能贴近实际工作负载。构建一个迭代式飞轮流程,通过持续爬坡,不断优化配置。Think of benchmarks as a standardized reference set for comparison. Alongside public benchmarks, you can set up benchmarks within your organization that reflect actual workloads as closely as possible. Have an iterative flywheel process in which you increasingly hill-climb to optimize your configurations.

像科学家一样设计评测Designing evals like a scientist

尽你所能,以科学家的方式来处理。筛选出可能的配置方案后,考虑可以调整哪些变量,以确保结果能反映你的系统。Approach this as a scientist to the best of your ability. Once you have shortlisted your possible configurations, consider the variables you might change so that the results reflect your system.

考虑工作负载覆盖。选择能够反映实际工作的任务,并将它们归入不同类别。我创建编码基准测试时,之所以另做了一套完全不同的基准测试,是因为当时 STB bench 基本上只涉及修复 bug。实际上,在整个软件开发生命周期中,还有大量与开发者相关的其他任务。Think about workload coverage. Pick tasks that are reflective of the work, and cluster them into different families. When I made the coding benchmark, the reason I built a whole different one was that, at the time, STB bench was largely just bug fixing. There is a whole other swath of tasks relevant to developers across the software development life cycle.

将工具集成到这些工作负载中的方式可能有所不同。例如,模型在理解代码方面可能比在修复错误方面更有效。你还需要考虑要运行多少次。这些系统具有非确定性,因此每次运行的结果可能有所不同。How you integrate tooling into those workloads may differ. A model might be more effective at code understanding than at fixing a bug, for example. You also need to consider how many runs to do. These systems are non-deterministic, so you may see variation from run to run.

正如我通过模型和测试框架配置所展示的那样,请思考各种潜在变更的组合如何产生交互效应。这些效应可能会如何影响后续结果?As I showed with the model and harness configurations, think about how combinations of potential changes create interaction effects. How might those influence downstream effects?

追踪整个流程管线Trace the whole pipeline

尽可能多地收集可观测性数据。保留所有追踪记录。这又回到了第一个示例:到底发生了什么,为什么智能体没有调用工具?Gather as much observability data as possible. Retain all your traces. This goes back to the first example: what is happening, and why is the agent not calling the tool?

首先,梳理智能体可获取的全部上下文。工具是否可用?如果不可用,就停在这里并修复这种情况。然后确认是否调用了该工具,以及它返回了哪些值。继续沿着可用信息的传递链逐步排查。First, break down the entire context available to the agent. Was the tool even available? If it was not, stop there and fix that scenario. Then ask whether it was called and what values it returned. Keep going along the pipeline of available information.

假设我做了一项改进,智能体终于开始使用好得多的工具,但任务结束时我所关心的结果仍然没有变化。你可能有一个非常出色、正在全力优化的工具,但由于智能体、配置或其他某些原因,智能体并没有利用这些信息。接下来,你的工作就是调查并解决这个问题。Suppose I make an improvement and the agent finally uses the much better tool, but the outcome I care about at the end of the task still does not change. You can have a beautiful tool that you are really optimizing, but, for some reason involving the agent, configuration, or something else, the agent is not using that information. It is then your job to investigate and fix the problem.

像侦探一样调查、了解系统中实际发生的情况时,要把未使用情况、失败的尝试以及其他信息都考虑在内。你还需要控制自己进行的测量。Keep non-use, failed attempts, and the rest of this information in mind as you act like a detective to understand what is actually happening in your system. You also need to control what measurement you are making.

选择你要衡量的内容Choose what you measure

在比较不同的搜索工具时,我感兴趣的是如何针对类似 F1 分数这样的指标进行优化,在精确率和召回率之间取得平衡。以 grep 为例,Claude 把能搜到的东西全都搜了出来:它返回了 295 个文件,而实际上只需要 6 个。When I compared different search tools, I was interested in optimizing for something like an F1 score, balancing precision as well as recall. In an example involving grep, Claude was pulling in the entire kitchen sink: it returned 295 files when it only needed six.

如果我只在乎搜集每一条可能相关的信息,那么召回率为 1 也许就足够了。但我感兴趣的是针对一种完全不同类型的价值进行优化。If all I cared about was pulling in every possibly relevant piece of information, perhaps a recall of one would be sufficient. But I was interested in optimizing for a completely different type of value.

当你查看公开基准测试中的单一数值评分时,这一点很重要。验证器实际上测量的是什么?为什么这被认为很重要?你需要什么,完全取决于你的业务需求。This matters when you look at single-number scores in public benchmarks. What was the validator actually measuring, and why was that considered important? What you want depends entirely on your business needs.

真正能阻止工作继续的质量门禁Quality gates that actually stop work

评测、质量门槛和评审之间存在一个有趣的交集。我想从信任与安全的角度谈谈这一点。There is an interesting overlap between evals, quality gates, and reviews. I want to touch on that in terms of trust and safety.

我一直在尝试搭建一个带有不同审批队列的软件工厂。我希望尽可能多地实现工作自动化,但我完全不信任这些系统,因此会定期进行审计。I have been experimenting with a software factory with different approval queues. I want to automate as much of the work as possible, but I do not trust these systems at all, so I have regular audits.

例如,我提交了一项工作请求,其中包含审批流程和必要的检查。代理发现事情正在出问题,但没有机制可以强制停止。For example, I put through a request for work to get done, with approval and required checks. The agent noticed that things were going wrong, but there was no mechanism to enforce a stop.

你需要将智能体或其他系统标记某事项的操作,与在代码中强制执行该门控机制的操作解耦。然后,考虑最终如何将该事项升级交由人工处理。你还需要平衡人工审核的工作量。You need to decouple an agent or another system flagging something from enforcing that gate in code. Then consider how that is eventually escalated to a human. You also need to balance the human review load.

人工审核瓶颈The human review bottleneck

这个示例来自对另一个系统中“LLM-as-a-judge”故障的审计和修复。当时他们发现误报率为 1%。如果所有触发的警报都交由人工处理,就会产生 10,000 次审核。贵组织是否有足够的领域专家来承担这项工作?This example comes from auditing and repairing LLM-as-a-judge failures in a separate system. They were seeing a 1% false alarm rate. If all the alarms raised go to a human, that would result in 10,000 reviews. Does your organization have the capacity for domain experts to do that?

想想瓶颈可能在哪里,以及如何调整警报频率。这些警报会带来多大影响,又会如何影响下游结果?Think about where that bottleneck might be and how to change the alarm rates. How consequential are those alarms, and how will they affect downstream outcomes?

我们还需要考虑到,智能体轨迹本身有时可能不可靠或不可信。We also need to consider that the agent trace itself can sometimes be unreliable or untrustworthy.

当无法信任代理的记录时When the agent's record can't be trusted

在这个示例中,研究人员在提供给智能体的信息中植入了不同的安全问题。他们设置了哈希校验来检测系统是否遭到篡改。在这种设置下,所有测试都通过了:它没有发现任何植入的安全问题。In this example, researchers seeded different security issues into information provided to the agent. They had a hash check in place to detect tampering with the system. With that setup, everything passed: it did not notice any of the injected security issues.

但一次独立的记录比对查看了流量历史和模型变更,并检测到了所有情况。根据系统的安全需求,以及你衡量和观测当前情况的方式,确保你足够信任所留存的事件记录。But an independent record comparison that looked at the traffic history and model changes detected everything. Depending on your system's security needs and how you measure and observe what is happening, make sure you have sufficient trust in the record you retain of what happened.

生产环境才是真相Production is truth

这让我们回到对与你的具体任务负载相关的实际工作进行评估。确定一个目标工作对比对象。This brings us back to evaluating realistic work associated with your particular task loads. Identify a target work comparison.

我现在在 Omni 大量从事这类工作,负责他们的评估框架。我们会查看内部生产数据,了解用户如何与智能体交互,并对他们所做的不同类型的操作进行分类。就我们的情况而言,这包括从简单到较难的问答、仪表板搭建和应用开发。实际测试有多种分类方式。I am doing a lot of this at Omni right now, working on their evaluation harness. We look at internal production data to see how users interact with the agents and classify the different types of things they do. In our case, that includes Q&A ranging from easy to harder questions, dashboard building, and app building. There are different ways to classify the actual tests.

然后判断系统变更是否带来了价值,或者下游故障出在哪里。我们正努力找出能够代表实际工作负载的代理场景,但归根结底,生产环境才是最终的检验标准。Then identify whether changes to the system are adding value, or where the downstream failures are. We are trying to come up with representative proxies for actual workloads, but ultimately production is truth.

部署变更后,你需要建立测量系统,在系统实际运行的环境中收集相关数据。当直接进行变更不够可靠或可能造成更大影响时,也可以在影子模式下收集信息。After deploying changes, you need measurement systems that collect relevant data in the actual environment where the system runs. You can also do this in shadow to gain information when making a change would be less trustworthy or have a higher blast radius.

何时升级至人工处理When to escalate to a human

最终,应针对可观测性和能够反映系统实际部署环境的场景进行优化,这样你才能信任测得的数据。明确你愿意承担的风险程度。Ultimately, optimize for observability and realistic environments that reflect where your system will be deployed, so you can trust the values you measure. Identify the level of risk you are willing to accept.

在我自己的系统中,比如软件工厂,我会让代理在风险较低的决策上拥有一定自主权。它会确定下一步行动、说明为何需要人工介入,以及明确操作范围。它还会根据可选方案考虑可能的人工检查。Within my own systems, such as my software factory, I give the agent some autonomy in lower-risk decisions. It identifies the next action, why human input is needed, and the operating scope. It also considers potential human checks given the available options.

明确自主部署的安全边界,以及何时应停止并升级给人工处理。Establish boundaries for when it is safe to deploy autonomously and when to stop and escalate to a human.

我有一个 GitHub 仓库,里面收录了我钻研过的各种技能。其中有几项与评估设计、测试框架可追溯性和可靠性流程直接相关。我还有一部庞大的 300 页档案巨著,可以让你的智能体参考。你可以让智能体参考这些内容,将其中一些最佳实践融入你的系统。谢谢。I have a GitHub repository with different skills I have worked on. A few are directly relevant to evaluation design, harness traceability, and reliability procedures. I also have a monstrous 300-page archive tome that you can point your agents at. You can point your agents at all of this to bring some of those best practices into your systems. Thank you.

值得记下

  1. 你想要什么,完全取决于业务需求。
  2. 你还需要平衡人工复核的负载。
  3. 明确自己愿意接受多大程度的风险。

← 回到本期 · 第 13 条