Arize 动手工作坊:如何编写你的第一个 AI Eval AI Engineer 2026-10-25

Arize 动手工作坊:如何编写你的第一个 AI Eval

关键字 ai-eval llm-as-a-judge observability trace
16 节

自我介绍与工作坊目标

[音乐]

嗯,在开始之前,我想先自我介绍一下。我是 Sally Ann,担任 Arize 的产品负责人。嗯,在 Arize 已经大约 4 年了。嗯,我负责的首批项目之一,其实就是把我们的 AI Agent Alex 构建到平台中。所以,我已经处理 Eval 有一段时间了,嗯,甚至构建了我们的许多 Eval 产品。因此,我认为我对 Eval 的理解是:它们是我们 Agent 的主要信号。嗯,这涵盖了我们在 Arize 的所有 Eval。

所以,我今天的目标是让大家在离开时收获三样东西:

嗯,明确 Eval 是什么、不是什么;能够编写你自己的标准。所以,我希望能够为大家提供一份小“配方”,告诉你该如何思考 Eval,以及如何将其应用到你的任何实际 Agent 场景中。然后,我们实际上要在 Arize 中构建一个可运行的 Judge(裁判)。嗯,我会向大家稍微展示一下这里的生命周期,以及你可以如何考虑随着时间的推移不断改进你的 Eval。

英文原文 [music]

Um, before we get started, I just wanted to introduce myself. I'm Sally Ann, and I'm head of product at Arize. Uh, been at Arize for like 4 years now. Um, one of the first projects that I owned actually was building our AI agent Alex into our platform. So, I've been dealing evals for a little while now, and uh, even building a lot of our evals product. And so, I think the way that I think about evals is that they're our primary signal for our agents. Um, and that includes all of our evals at Arize.

So, my goal today is you'll leave with three things.

Um, a clear definition of what an eval is and what it isn't. Uh, being able to write your own criteria. So, I'm hopefully going to be able to provide you with like a little bit of a recipe uh, for how you can think about evals and how you can apply that for any of your real agent scenarios. And then we're actually going to build a working judge in Arize. Um, and I'll show you a little bit about the life cycle there and how you can think about improving your evals over time.

工作坊议程与现场情况

这是我们的大致议程。再次说明,我会给大家提供一点背景信息。我不想在幻灯片上花太多时间,但我想确保每个人都对什么是 Eval 以及应该如何看待它建立起扎实的基础。嗯,我们要在 Arize 中一起探索一些数据,嗯,编写我们的标准,然后我们实际去构建我们的 Eval。这是我们今天工作坊的核心部分。

嗯,然后我会给大家讲一点关于接下来可以往哪里拓展的内容。嗯,我很喜欢有一些工作环节,这样大家可以互相协作。我会尽量在房间里巡视,为大家提供帮助。嗯,然后我会展示一份在 Notion 里的类似一页纸说明(one-pager),大家可以打开跟着一步步操作。

那么,先摸一下现场底细。在座有谁发布过 Chatbot 或 Agent、写过 Eval,或者哪怕今天刚刚打开过 Arize 产品?有人吗?

好的,我们这儿有几位朋友。所以,我认为这对于可能还没做过这些的人来说会非常棒,而且就算你做过,我觉得今天的内容应该也依然很有帮助。

英文原文 So, this is a bit of our agenda. So, again, I'm going to give you a little bit of context. I don't want to spend too much time in slides, but I want to make sure everyone has a really solid foundation for what an eval is and how you should think about it. Um, we're going to explore some data in Arize together, um, write our criteria, and then we'll actually go build our eval. That's the main part of our workshop today.

Um, and then I'll give you a little bit of like where you could take this for what's next. Um, I love it to kind of have some like working sessions so people can collaborate together. I'll try to like walk around the room, help folks out. Um, and then I will show kind of like a one-pager that's in Notion that you can kind of open and follow along as well.

So, just check the room a little bit. Who here has either like shipped a chatbot or an agent, ever written an eval, or even just opened the Arize product today? Anyone here?

All right, we got a a few folks here. So, I think this is going to be great for folks who maybe haven't done any of this and even if you have, I think today should still be pretty helpful.

为什么“凭感觉”无法规模化扩展

所以,先从背景开始,谈谈为什么我认为“凭感觉检查(vibe checks)”实际上无法规模化扩展。这就是我所看到的氛围问题:

你知道,周一,你可能对 Prompt 做了点改动,发布上线了。整体感觉更好了。你其实没办法确定,但大体上看情况还不错。

周二上线,一周之后,你当时发布修复的那个用例挂掉了。

然后到了下周,随着问题不断恶化,根本没人能够证明某个问题到底是被修复了,还是其实是失败了。只能靠感觉来判断。

没有 Eval 你就做不到的事包括:改了 Prompt 时,你无法检测出回归。

你无法客观对比 Prompt,甚至无法对比不同的模型版本。你不知道新模型对你的用例来说是否更好,而且在你发布 Agent 时,你无法在 CI 中设置任何正式的质量关卡。因此,没有 Eval,你可以想象,实际上很难知道你的 Agent 表现到底如何。

英文原文 So, going to start off the context with like why I don't think vibe checks actually scale. So, this is the vibes problem as I see it.

You know, you have Monday, you maybe change something to your prompt, you ship it. It overall feels better. You don't really have a way to know, but overall things are looking good.

You know, Tuesday ship it, a week later now that use case that you shipped a fix for is broken.

And then next week, as the problem continues to get worse and worse, there's no way for anybody to prove whether something was fixed or that it's actually failing. have vibes to go off of.

What you can't do without evals is you can't detect regressions when you change a prompt.

You can't objectively compare prompt or even different model versions. You don't know if a new model is any better for your use case and you can't actually put any official quality gates into CI as you're shipping your agent. So, without evals it's you can imagine it's it's pretty hard to actually know how your agent is performing.

Eval 与单元测试的区别以及 Trace 的必要性

我常被问到的一个问题是:Eval 难道不就是单元测试吗?

我认为很多人会把 AI Eval 拿来与传统的软件测试做对比,而我确实认为它们有点不同。因为首先,对于测试,你通常只有一个输入,并且对应一个正确的输出。你还可以阅读代码中的所有逻辑。而对于 AI Agent,你实际上根本无法阅读那部分逻辑。那部分实际上是在事后以 Trace(追踪)的形式呈现出来的。

所以,你有点需要这种 AI Eval,可以在其中查看比如我这里展示的行程规划器示例里的逐日行程、预算拆解,或者基本上是多项标准。因此,存在许多有效的输出,你根本无法像对传统软件那样给它做传统的单元测试。

所以,我通常是这么理解的:Trace 是 AI 的日志,Eval 则是真正的测试。而且我常说——我以前做过一个表情包,今天没放进来——但难以下咽的真相是:你其实需要 Trace,你需要可观测性才能真正做 Eval。

英文原文 A question I commonly get is is an eval just a unit test?

I think that there's a lot of comparison of AI evals to like kind of traditional software tests and I do think that they're a little bit different. Cuz first off, with a test you kind of just have like one input and there's one correct output. You can also read all of the logic in the code. With an AI agent, you actually cannot read any of that logic. That actually comes out after in the form of traces.

And so, you kind of need to have this AI eval where you can look at like the day-by-day itinerary in this travel planner example I have here, the budget breakdown or multiple criteria basically. So, there's these many valid outputs that you just can't have, you know, a more traditional unit test on like you can with software.

So, basically how I like to think about this is traces are the logs for AI Um, evals are actual tests. And I always say that uh uh I used to have a meme, I didn't include it today, but the hard pill is you kind of need traces, you need observability to actually do your evals.

Agent 复杂性与 Trace 结构

所以,这里有一个例子说明为什么 Agent 会让这件事情变得更困难。这只是一个 Trace 可能长什么样的简单示例。对于房间里可能还不熟悉 Trace 是什么的人来说,嗯,本质上它是 AI Agent 为了向一个响应返回答案所采取的所有步骤。也就是用户说了什么,然后我在这里所有 Span(跨度)中展示的,就是 Agent 为了得到答案所执行的所有单独步骤。

在这个示例中,比如有一个 Research Agent 会去执行一些调研,嗯,甚至可能在其中进行一些工具调用。你有本地的 Agent 可能会从知识库中检索内容。因此,有很多来回往复在发生。而这就是我所说的能看到 Agent 逻辑的地方。嗯,我们稍后会在 Arize 界面里浏览一些 Trace。嗯,你可以看到有大量的 LLM 调用,很多组件组合在一起。所以你可以想象,仅仅像传统软件那样有一个单一的单元测试,并不能真正准确地捕捉到 Agent 中包含的所有复杂性,也没办法告诉我们它的表现如何。

英文原文 So, this is an example here for why agents make this harder. So, this is just a sample example of what like a trace could look like. And for anybody in the room who's maybe not familiar with what a trace is, um essentially it is all of the steps that an AI agent took to be able to get an answer back to a response. So, a user says something and then what I'm showing here in all of those spans is all the individual steps the agent took uh to get that answer.

So, in this example, there's like a research agent that's going to go perform some research, uh maybe even do like some tool calls there. You have, you know, your local agent that's maybe retrieving something from a knowledge base. So, lots of back and forth are happening. And this is where I mean you can see the logic of your agent. Um, and we're going to explore some traces in the Arize UI just a little bit. Um, so you can see there's lots of LM calls, lots of things composed together. And so, you can imagine just having one single unit test like in software not really going to accurately capture all the complexity that's in an agent and be able to tell us how it's performing.

Eval 的类型与分类

实际上有很多不同类型的 Eval。今天,我们重点关注 LLM as a judge。嗯,LLM as a judge 就是我们引入第二个 LLM,让它来对我们 Agent 的某些方面进行打分评级。嗯,所以可以评定问答(QA)、摘要、相关性等内容,然后你从中得到一个标签(Label)和解释(Explanation)。解释非常有用,解释有点像是给出该标签背后的推理或思考过程。它能让你获得一些理解,而不仅是被动接受一个表面标签。不过,还有很多不同类型的 Eval。

我想提一下决策模型(Decision Models)。呃,这是相当新的东西。呃,如果有人经历或参与了大约两周前发生的 Jevas a Job 风暴,而且 OpenAI 就在上周发布了他们的 Decision Model API。所以,我认为决策模型在未来会成为 Eval 中非常重要的一部分。嗯,它们非常便宜且快速,它更像是一种问答形式,你直接得到一个概率和一个输出,看它是 true 还是 false 或者是一个标签。所以你不会得到像 LLM-as-a-judge 那样的解释。

另一种 Eval 类型是代码(Code)。呃,这些非常适合任何确定性测试。比如你可能有一些 Eval 标准是检查输出中是否包含某个词,或者确保内容是 JSON 格式。呃,对于基于代码的 Eval 来说非常合适。还有像 ROUGE 和 BLEU 分数,也是常见的代码 Eval。

嗯,我也把**人工标注(Annotations)**视为一种评估形式。这是我们在 Golden Dataset(黄金数据集)上拥有 Golden Truths(基准真实值)。嗯,有时它们也是合成生成的。

Agent as a judge 是我们在过去大概 6 个月里看到的一种较新的 Eval 类型。嗯,那是我们拿出一个完整的 Agent,去评估另一个 Agent 里的某些东西。我认为这对于极其复杂的成功标准来说非常适合。

然后我们还有用户反馈(User Feedback)和业务指标(Business Metrics),最后的这三项更多是用于你的生产环境用例。但你会注意到,前四项是在开发期和生产期的整个生命周期中都想要使用的。嗯,这一点非常重要,因为你希望它能随着用例的发展而演进,你不想在开发期投入大量精力然后直接扔掉。那些 Eval 可以随着时间陪伴你一同成长,并为你提供一致的表现。

英文原文 There's actually lots of different types of evals. Today, we're going to focus on LM as a judge. Um, LM as a judge is where we take a secondary LLM and we ask it to grade some aspect of our agent. Um, and so, there can be things like QA, summarization, relevance, and then you get a label and an explanation out of that. Explanations are really helpful. Explanations are kind of like the the reasoning or the thinking behind providing a label. It gives you a little bit of understanding and not just have to take a label at face value. But, there's lots of different types of evals. I want to call out decision models. Uh this is something that's pretty new. Uh if anybody kind of took or was a part of the the Jevas a Job storm that happened about 2 weeks ago and OpenAI just last week released their decision model API. So, I think decision models are going to be a huge part of evals in the future. Um, those are pretty cheap and fast and it's uh more like a question answer and you just get like a probability and an output whether it's like a true or false or a label. So, you don't get that explanation that you get with Elements of AI Judge.

The other type of eval is code. Uh, these are really great for any deterministic tests. So, maybe you have some eval criteria that's like checking if a word is in an output or making sure that something's in JSON. Uh, that's going to be really great for code-based evals. There's also things like Rouge and Blue scores that are popular code evals.

Um, annotations I do see as a form of evaluation. This is where we're having uh you know, golden truths on golden datasets. Um, sometimes they're synthetic as well. Um, agent as a judge is a newer type of eval that we've seen maybe over the last 6 months. Um, that's where we're going to take a full agent and evaluate something in a different agent. I think this is really good for super complex um like success criteria. Um, then we have user feedback and business metrics and those three at the end are going to be more for your production use cases. But, you'll notice the first four are something that you want to use across your life cycle in development and production. Um, and that's pretty important because you want this to be able to evolve with your use case and you don't want to like put a lot of investment in something you're using in development and just throw it away. Those evals can grow with you over time and it gives you that consistent um performance.

动手准备:登录与配置模型 API Key

好的,让我们来看看数据。嗯,我们在这张幻灯片上停一下,给大家几分钟时间准备开始。那个二维码对应的是 One-pager,里面包含我们今天工作坊的所有操作指南。

嗯,不过我希望这里的每个人都前往 app.arise.com。呃,我们想登录 AX。所以,如果你没有账号,嗯,建议你今天注册一个免费账号。嗯,稍后我会马上讲接下来的步骤。嗯,对于可能已经有 Arize 账号的人,下一步就是从模型供应商那里获取一个 API Key。所以我会先暂停一下,呃,在场内走走,确保大家在登录平台时没有任何问题。

刚才的问题是:是否必须使用常见供应商,还是在第二步可以使用自定义 Endpoint?

不用,你可以随意配置任何你想要的 LLM 供应商。我们只需要一个能向其发起 LLM 调用的东西,以便测试我们的 Eval。不过第二步基本上就是去你的 Anthropic 控制台、OpenAI 控制台,或者任何你选择的供应商。

你可以在产品内的 Settings(设置)下找到 AI Providers,我们只需要把那个 API Key 添加进去。那么,让我打开电脑,带大家稍微看一下该怎么做。

导航栏里的 Settings。点击进去,然后在你的账户设置下,我切一下——

太棒了。

你会来到 AI Providers。你可以看到这里有很多不同的供应商。所以,选一个你最喜欢用的就行,Anthropic、OpenAI、Gemini 都无所谓。只要是能让我们用来发起 API 调用的都可以。

我建议你在操作时点击一下 Test Integration 按钮,确保我们配置的 API Key 是可用的。

好的,对于大家来说,你会找到 Demo 项目。抱歉,我退回去一下。只是想确保大家有时间跟上,但你可以通过两种方式之一访问我们将要使用的 Demo 项目。第一种是当你进入这个 Tracing 页面时,会看到“See demo project”。

我这里显示的是 LLM agent。我知道有些人的环境里可能是我们较老的 Demo 模型。具体是哪一个没有关系,你都可以完成我们今天的练习。

我们只是想能够查看一些 Trace。

如果你想查看更多数据,可以展开时间范围,不过我再给大家几分钟时间,因为我刚才只看到少数几个人配置好了 AI 供应商。我也看看能不能找一个账号让大家可以临时共享一下。

英文原文 All right, let's go ahead and look a little bit at the data. Um, so we're going to pause here on this slide give everyone a few minutes to go and get started. That QR code is going to be for the one-pager which has all of the instructions for our workshop today. Um, but I want everyone here to go ahead to go to you know, app.arise.com. Uh, we want to log into AX. So, if you don't have an account um encourage you to make a free um account today. Um, and then I'll go over the steps from there in just a second. Um, and for anybody who already I guess might have an arise account, the next step is going to be getting an API key from um a model provider. So, I'll pause there uh walk around make sure nobody has any issues logging into the platform.

The question was, can you do you have to use like can you use a custom endpoint? Do you have to use a a common provider for step two?

No, feel free to set up whatever LLM provider you want. We'll just want something that we can make LLM calls to so we can test our eval out. But yeah, step two basically go to your Anthropic console, your OpenAI console, whatever provider of your choosing.

You can find your AI providers under settings in the product and we're just going to want to go ahead and add that API key in. So, let me go to my laptop here and show you all a little bit of how to do this.

So, settings here in the nav. You're going to go click into that and then under your account settings, let me try to

Cool.

You're going to come to AI providers. And you can see here we have a whole bunch of different providers. So, just choose one that is your favorite to use, Anthropic, OpenAI, Gemini, doesn't matter. Just something that we can use to make API calls with.

And I encourage you to use the test integration button when you're doing that just so we can make sure we have a working API key.

Yeah, for for folks you'll find the demo project. Sorry, I'll go back. Just trying to make sure everyone has time to to catch up, but you can access the demo project that we're going to use in one of two ways. The first is on from this when you go to this tracing page here, you'll see see demo project.

I have the LLM agent. I know some folks might have our older demo model there. Does not matter which one you have, you should be able to do our exercise today. So, we just want to be able to look at some traces.

And you know, you can expand the time if you want to see a little bit more data there, but give everyone a few more minutes cuz I only saw a handful of hands that got the AI provider. and to see what I can do to see if I can get one that we can share really quickly, too.

探索旅行规划 Agent 的 Trace 数据

好了,如果你打开了 Travel Agent Demo 项目,这是一个旅行规划 Agent。它接收用户的请求,然后能够提出后续追问、调用工具,并最终返回一份规划方案。

从产品角度来看,我认为“表现良好”的标准是:它回答了用户提出的后续问题,并且符合该行程的天数和预算。通常用户请求就是长这个样子。你可以看到目的地、他们想去多久、预算是多少,以及他们大致的旅行偏好风格。这就是我们可能会从访问该旅行 Agent 的用户那里看到的示例。

所以我希望大家花几分钟时间。我们想查看一下 Trace。我们基本上是要做个盘点:用户在请求什么?Agent 做了什么?有哪些工具,输出的答案是什么?

然后记录一下:这是你会愿意分享给用户的答案吗?所以,就是去探索数据并熟悉它。

是的,打开一两条 Trace,在浏览这些数据时,开始稍微思考一下你想衡量什么。举个例子,让我切换到产品界面。我把我的时间范围放宽到了上一天。

让我们来看其中一条 Trace。你可以看到,这里的目的地是捷克共和国布拉格,为期 3 天,预算 800 美元。用户要求提供一个感觉更本土化、没那么偏游客化的方案。

我们这里有一些大致思路,然后我们可以开始查看旅行规划 Agent 生成的方案。这里有详细的第一天、第二天、第三天。如果你想看任何额外的 Attributes(属性)或数据,可以在 Attributes 中查看。关于如何在我们的产品中进行导航:

同样,这是 Trace 树。这是每一个单独的步骤。如果你想看某一步传入的数据,比如我们想看输入到 OpenAI 以处理请求的数据,我们可以切换到那个 Span,然后查看输入和输出。

我们稍后会讲到这里,但我们需要注意数据存放在哪里,以及我们认为需要哪些数据来执行 Eval。所以我们将花几分钟时间在这里探索,看看能发现什么。

英文原文 All right, so if you have that travel agent demo project opened, this is a travel planning agent. It takes a request from a user and then can it make follow-up questions, call tools, and basically returns a plan.

What I think good looks like in product terms is it answers the follow-up questions the user asked for and respects the trip's days and budget. So, this is generally what a user request looks like. You can see the destination, how long they want to go, what their budget is, and what their kind of general travel style looks like. And that's an example of what we might see from a user who goes to this travel agent.

So, I'd love for everyone to take a a few minutes. We want to look at the traces. We kind of want to just take inventory. What are users asking for? What did the agent tool do? What tools, what are the answers?

And then just kind of make note, was this an answer that you would share? So, just want to kind of explore the data and get familiar with it.

As yeah, open one or two traces and maybe start thinking a little bit about what you'd want to measure as you're you're looking through the data here. So, as an example, let me hop on over to the product. I explained mine to last day.

Let's go ahead and take a look at one of these traces. So, you can see here, this destination is for Prague, Czech Republic, for 3 days, $800 budget. The user asked for an option that feels more local, less touristy.

We have some kind of our ideas here and then we can start to view the plan that the the trip planning agent created. So, you have a detailed day one, day two, day three. And if you want to see any additional, you know, attributes, any additional data that we have, you can see that in attributes. And so, a little bit of how to navigate our product here. So, again, this is the trace tree. This is every individual step. If you want to see the data that was passed in for a step, like for example, we want to see the data that went into OpenAI to process our request, we can switch to that span and then look at the input and output.

So, we're going to get to this in a little while, but we want to pay attention to where the data lives and what data we think might be needed to do any of our evals. So, we'll spend a few minutes here just exploring and seeing what kind of insights we find.

解读 Trace 树:Root Span、子 Span 与调用逻辑

收到了一些关于在哪里找到实际数据的问题,所以我再演示一次。

很多时候在新的 Space 里面可能会有点隐蔽,但我今天不想让大家在追踪定位上花太多时间,毕竟我们今天是来讨论 Eval 的。所以,你只需要点击导航栏上的 Traces 选项。这会引导你在 Arize 中开始,但我们直接点“See demo project”,然后你就可以在 Recently Viewed(最近查看)里找到它。

你可以随时展开时间范围以查看更多数据。

大家一般都找到项目并大致看了一眼了吗?看到几位点头了,我们再给点时间。我知道,这就修。

好的。所以,在进入下一部分之前,我希望大家现在做的事情,就是看一下这个 Agent,思考你会如何衡量这个 Agent,或者说如何衡量这个 Agent 的成功。把自己代入为产品经理、工程师或者该项目的任何实际利益相关者,查看 Trace,查看用户是如何与它交互的、它是如何响应的,并开始在脑海中记录下你会去衡量的指标。在工作坊的下一部分中,我们实际上要开始定义那项标准到底是什么,但在你浏览的过程中,先从宏观上思考一下你会衡量的那些点。

是的,刚才的问题是关于我们应该如何理解这里的 Trace 读取。

再次向可能还不熟悉的人说明,Trace 本质上是 Agent 为回答用户问题所采取的所有步骤的集合。让我们打开这一个。

在顶部,我们称之为 Root Span(根跨度)。技术定义是 parent_id = null。这意味着这个 Span 前面没有任何东西,它就在最顶层。这里通常是输入和最终输出所在的位置。

然后从那里开始,我们有各个单独的 Span。每个 Span 都是我们所说的一个工作单元。让我们来看看这第一组 Span。从 Root Span 开始,除了调用其他一些 Agent 之外,这个 Agent 做的第一件事看起来是调用了 Research Agent。

这就是我们所说的多 Agent 系统(Multi-agent System),其中有多个 Agent 代表更大的主 Agent 执行不同的任务。在第一个步骤中,我们有 Research Agent,它会去调用一个工具。每一个都有类型,你可以看到不同的图标。这是一个 Agent Span,这是一个 Tool Span。Tool Span 用于获取外部数据。你可以想象,比如在这个调研中,有些关键信息我们需要获取,比如天气、景点或者礼仪之类的内容。

然后从那里开始,我们要使用一个 LLM。你可以在这里看到实际传入 LLM 的所有输入和输出。这就是你的简洁旅行 Agent。

它利用来自该工具的信息来进行总结,以便我们在后续步骤中使用。你可以沿着 Trace 树像这样一步一步往下看。

你可以看到它们是如何关联起来的,但每一个都在执行一个步骤或工作单元,从而最终能够生成回答。同样,这个应用的目标是查看用户的旅行请求并为他们规划行程,根据他们的偏好提供包含活动、住宿等内容的行程单。这些 Span 就是为了最终得到这份最终行程单而执行的工作单元。对此有什么问题吗?在推进的过程中,我很乐意回答一些关于 Tracing 的问题。

英文原文 Getting some questions about where to find the actual data here, so let me just show that one more time.

A lot of times in the new spaces it can be a little hidden, but didn't want folks to spend too much time tracing today when we're here to talk about evals. So, you'll just want to click the traces option on the nav here. This will kind of prompt you to get started with the rise, but we're just going to go to see demo project and then you can see it in recently viewed from there.

And you can always expand the time to see a little bit more data there.

Has everyone generally had time to like find the project, take a a quick look? See if you had nods, we'll give I know. Like fix that.

All right. So, basically what I want folks to do now before we get into the the next part of of this, is just like look at the agent and think about how you would measure this agent or success for this agent. Think of yourself as the product person, engineer, any real stakeholder of this project and look at the traces, look at how users are interacting with it, how it's responding, and start making kind of like mental note of what the things are that you would measure. In the next part of the workshop, we're actually going to start defining what that criteria would be, but high-level as you're going through, think about some of those things that you would measure.

Yes, so the question was like how we should think about reading a a trace here. So, again for for anyone who may be just not familiar, a trace is essentially a collection of all the steps an agent took to answer a user's question. So, let's go ahead and open this one here.

So, at the top we call that our root span. Like the technical definition of that is parent ID equals null. This means that this span here doesn't have anything ahead of it. It just sits at the top. And this is usually where the input and final output live.

And then from there we have our individual spans. So, each of these is what we call a span. I like to think of it as a unit of work. So, let's take a look at this first collection of spans here. So, from the root span the first thing that this agent did along with calling some other agents it looks like called the research agent. So, this is a what we call a multi-agent system where there's multiple agents doing different tasks on behalf of the bigger agent. So, in this first one we have the research agent and that is going to go ahead and call a tool. So, each of these has like a type you can see it different icons. This is an agent span. This is a tool span. Tool span that's going to be for getting external data. So, you can imagine like in this one research there's some essential info that we have to grab like things like weather or sites or adequate things like that.

And then from there we're going to use an LLM. You can see here all of the inputs and outputs that actually went into the LLM. So, this is your concise travel agent. And this is using that information from that tool to actually summarize that we can use it in a later step here. And so you can just go down the trace tree just like that like one step at a time.

You can see how they all connect but each of these is going to be doing a step or unit of work so that it can go ahead and answer. So, again the goal of this application is to look at a user's request for a trip and plan it for them. Give them an itinerary of things that they can do, places they can stay all in accordance with their kind of preferences. And so each of these spans is the units that were done to ultimately get this final kind of itinerary. Any questions on that? Happy to answer some questions about tracing while we're we're going through this.

现场答疑:多个 LLM Span、架构灵活性与框架支持

是的,问题是这里为什么会有两个 LLM Span。

好的,有时候我会回头看当时到底发生了什么的具体 Trace。

有时候这是打点(instrumentation)机制在展示不同阶段,比如 LLM 选择要使用的工具,然后把那些信息传递给工具。所以我们来看看这里到底发生了什么。

这也算是打点的一部分。

看起来这里是这样的:我认为第一次 LLM 调用选择了工具,然后在第二次 LLM 调用中,工具的实际数据被传递给 LLM 进行总结。所以在这里——有时候确实挺费劲,你必须沿着 Trace 往下看然后再往回溯。这个 LLM Span 选择了这个工具,然后这个 LLM Span 总结了该工具的输出。那个工具去抓取了温度数据、目的地数据,接着第二个 LLM 基本对其进行了摘要,以便我们后续做进一步处理。

非常好的问题。现场大家可能没听清,这个问题是:是由那个 Root 节点做出所有决策,还是说在运作方式上有一定的灵活性?

答案是有很大的灵活性,这取决于你的 Agent 基础设施是什么。你可以拥有所谓的 Supervisor(主管)或 Orchestrating Agent(编排 Agent),很多时候它会为子 Agent 制定计划去执行;而有时它只是被传递给配备了一组工具的 LLM,每个步骤一步一步执行。所以这稍微取决于你使用的框架、你的基础设施形态以及 Agent 的整体架构。

在目前这个案例中,我相信这是一个 LangGraph Agent,所以我们并没有真正采用 Supervisor 架构。我们只是有几个模块化的 Agent 负责不同的任务。

问得好。刚才的问题是 Arize 支持哪些战略框架。我们对框架是中立(Agnostic)的。我们通过我们的 Tracing 开源包 OpenInference 提供了大量所谓的 Auto-instrumenters(自动打点器)。

我们对使用哪个框架没有偏好。我们的目标是保持高度的灵活性,并在其上为你提供极佳的可观测性和 Eval。

我可以附上我们的文档链接,你可以在那里看到所有支持的不同框架。

英文原文 >> Yeah, so the question is is like there's two LLM spans.

Yeah, so sometimes it's I'll go back and look at the exact trace of what happened there.

Sometimes it's instrumentation of showing the the different like the LLM like choosing the tool to use and then actually like passing that information to the tool. So let's go ahead and take a look at what happened here.

And some of this is just kind of part of instrumentation here.

So this looks like here this way and I think the first LLM call chose the tool and then I think in this second LLM call that's where the actual data of the tool was passed to the LLM to summarize. So here it's kind of hard sometimes you have to go down the trace to come back up. So this LLM span chose this tool and then this LLM span summarized the output of the tool. So that tool went and grabbed that like temperature data, destination data and then the second LLM basically summarized it so that we can do kind of further work with it.

Yeah, great question. So the question for for everyone in case they couldn't hear it is is that kind of root node making all of the decisions or is there some flexibility with how that works? And there's a lot of flexibility. It comes down to what your agent kind of infrastructure is. So you can have what's known as kind of like a supervisor or an orchestrating agent and a lot of times that will make a plan for the sub agents to follow and then sometimes it's just passed kind of to an LLM with a set of tools and each step is goes like one by one. So depends a little bit about like what framework you're using, what your infra looks like and the general architecture of your agent.

In this case here this is a link graph agent I believe. So we're not doing any like supervisor architecture really. Just we have a a few like modular agents that are responsible for different tasks.

Great question. The question was like what strategic frameworks we support with arise. We're agnostic to frameworks. We have a bunch of what we call auto instrumenters available through our tracing package open inference. We don't have a preference of which framework we want to use. Our goal is to be really flexible and provide you with really good observability and evals on top of it. So I can link our docs where you can see all the different frameworks that are supported.

定义标准:从模糊到具体,每次 Eval 只评判一个维度

好的。我们继续往下推进。听起来大家都有时间看了一下 Trace,熟悉了这里的数据,并且希望能发现一些自己用于衡量成功的指标。

定义 Eval 的第一步,是定义什么是“好”。这对很多人来说有时并不容易。因此,针对模糊标准与具体标准,我总结了这样一个实用技巧:

我通常喜欢把“好”是什么写下来,但要用极其具体的标准。与其只写“有帮助”、“准确”、“回答良好”,你应该更加具体一些。比如:回答遵循了用户的追问、符合所要求的天数、总额保持在规定预算之内。对于这个应用而言,这些都是关于什么是成功的非常具体的标准。如果你要为自己的应用构建 Eval,我鼓励你坐下来好好思考这项标准是什么。

我的另一个实用建议是:每次 Eval 只评判一个质量维度。对此有一些例外情况。我想指出的是,特别是对于决策模型和 Agent as a judge,你确实可以做到在一个 Eval 中评判多个标准。但对于 LLM as a judge,大量研究表明,它真正擅长的是一次只处理一个标准。因此我认为良好的实践是:先只考虑其中一个维度,随着时间推移再增加更多 Eval。

构建 Eval 是一个迭代的过程。你不是建好 Eval 后就放手不管,然后它就能保你应用一辈子的平安。你必须不断迭代,所以当我们定义成功是什么样时,我通常会先写下几个,然后开始构建它们,随着时间的推移我们可以逐步增加更多。

我之前提到过我负责过 Alex——也就是 Arize 平台里的 AI Agent。刚开始构建 Eval 时,我的集合非常简单。基本上就是 QA 正确性,我想可能还有用户挫败感,当然还有防越狱、毒性等安全类 Eval。而现在我们在 Alex 上运行着 32 个 Eval。所以你可以看到,你要先从很小的地方开始,然后随着你的应用获得实际使用,你可以立足于真实的生产数据,进而演进你的 Eval,看看还需要什么来定义成功。

英文原文 Okay. Let's keep going a little bit here. Sounds like everyone had some time to take a look at the traces, get themselves familiar with the data here and hopefully was able to spot some things that they would measure for the success. So the first step of defining what your eval is is defining what good means. This is sometimes tricky for folks to do. So I've kind of have this little trick here for vague versus concrete criteria.

I generally like to just write down what good means but with really specific criteria. So instead of just being like helpful, accurate, good response, you want to get a little bit more specific. So answer that follows the user's follow-ups, matches the requested number of days, keeps totals within the stated budget. For this application those are all really concrete criteria for what success looks like. And I encourage you you know if you're ever building this for your application, you know, sit down and and kind of think about what that criteria is.

Another helpful hint that I have is judge one quality per eval. There's some exceptions to this. I like to point out that for especially the decision models and agent as a judge, you can really get away with you know doing multiple criteria in one. But for LM as a judge, there's lots of research that shows that it really only does well with handling one criteria at a time. So I think it's good practice to just think of one of them and then add more evals over time. Building evals sets iterative thing. You don't just build your evals and then like set it and forget and you're set for the life of the application. You kind of have to iterate and so um you know, when we're defining like what success looks like, I usually write down a handful um and then kind of start to build those and then over time we can add more and more.

Um I mentioned I worked on Alex, our AI agent um that lives in Arize and when I first built evals, I had a very simple set. It was like QA correctness. I think I had some like user frustration, and of course like jailbreak toxicity, those types of safety evals. Um and now we have 32 evals that run um on Alex. So you can see how you want to start with something small um and then as your application gets usage, you can ground that in real production data and then evolve your evals to see what else you might need to define success.

通用 Eval 与特定用例 Eval 的取舍

我看到那边有人提问。

是的,问大家的问题是:通用的 Eval 是否比更具体的 Eval 更好?

我认为这完全看情况。总的来说,我认为为你的特定用例构建专属 Eval 是更好的。但我更想说的是:有 Eval 总比完全没有 Eval 好。比如在 Arize,很多人刚上手时,我们有一个 Eval Hub,里面自带了大量开箱即用的模板,非常适合入门起步。我们有像 QA 正确性、幻觉、会话连贯性等各种不同的 Eval,我认为它们非常适合上手,但关键在于——我们今天也会稍微讲到——要将其向你的用例对齐,然后随着时间推移创建更具体的 Eval。所以,我认为基础款以及复用它们(特别是在跨组织复用时)是很棒的,因为拥有一些 Eval 总归更好,然后再逐步将它们打磨得更加具体。

英文原文 I see some questions over there.

Yeah, so the question for the the group is is a generic eval better than a more specific one?

I think it really depends. I think generally speaking, I say building a specific eval for your use case is better. But what I would say is an eval is better than no eval at all. So a lot of folks like at Arize, for example, when they're getting started, we have an eval hub with a bunch of out-of-the-box templates in it and they're really great for starting. We have things like QA correctness, hallucination, uh session coherence, all sorts of different evals and I think they're great for getting started, but the the key is and we'll go through this a little bit today, is to kind of align that to your use case um and then create more specific ones over time. So I think basic ones and reusing them, especially across an org, are great because it's better to have some evals, but then just make them more specific.

实操练习:编写 6 项标准要素与打点建议

好的,先从一个开始,后面再加更多 Eval。

建议两人一组,或者就近组队,我希望大家记下一些想法。基本上,我们需要写下 6 样东西。这对我们接下来实际构建 Eval 会非常有帮助。

首先是任务(Task)。比如你希望这个 Eval 基于什么来评判?成功是什么样,失败是什么样?它们评判的是什么,也就是该评测中 Eval 究竟要评判什么;然后基本上列出关于 Pass(通过)长什么样的三条要点,以及 Fail(不通过)长什么样的要点。记住刚才这张幻灯片讲的:你描述得越具体、越明确,你的 Eval 效果就会越好。因为我们接下来会用到你写的这些笔记去实际构建我们的 Eval。所以我们能写得越具体越好。我觉得这是个很好的机会,可以和身边的人交流一下,看看彼此的想法,以及他们在 Trace 里注意到了什么。我会在场内巡视,有任何问题随时叫我。

我这边收到一个问题:这个应用在 Trace 上的数据格式非常具体,包含了所有请求信息。问题是:这到底是开箱即用的,还是需要针对自己的用例去定制构建?刚才差不多是问这个对吧,确认一下。

答案是:通过我们的开箱即用打点机制,我们为你抽象封装了所有 Tracing 的最佳实践。因此有许多常见属性我们会直接写入,比如 input.value,或者发给 LLM 的输入消息,这些都非常标准。但你也可以使用所谓的手动打点(Manual Instrumentation)或混合模式(Hybrid),允许你进行自定义。因此 Tracing 非常灵活。我们希望确保它是量身定制的,让你能拿到自身用例所需的信息,但同时也尽量保持简单。另外,如果你有想要追踪的自有应用,在开始引导页面上有类似 npx evals 的命令,会引入我们所有的 Skill,这是目前做 Tracing 最好的方式。让你的 Agent 自己想办法去打点,你在旁边稍微引导即可。所以如果你打算上传自己的 Trace 供后续评估,我强烈推荐这种方式。

英文原文 All right, so start with one, add more evals later.

Um I think in pairs or whoever the group of around you, um I would like to kind of have y'all jot down some ideas. Um basically, there is six things we want to write down. This is going to be really helpful for us actually building our eval. Um so first, it's going to be the task. Like what do you want this eval uh to be going off of, uh what success looks like, what failure looks like, um, what they're judging, like what the evals are actually supposed to judge here in this evaluation, and then, you know, basically three bullets on what pass would look like, um, and what fail looks like. And remember from this slide over here, the more specific and concrete you can be, the better your eval will be. So, we're going to use all of this, uh, all these notes that you're writing to actually build our eval in the next step. So, the more specific we can be, um, the better. And so, yeah, I think it's a great opportunity to kind of chat with folks around you, see what you're thinking, what they noticed in the traces, and I'll walk around and let me know if you have any questions.

I got a question over here that was like, um, the the way that the data looks on the trace for this application is pretty specific. It has all like the request info. Um, and the question was like, does that come out of the box, or do I have to like build that specific to my use case, right? That was the just guy, make sure. Um, and the question is is with our out-of-the-box instrumentation, we kind of abstract kind of all of the tracing best practices for you. So, there's a lot of common attributes that we send in. So, things like input down value, or the input messages that we send to the LLM, that's pretty standard, but what you can do is called, um, you know, manual instrumentation or hybrid, which allows you to customize. So, uh, tracing is really flexible. We want to make sure it's tailored and you get the information you need for your use case, but we try to make it easy at the same time. Um, and if you have, um, you know, your own applications that you want to trace, on that kind of starter page was our like MPX evals, that call brings in all of our skills, uh, which is the best way to do tracing these days. Let your agent figure out how to instrument it, and you can kind of nudge it along. So, highly recommend that if you're going to send in your own traces, uh, to evaluate later.

筛选 Span 并保存到数据集

好的。我切换到下一张幻灯片,给大家看一个示例,说明这大概长什么样;接着我知道这边还有几个问题,我马上过来解答。

这里展示一个示例,关于你的标准通常希望写成什么样子。

比如我们要评判的任务:用户发送了关于其行程的追问。成功是:直接使用行程细节回答追问;失败是:退回到通用的预算说明。你可以在这里看到 Pass 和 Fail 的具体细则。有人问我为什么要写列表要点,为什么一句话概述不够?原因在于我们接下来要用这些内容来编写我们的 LLM Prompt,以执行 LLM as a judge。所以我们希望它极其具体,让 LLM 能够理解。我喜欢把这比作向同事或项目利益相关者描述成功是什么样。你在制定标准时也应该采取同样的态度。我再去回答几个问题,然后我们进入下一步。对于想走得快一点的人,这部分只是在说明:如果你标准里写了太多东西,可以删减一些;但考虑到时间关系,我先往后讲。

我们准备开始构建我们的 Eval。第一步是你需要进入那些 Trace。我现在切过去,你需要选择一些 Trace 实际添加到你的数据集(Dataset)中。

举个例子,假设你想评估输入与行程方案之间的对应关系,比如行程单是否包含了大致的输入信息?你会想要把所有这些 Root Span 保存到数据集中。如果你决定要测试工具调用,看看工具调用是否返回了它应该返回的正确信息,你会想要把所有这些工具调用 Span 添加到你的数据集中。我们在页面上提供了 Filters(筛选器),这是定位数据的最佳方式。一个极佳的例子是,如果要筛选 Root Span,你可以直接设置 parent_id = null,或者直接从默认的 Trace 视图筛选;如果你想测试特定的工具调用,比如刚才看到的 Essential 工具,你也可以按名称进行过滤。

然后你只需勾选这些,或者从 Span 视图中选择它们并添加到新的数据集中。这就是接下来的步骤。然后我们将前往 Playground 实际构建并测试我们的 Eval。

大家可以一边操作,我一边回答问题。如果有任何关于添加到数据集以及如何考虑过滤的问题,随时告诉我。考虑到时间不多了,我想向大家展示接下来的步骤。

英文原文 All right. I'm just going to click to the next slide to show you an example of what this could look like, and then I know there were some questions over here that I'm going to come to.

So, just going to show an example, um, here of like what your criteria you generally want it to look like. Um, so, this is like the task that we want to judge. User sends a follow-up about their trip. Uh, the success is answers the follow-up directly using the trip's details. Failures is falls back to a generic budget. And you can see here, this is the pass and fail. Some folks asked me like why we want to have the bullets and why the one-liner's not enough and uh, the reason for that is basically we're going to use this to write um, our LLM prompt to do our LLM as a judge. So we want to be really specific so the LLM um, can understand. The way that I like to think about this is describing to like a coworker or, you know, a stakeholder like what success looks like. You almost want to treat this criteria uh, creation the same. So I'm going to answer a few more questions and then we're going to move on to the next step. Uh, for folks who want to get a little bit ahead of that, um, you can this is just describing make sure that um, if you have too much in your criteria, you can cut it back, but I think for the sake of time I'm going to move here. Um,

we want to go ahead and start building our eval. The first step is you're going to want to go to those traces. Let me go there now and you're going to want to select a few um, traces to actually add to your data set.

Um, so for example, say you wanted to just go ahead and evaluate the input versus the itinerary. Like does the itinerary have the general input? You would want to save all of these root spans to a data set. Um, if you've decided you wanted to maybe test the tool call and see if the tool call returns um, the right information that it was supposed to, you would want to add in all of these tools uh, calls to your data set. Um, we have filters here. It's the best way to identify data. Um, so one really great example, if it's like root spans, you could do just parent ID equals null or go off of the default traces. Um, and if you wanted to do like a tool call for example that um, I think it was the essential tool, you could also filter by name that way. Um, and then you would just want to grab these or go from the span view to, you know, select those and add to a new data set. So um, that's kind of the the next step and then we're going to head on over um, to our playground to actually build and test our eval. So, folks can head over there while I answer some questions. And let me know if there any that come up for adding to the data set and how you should think about filtering. I want to show some folks kind of the next steps here for time cuz I know we don't have that much left here.

在 Prompt Playground 中编写与迭代 Judge Prompt

所以,希望大家目前都完成了编写标准,并针对要构建的内容确定了一些 Span。接下来基本上就是大家刚才看到的初次尝试流程,我现在现场操作一遍供大家参考。

首先我们要过滤出你准备评估的 Span。这就是我们刚才走通的流程:浏览 Trace,确定需要评估的 Span,构建过滤规则,并将它们添加到数据集中。

现在我们要进入 Prompt Playground。这是我最喜欢去实际测试 Prompt 的地方。你可以进入 Playground。我已经建好了一个,但我现在新建一个。我们在产品中有两种 Playground:我们将使用的是 Prompt Playground,非常适合测试 Eval Prompt 或者为 Agent 编写的任何 LLM Prompt;我们也有 Agent Playground,那是用来端到端测试你的 Agent 的,对今天来说没那么相关。

给它起个名字,我这里叫 AI engine evals。然后我们点击创建。

如果你是在我们的 Eval Hub 里创建了 Eval,会弹出一个侧边栏。你可以在 Playground 的下拉菜单中直接添加它,就能看到你的 Eval 出现在这里。对于刚刚开始流程的人,我们直接选 Blank Eval(空白评测)。你可以直接在这里开始编写你的模板。

你要做的基本上就是把之前写的所有标准转化为一段 Prompt。其中大部分应该是直接粘贴:你可以把之前列出的判定标准要点粘贴进来。不过通常你首先要给它一个引言,比如“你是一个评测 Agent 或评估 LLM,负责检查应用的输出准确性”。我直接把这个加载进来。好了,完美。

我喜欢在 Eval 开头给出一个示例,说明 LLM 应该做什么。我总是让它明确自己的职责:你正在评估助手的输出是否准确捕捉到了输入中要求或提供的信息细节。接着你要提供数据。这非常重要。当我们查看那些 Trace 时,可能会识别出一些属性。你其实不需要担心在 Eval Prompt 中去写具体的属性名称,我们提供了一种叫做**变量映射(Variable Mapping)**的功能,允许你将其连接到你的确切数据上。这样做的好处是让你的 Eval 保持灵活。比如,如果在一个数据集里字段叫一个名字,而在 Trace 里叫另一个名字,你不需要更新每个 Eval,只需要更新使用它的任务即可。所以不用太纠结变量名称。

然后这是我为自己的任务编写的内容示例。这些是检查细节,也就是那三条判定通过与失败的要点。

我在提示词中写道:仅当输出与输入一致时标记为正确;如果出现错误的目的地、住宿类型等,标记为不正确。在下面的 Params(参数配置)中,如果你在 Task 中进行配置,就会看到设置 Labels 的地方。这里只有 Correct 和 Incorrect,但你可以设置成多标签问题。也许是 Correct、Incorrect、Partially Correct。我在 Alex 中就有这样的用例:了解某件事是部分正确还是完全正确对我来说是有意义的。你也可以加入类似 Not Applicable(不适用)的选项。

因此有很大的灵活性。Eval 每次只会返回一个标签。然后你在上面配置 Optimization Direction(优化方向),指明是以高分还是以低分为优;以及 Explanations(解释说明),这同样是该模板或 Eval 给出特定判定的推理理由。

接下来你要加载你的数据集。把之前创建并保存到数据集的那些 Span 加载进来。现在我们就可以真正开始测试我们的 Eval 了。

所有那些输入和输出都呈现在这里。如果需要将它们映射到不同的变量,你可以在这里操作(我的正好同名)。

现在你可以真正开始运行了。我打算用 4o-mini 运行,看起来挺合适。我们会在 Playground 中直接看到 Eval 的输出结果。这里是不断迭代 Eval 模板的绝佳场所。查看响应,看看是否有你认同或不认同的判断,调整 Prompt,然后反复运行。这就是我们接下来要花点时间做的事:把模板调整到一个良好的状态。

英文原文 So, everybody hopefully has been able to go through, write their criteria, identify some spans for what they're building. And then this is essentially kind of the first pass is what you probably saw, which I'm going to do now live for everyone to kind of follow along with. But we wanted to filter the spans you're judging. That's what we just walked through. So, look through the traces, identify what span you need to evaluate, build your filter, add those to a data set.

And now what we're going to do is go into our prompt playground. That's my favorite place to go to actually test out our prompts here. So, you can go to the playground. I already have one set up, but I'm going to go ahead and create a new one. We have two types of playgrounds in our product. We're going to use the prompt playground. That's great for testing eval prompts or you know any LLM prompts for your agent. We do also have an agent playground. That's for testing kind of your agent end to end here. So, not so relevant for today.

So, just give it a name. I'm going to do AI engine evals. And then we can go ahead and create it.

So, if you were in our eval hub, you were over here and you created an eval, you kind of have a slide over that looks like this. You can go ahead in the playground, just add that from the drop down here. So, you'll see your eval pop up here. For anybody who's just starting the eval process, we're just going to do blank eval. And you can actually just start writing your template here.

So, what you're going to basically do is take all that criteria and turn that into a prompt. A lot of it should be like paste. You can paste in those like bullets that you had as criteria, but um um a lot of times you want to first give it kind of an intro, like you aren't eval agent or an eval LLM uh looking at the output accuracy for your application. Let me actually just load this one in. Okay, perfect. Um so, I like to start my evals with an example of what the LLM is supposed to do. I I always kind of center it in its job. You're evaluating whether an assistant's output actually accurately captures the details requested um or input in the or provided in the input. Um you then want to provide the data. So, this is really important. When we're looking at those traces, there's probably uh attributes that you want to identify. You don't really need to worry about writing the specific names in your eval prompt. We do something called variable mapping um that allows you to connect it to your exact data. Uh the benefit of that is that your evals can be flexible. Like, if you've running on a data set calls it one thing, and then your traces call it something different, rather than you need to update every eval, you can just update the task where it's being used. So, don't worry too much about the name of the variable.

Um and then this is an example of what I have written for mine. Um these are the check-in particulars. Those are things like those three bullet points for pass and fail. Um and then here I have mark only correct if, you know, the output is consistent with the input, incorrect if there's a wrong destination, property type, whatever it is, that's going to be incorrect. Um and under params here, you'll see if you set it up in the task, that's where we have the labels. This one here is just correct or incorrect, but you can have, you know, a multi-label problem. Maybe you do correct, incorrect, partially correct. I have use cases in Alex where it's actually relevant to me to know when something is somewhat correct, but not fully. Um you can also do things like not applicable. Um so, lots of flexibility. The eval will return only one label, um and then you have some things here around the optimization direction, which says like is good or is correct the good thing or is a lower score a good thing and then explanations. Again, those are kind of the reasoning for why the template or by the eval gave a certain response.

And then what you're going to want to do is load in your data set. So those spans that you created and saved your data set, you can load them in. And now what we're in the spot to do is actually start testing our eval. We have all those inputs and outputs that are here. If you need to map them to different variables, mine happen to be the same, but you can do that here.

And so now what you can do is actually start to run. I'm going to run with 41 mini, that seems good to me. And we'll actually start to see the output of our eval right here in the playground. And this is a great spot to just start iterating on your eval template. Look at the response, you know, kind of see if there's something that you agree with or disagree and then you can adjust the prompt and then continue to run it over time. So that's going to be what we do for the next little bit here is try to get to a template in a good spot.

保存 Evaluator 与完整的评估闭环

完成后,你可以在这里的“Save Evaluator”小按钮将其保存下来,之后它就可以在整个平台中使用,无论是用于我们的 Demo 项目,还是用于你之后构建并接入 Arize 的任何应用。

我会走动一下,协助大家编写模板,然后我只剩一两张幻灯片收尾。我想提醒大家的是,我们有一些工具可以帮到你。虽然我让大家都自己写出标准并编写测试了 Eval,但我们在平台中有 Alex 可以辅助你。因此我非常推荐让 Alex 来帮忙,尤其是在你完成了初步的 Eval 编写之后。它实际上可以为你运行 Playground,查看结果,更新 Prompt 并反复执行,这在编写 Eval 时非常有帮助。

回顾一下整个闭环剩下的部分:我们今天在第二步花了很多时间,也就是打点、编写 Eval;但闭环的其余部分包括像 Signal 这样的产品。那是我们平台中的托管 Agent,能够查看你的 Trace,为你发现问题,甚至进行修复。

这样,Eval 就变成了我们的托管 Agent 可以消费的信号,最终帮助改进你的应用。

我认为优秀团队接下来的动作包括:对齐(Alignment)。对齐的过程是指对添加到数据集中的那些样本进行标注,然后运行 Eval 查看它是否符合人类反馈。**线上 Eval(Online Evals)**本质上是将其放入一个 Task 中,让它在我们的 Trace 上持续运行。这意味着在 Arize 中,每次传入 Trace,我们都会根据你的所有 Eval 对其进行评估,随后自动发布结果,你可以借此监控你的应用。

希望大家离开时牢记的关键点是:每个利益相关者都要评估 Agent。这不仅仅是某一个角色的职责。你真的需要把所有与 Agent 有利害关系的人都召集到房间里,让他们根据各自关注的结果来定义成功。包括产品、工程、客户支持、领域专家、安全等角色。另外,指标(Metric)与 Eval 的核心区别在于:指标告诉你某样东西可能坏了,但 Eval 会告诉你具体的失效模式(Failure Mode)是什么。所以你两样都需要结合使用。

接下来可以尝试的有趣方向是:我们现在有了所有这些全新的 Decision Judges。我认为把你的 LLM as a judge 转换成 Decision Judge 的提问形式,然后对比两者表现,看看哪种更好,这总是一件很有趣的事情。

再次强调,从小规模做起:也许 20 条 Trace,一个维度,一个 Judge,仔细阅读解释说明,不断迭代,之后再扩展到越来越多的 Eval。

至于资源,我们有一些文档:如何评估你的 LLM as a judge、Judge 文档,以及关于决策模型基准测试的深度剖析。之前有人问过什么时候该用 LLM as a judge,什么时候该用 Decision Judge,我觉得那是一个极佳的参考资料。我今天剩下的时间都会在现场,Arize 今天下午大概 4 点开始在展区有展位。如果你想了解更多关于 Eval 的知识、看一看我们产品的更多功能,欢迎来找我们。

如果有任何问题,我很乐意解答。非常感谢大家今天的参与!

英文原文 And then what you can do is save that off here in this little button here, save evaluator, and then that will be available to use across the platform for either our demo project or for any application that you build and bring into our eyes after. So I'm going to walk around, help some folks write their templates and then I have just, you know, one or two slides here to to close us out. I did want to kind of point out that we do have some tools to help you. I had everybody write out their criteria and write their eval and test it, but we do have Alex in the platform that can help you with that. So I definitely recommend helping or having Alex help you, especially after you've done kind of your initial eval pass. It can actually run the playground for you, look at the results, update the prompt and repeat. So that's really helpful for when you're writing evals.

Um pulling out a little bit of the the remainder of the loop here. So we spent a lot of time on the second loop our second step today, um where you instrument, you write your eval, um but then what the rest of the loop looks like is we have things like signal. That's our managed agent in the platform that is able to look at your traces, find issues for you, even make fixes. Um so this becomes signal that our managed agents can then consume and ultimately help improve your application.

Um these are some things I think good teams do next, alignment. Um alignment is going to be the process of like annotating all of those examples that we added to our data set, and then going to run that eval and seeing if um it matches the human feedback. Um online evals will be essentially us putting that into a task and have it running continuously over our traces. So what that means in our eyes, every time you send in a trace, we'll evaluate it according to all your evals, and then that automatically gets posted, and then you can use that to actually monitor your application.

Um a key everybody to walk away here with is that every stakeholder evaluates the agent. This is not just one kind of role's job. You really want to get everybody in the room who has some kind of stake in the agent and have them basically define what success looks like according to their outcomes. So uh product, eng, support, um experts, um security, those are all folks. And then um the key differences between like an metric and an eval is like a metric tells you that something might be broken, but evals tell you what the actual failure mode is. So you really want to use both there.

Um and then I think what might be fun to try next is we do have all these new decision judges. Um and so I think it's always interesting to take your elements as a judge, you know, convert it to a decision judge question, um and then maybe compare the performance there, uh see which one might be better. Um and yeah.

And then again, start small, 20 traces maybe, one dimension, one judge, you know, read the explanations, iterate over it, and then you can expand to more and more evals.

Um and just some resources, we have some docs, um, evaluate your LLM as a judge, your judge docs. Uh, we do have some deep dives on like the decision model benchmarking. So, I think somebody had a question of like, when should I use LLM as a judge, when should I use judge? I think that's a really great use uh, case and uh, yeah, I'll be hanging out for the rest of the day. Arize has a booth in the expo starting at I believe 4:00 today. So, if you want to learn more about evals, see a little bit more of our product, definitely come find us.

Um, and if there are any questions, um, happy to answer them and thanks so much for joining me today.

文中提及的人物和组织

人物: Sally Ann

公司/组织: Arize

产品/模型: Alex