How to Write Your First AI Eval - SallyAnn DeLucia, Arize AI

AI Engineer · 35 min · 418 sentences · from YouTube's caption track

Each timecode opens YouTube at the start of that sentence. Line anchors (#s42) are the cue ids in the WebVTT, and every line carries its start and end seconds. All transcripts has every talk, and the whole corpus as one file.

  1. 00:01[music]
  2. 00:12Um, before we get started, I just wanted to introduce myself.
  3. 00:15I'm Sally Ann, and I'm head of product at Arize.
  4. 00:18Uh, been at Arize for like 4 years now.
  5. 00:20Um, one of the first projects that I owned actually was building our AI agent Alex into our platform.
  6. 00:25So, I've been dealing evals for a little while now, and uh, even building a lot of our evals product.
  7. 00:31And so, I think the way that I think about evals is that they're our primary signal for our agents.
  8. 00:37Um, and that includes all of our evals at Arize.
  9. 00:41So, my goal today is you'll leave with three things.
  10. 00:44Um, a clear definition of what an eval is and what it isn't.
  11. 00:48Uh, being able to write your own criteria.
  12. 00:50So, 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.
  13. 01:00And then we're actually going to build a working judge in Arize.
  14. 01:02Um, and I'll show you a little bit about the life cycle there and how you can think about improving your evals over time.
  15. 01:09So, this is a bit of our agenda.
  16. 01:11So, again, I'm going to give you a little bit of context.
  17. 01:12I 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.
  18. 01:20Um, we're going to explore some data in Arize together, um, write our criteria, and then we'll actually go build our eval.
  19. 01:26That's the main part of our workshop today.
  20. 01:28Um, and then I'll give you a little bit of like where you could take this for what's next.
  21. 01:32Um, I love it to kind of have some like working sessions so people can collaborate together.
  22. 01:36I'll try to like walk around the room, help folks out.
  23. 01:39Um, 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.
  24. 01:47So, just check the room a little bit.
  25. 01:48Who here has either like shipped a chatbot or an agent, ever written an eval, or even just opened the Arize product today?
  26. 01:55Anyone here?
  27. 01:57All right, we got a a few folks here.
  28. 01:59So, 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.
  29. 02:06So, going to start off the context with like why I don't think vibe checks actually scale.
  30. 02:11So, this is the vibes problem as I see it.
  31. 02:15You know, you have Monday, you maybe change something to your prompt, you ship it.
  32. 02:18It overall feels better.
  33. 02:20You don't really have a way to know, but overall things are looking good.
  34. 02:24You know, Tuesday ship it, a week later now that use case that you shipped a fix for is broken.
  35. 02:29And 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.
  36. 02:37have vibes to go off of.
  37. 02:41What you can't do without evals is you can't detect regressions when you change a prompt.
  38. 02:46You can't objectively compare prompt or even different model versions.
  39. 02:52You 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.
  40. 03:00So, without evals it's you can imagine it's it's pretty hard to actually know how your agent is performing.
  41. 03:08A question I commonly get is is an eval just a unit test?
  42. 03:13I 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.
  43. 03:21Cuz first off, with a test you kind of just have like one input and there's one correct output.
  44. 03:26You can also read all of the logic in the code.
  45. 03:29With an AI agent, you actually cannot read any of that logic.
  46. 03:33That actually comes out after in the form of traces.
  47. 03:36And 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
  48. 03:46multiple criteria basically.
  49. 03:48So, 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.
  50. 03:56So, basically how I like to think about this is traces are the logs for AI Um, evals are actual tests.
  51. 04:03And 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
  52. 04:10to actually do your evals.
  53. 04:13So, this is an example here for why agents make this harder.
  54. 04:17So, this is just a sample example of what like a trace could look like.
  55. 04:21And 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.
  56. 04:31So, 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.
  57. 04:37So, 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.
  58. 04:45You have, you know, your local agent that's maybe retrieving something from a knowledge base.
  59. 04:48So, lots of back and forth are happening.
  60. 04:51And this is where I mean you can see the logic of your agent.
  61. 04:54Um, and we're going to explore some traces in the Arize UI just a little bit.
  62. 04:58Um, so you can see there's lots of LM calls, lots of things composed together.
  63. 05:03And 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.
  64. 05:15There's actually lots of different types of evals.
  65. 05:17Today, we're going to focus on LM as a judge.
  66. 05:20Um, LM as a judge is where we take a secondary LLM and we ask it to grade some aspect of our agent.
  67. 05:26Um, and so, there can be things like QA, summarization, relevance, and then you get a label and an explanation out of that.
  68. 05:34Explanations are really helpful.
  69. 05:35Explanations are kind of like the the reasoning or the thinking behind providing a label.
  70. 05:39It gives you a little bit of understanding and not just have to take a label at face value.
  71. 05:43But, there's lots of different types of evals.
  72. 05:46I want to call out decision models.
  73. 05:48Uh this is something that's pretty new.
  74. 05:50Uh 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.
  75. 05:59So, I think decision models are going to be a huge part of evals in the future.
  76. 06:03Um, 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.
  77. 06:11So, you don't get that explanation that you get with Elements of AI Judge.
  78. 06:15The other type of eval is code.
  79. 06:17Uh, these are really great for any deterministic tests.
  80. 06:20So, 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.
  81. 06:29Uh, that's going to be really great for code-based evals.
  82. 06:32There's also things like Rouge and Blue scores that are popular code evals.
  83. 06:36Um, annotations I do see as a form of evaluation.
  84. 06:39This is where we're having uh you know, golden truths on golden datasets.
  85. 06:43Um, sometimes they're synthetic as well.
  86. 06:45Um, agent as a judge is a newer type of eval that we've seen maybe over the last 6 months.
  87. 06:51Um, that's where we're going to take a full agent and evaluate something in a different agent.
  88. 06:55I think this is really good for super complex um like success criteria.
  89. 07:00Um, then we have user feedback and business metrics and those three at the end are going to be more for your production use cases.
  90. 07:05But, you'll notice the first four are something that you want to use across your life cycle in development and production.
  91. 07:12Um, 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.
  92. 07:20Those evals can grow with you over time and it gives you that consistent um performance.
  93. 07:29All right, let's go ahead and look a little bit at the data.
  94. 07:32Um, so we're going to pause here on this slide give everyone a few minutes to go and get started.
  95. 07:37That QR code is going to be for the one-pager which has all of the instructions for our workshop today.
  96. 07:44Um, but I want everyone here to go ahead to go to you know, app.arise.com.
  97. 07:48Uh, we want to log into AX.
  98. 07:50So, if you don't have an account um encourage you to make a free um account today.
  99. 07:55Um, and then I'll go over the steps from there in just a second.
  100. 07:59Um, 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.
  101. 08:05So, I'll pause there uh walk around make sure nobody has any issues logging into the platform.
  102. 08:11The question was, can you do you have to use like can you use a custom endpoint?
  103. 08:14Do you have to use a a common provider for step two?
  104. 08:18No, feel free to set up whatever LLM provider you want.
  105. 08:21We'll just want something that we can make LLM calls to so we can test our eval out.
  106. 08:25But yeah, step two basically go to your Anthropic console, your OpenAI console, whatever provider of your choosing.
  107. 08:32You 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.
  108. 08:39So, let me go to my laptop here and show you all a little bit of how to do this.
  109. 08:46So, settings here in the nav.
  110. 08:49You're going to go click into that and then under your account settings, let me try to Cool.
  111. 08:58You're going to come to AI providers.
  112. 09:02And you can see here we have a whole bunch of different providers.
  113. 09:04So, just choose one that is your favorite to use, Anthropic, OpenAI, Gemini, doesn't matter.
  114. 09:09Just something that we can use to make API calls with.
  115. 09:20And 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.
  116. 09:28Yeah, for for folks you'll find the demo project.
  117. 09:30Sorry, I'll go back.
  118. 09:31Just 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.
  119. 09:40The first is on from this when you go to this tracing page here, you'll see see demo project.
  120. 09:47I have the LLM agent.
  121. 09:48I know some folks might have our older demo model there.
  122. 09:51Does not matter which one you have, you should be able to do our exercise today.
  123. 09:54So, we just want to be able to look at some traces.
  124. 09:58And 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
  125. 10:07a handful of hands that got the AI provider.
  126. 10:10and to see what I can do to see if I can get one that we can share really quickly, too.
  127. 10:16All right, so if you have that travel agent demo project opened, this is a travel planning agent.
  128. 10:22It takes a request from a user and then can it make follow-up questions, call tools, and basically returns a plan.
  129. 10:31What 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.
  130. 10:38So, this is generally what a user request looks like.
  131. 10:40You can see the destination, how long they want to go, what their budget is, and what their kind of general travel style looks like.
  132. 10:48And that's an example of what we might see from a user who goes to this travel agent.
  133. 10:52So, I'd love for everyone to take a a few minutes.
  134. 10:55We want to look at the traces.
  135. 10:57We kind of want to just take inventory.
  136. 10:59What are users asking for?
  137. 11:00What did the agent tool do?
  138. 11:02What tools, what are the answers?
  139. 11:05And then just kind of make note, was this an answer that you would share?
  140. 11:07So, just want to kind of explore the data and get familiar with it.
  141. 11:15As 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.
  142. 11:23So, as an example, let me hop on over to the product.
  143. 11:27I explained mine to last day.
  144. 11:29Let's go ahead and take a look at one of these traces.
  145. 11:31So, you can see here, this destination is for Prague, Czech Republic, for 3 days, $800 budget.
  146. 11:40The user asked for an option that feels more local, less touristy.
  147. 11:45We have some kind of our ideas here and then we can start to view the plan that the the trip planning agent created.
  148. 11:52So, you have a detailed day one, day two, day three.
  149. 11:57And if you want to see any additional, you know, attributes, any additional data that we have, you can see that in attributes.
  150. 12:03And so, a little bit of how to navigate our product here.
  151. 12:08So, again, this is the trace tree.
  152. 12:10This is every individual step.
  153. 12:12If 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,
  154. 12:20we can switch to that span and then look at the input and output.
  155. 12:24So, 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.
  156. 12:33So, we'll spend a few minutes here just exploring and seeing what kind of insights we find.
  157. 12:40Getting some questions about where to find the actual data here, so let me just show that one more time.
  158. 12:47A 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.
  159. 12:54So, you'll just want to click the traces option on the nav here.
  160. 12:59This 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.
  161. 13:08And you can always expand the time to see a little bit more data there.
  162. 13:13Has everyone generally had time to like find the project, take a a quick look?
  163. 13:20See if you had nods, we'll give I know.
  164. 13:25Like fix that.
  165. 13:29All right.
  166. 13:29So, 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
  167. 13:41or success for this agent.
  168. 13:42Think 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,
  169. 13:52and start making kind of like mental note of what the things are that you would measure.
  170. 13:57In 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.
  171. 14:06Yes, so the question was like how we should think about reading a a trace here.
  172. 14:09So, 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.
  173. 14:19So, let's go ahead and open this one here.
  174. 14:21So, at the top we call that our root span.
  175. 14:25Like the technical definition of that is parent ID equals null.
  176. 14:28This means that this span here doesn't have anything ahead of it.
  177. 14:31It just sits at the top.
  178. 14:33And this is usually where the input and final output live.
  179. 14:37And then from there we have our individual spans.
  180. 14:39So, each of these is what we call a span.
  181. 14:42I like to think of it as a unit of work.
  182. 14:44So, let's take a look at this first collection of spans here.
  183. 14:48So, from the root span the first thing that this agent did along with calling some other agents it looks like called the research agent.
  184. 14:56So, this is a what we call a multi-agent system where there's multiple agents doing different tasks on behalf of the bigger agent.
  185. 15:04So, in this first one we have the research agent and that is going to go ahead and call a tool.
  186. 15:09So, each of these has like a type you can see it different icons.
  187. 15:13This is an agent span.
  188. 15:14This is a tool span.
  189. 15:16Tool span that's going to be for getting external data.
  190. 15:19So, 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.
  191. 15:29And then from there we're going to use an LLM.
  192. 15:33You can see here all of the inputs and outputs that actually went into the LLM.
  193. 15:37So, this is your concise travel agent.
  194. 15:41And this is using that information from that tool to actually summarize that we can use it in a later step here.
  195. 15:48And so you can just go down the trace tree just like that like one step at a time.
  196. 15:52You 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.
  197. 16:01So, again the goal of this application is to look at a user's request for a trip and plan it for them.
  198. 16:08Give them an itinerary of things that they can do, places they can stay all in accordance with their kind of preferences.
  199. 16:15And so each of these spans is the units that were done to ultimately get this final kind of itinerary.
  200. 16:23Any questions on that?
  201. 16:24Happy to answer some questions about tracing while we're we're going through this.
  202. 16:28Yeah, so the question is is like there's two LLM spans.
  203. 16:32Yeah, so sometimes it's I'll go back and look at the exact trace of what happened there.
  204. 16:36Sometimes 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.
  205. 16:46So let's go ahead and take a look at what happened here.
  206. 16:54And some of this is just kind of part of instrumentation here.
  207. 16:58So 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.
  208. 17:12So here it's kind of hard sometimes you have to go down the trace to come back up.
  209. 17:17So this LLM span chose this tool and then this LLM span summarized the output of the tool.
  210. 17:23So 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.
  211. 17:34Yeah, great question.
  212. 17:34So 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?
  213. 17:42And there's a lot of flexibility.
  214. 17:43It comes down to what your agent kind of infrastructure is.
  215. 17:46So 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
  216. 17:56and 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.
  217. 18:02So depends a little bit about like what framework you're using, what your infra looks like and the general architecture of your agent.
  218. 18:09In this case here this is a link graph agent I believe.
  219. 18:12So we're not doing any like supervisor architecture really.
  220. 18:14Just we have a a few like modular agents that are responsible for different tasks.
  221. 18:20Great question.
  222. 18:20The question was like what strategic frameworks we support with arise.
  223. 18:24We're agnostic to frameworks.
  224. 18:25We have a bunch of what we call auto instrumenters available through our tracing package open inference.
  225. 18:33We don't have a preference of which framework we want to use.
  226. 18:35Our goal is to be really flexible and provide you with really good observability and evals on top of it.
  227. 18:40So I can link our docs where you can see all the different frameworks that are supported.
  228. 18:49Okay.
  229. 18:50Let's keep going a little bit here.
  230. 18:53Sounds 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
  231. 19:02for the success.
  232. 19:03So the first step of defining what your eval is is defining what good means.
  233. 19:10This is sometimes tricky for folks to do.
  234. 19:12So I've kind of have this little trick here for vague versus concrete criteria.
  235. 19:19I generally like to just write down what good means but with really specific criteria.
  236. 19:26So instead of just being like helpful, accurate, good response, you want to get a little bit more specific.
  237. 19:32So answer that follows the user's follow-ups, matches the requested number of days, keeps totals within the stated budget.
  238. 19:39For this application those are all really concrete criteria for what success looks like.
  239. 19:45And 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.
  240. 19:53Another helpful hint that I have is judge one quality per eval.
  241. 19:58There's some exceptions to this.
  242. 20:00I 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.
  243. 20:08But 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.
  244. 20:15So I think it's good practice to just think of one of them and then add more evals over time.
  245. 20:21Building evals sets iterative thing.
  246. 20:23You don't just build your evals and then like set it and forget and you're set for the life of the application.
  247. 20:27You 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
  248. 20:37we can add more and more.
  249. 20:39Um 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.
  250. 20:46It was like QA correctness.
  251. 20:49I think I had some like user frustration, and of course like jailbreak toxicity, those types of safety evals.
  252. 20:56Um and now we have 32 evals that run um on Alex.
  253. 20:59So 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.
  254. 21:11I see some questions over there.
  255. 21:13Yeah, so the question for the the group is is a generic eval better than a more specific one?
  256. 21:19I think it really depends.
  257. 21:20I think generally speaking, I say building a specific eval for your use case is better.
  258. 21:24But what I would say is an eval is better than no eval at all.
  259. 21:27So 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.
  260. 21:35We 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,
  261. 21:45is to kind of align that to your use case um and then create more specific ones over time.
  262. 21:50So 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.
  263. 22:02All right, so start with one, add more evals later.
  264. 22:05Um 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.
  265. 22:12Um basically, there is six things we want to write down.
  266. 22:15This is going to be really helpful for us actually building our eval.
  267. 22:19Um so first, it's going to be the task.
  268. 22:21Like 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,
  269. 22:35and then, you know, basically three bullets on what pass would look like, um, and what fail looks like.
  270. 22:41And remember from this slide over here, the more specific and concrete you can be, the better your eval will be.
  271. 22:46So, 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.
  272. 22:51So, the more specific we can be, um, the better.
  273. 22:55And 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.
  274. 23:04I 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.
  275. 23:11It has all like the request info.
  276. 23:13Um, 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?
  277. 23:18That was the just guy, make sure.
  278. 23:20Um, 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.
  279. 23:27So, there's a lot of common attributes that we send in.
  280. 23:29So, 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.
  281. 23:39So, uh, tracing is really flexible.
  282. 23:41We 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.
  283. 23:47Um, 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,
  284. 23:56uh, which is the best way to do tracing these days.
  285. 23:58Let your agent figure out how to instrument it, and you can kind of nudge it along.
  286. 24:01So, highly recommend that if you're going to send in your own traces, uh, to evaluate later.
  287. 24:07All right.
  288. 24:07I'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
  289. 24:12that I'm going to come to.
  290. 24:15So, just going to show an example, um, here of like what your criteria you generally want it to look like.
  291. 24:22Um, so, this is like the task that we want to judge.
  292. 24:24User sends a follow-up about their trip.
  293. 24:27Uh, the success is answers the follow-up directly using the trip's details.
  294. 24:31Failures is falls back to a generic budget.
  295. 24:33And you can see here, this is the pass and fail.
  296. 24:36Some 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.
  297. 24:47So we want to be really specific so the LLM um, can understand.
  298. 24:51The way that I like to think about this is describing to like a coworker or, you know, a stakeholder like what success looks like.
  299. 24:58You almost want to treat this criteria uh, creation the same.
  300. 25:01So I'm going to answer a few more questions and then we're going to move on to the next step.
  301. 25:05Uh, 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
  302. 25:16I think for the sake of time I'm going to move here.
  303. 25:18Um, we want to go ahead and start building our eval.
  304. 25:22The first step is you're going to want to go to those traces.
  305. 25:24Let me go there now and you're going to want to select a few um, traces to actually add to your data set.
  306. 25:34Um, so for example, say you wanted to just go ahead and evaluate the input versus the itinerary.
  307. 25:40Like does the itinerary have the general input?
  308. 25:43You would want to save all of these root spans to a data set.
  309. 25:47Um, 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
  310. 25:57tools uh, calls to your data set.
  311. 25:59Um, we have filters here.
  312. 26:00It's the best way to identify data.
  313. 26:03Um, 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.
  314. 26:10Um, 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.
  315. 26:18Um, 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.
  316. 26:27So 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.
  317. 26:34So, folks can head over there while I answer some questions.
  318. 26:39And let me know if there any that come up for adding to the data set and how you should think about filtering.
  319. 26:44I want to show some folks kind of the next steps here for time cuz I know we don't have that much left here.
  320. 26:52So, everybody hopefully has been able to go through, write their criteria, identify some spans for what they're building.
  321. 27:02And 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.
  322. 27:11But we wanted to filter the spans you're judging.
  323. 27:13That's what we just walked through.
  324. 27:14So, look through the traces, identify what span you need to evaluate, build your filter, add those to a data set.
  325. 27:22And now what we're going to do is go into our prompt playground.
  326. 27:25That's my favorite place to go to actually test out our prompts here.
  327. 27:29So, you can go to the playground.
  328. 27:31I already have one set up, but I'm going to go ahead and create a new one.
  329. 27:34We have two types of playgrounds in our product.
  330. 27:38We're going to use the prompt playground.
  331. 27:40That's great for testing eval prompts or you know any LLM prompts for your agent.
  332. 27:45We do also have an agent playground.
  333. 27:47That's for testing kind of your agent end to end here.
  334. 27:49So, not so relevant for today.
  335. 27:52So, just give it a name.
  336. 27:54I'm going to do AI engine evals.
  337. 27:59And then we can go ahead and create it.
  338. 28:00So, 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.
  339. 28:10You can go ahead in the playground, just add that from the drop down here.
  340. 28:15So, you'll see your eval pop up here.
  341. 28:18For anybody who's just starting the eval process, we're just going to do blank eval.
  342. 28:22And you can actually just start writing your template here.
  343. 28:25So, what you're going to basically do is take all that criteria and turn that into a prompt.
  344. 28:30A lot of it should be like paste.
  345. 28:31You 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
  346. 28:42or an eval LLM uh looking at the output accuracy for your application.
  347. 28:48Let me actually just load this one in.
  348. 28:52Okay, perfect.
  349. 28:53Um so, I like to start my evals with an example of what the LLM is supposed to do.
  350. 28:59I I always kind of center it in its job.
  351. 29:01You're evaluating whether an assistant's output actually accurately captures the details requested um or input in the or provided in the input.
  352. 29:10Um you then want to provide the data.
  353. 29:12So, this is really important.
  354. 29:14When we're looking at those traces, there's probably uh attributes that you want to identify.
  355. 29:21You don't really need to worry about writing the specific names in your eval prompt.
  356. 29:24We do something called variable mapping um that allows you to connect it to your exact data.
  357. 29:29Uh the benefit of that is that your evals can be flexible.
  358. 29:31Like, 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.
  359. 29:40So, don't worry too much about the name of the variable.
  360. 29:44Um and then this is an example of what I have written for mine.
  361. 29:48Um these are the check-in particulars.
  362. 29:50Those are things like those three bullet points for pass and fail.
  363. 29:55Um 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.
  364. 30:06Um and under params here, you'll see if you set it up in the task, that's where we have the labels.
  365. 30:11This one here is just correct or incorrect, but you can have, you know, a multi-label problem.
  366. 30:16Maybe you do correct, incorrect, partially correct.
  367. 30:19I have use cases in Alex where it's actually relevant to me to know when something is somewhat correct, but not fully.
  368. 30:25Um you can also do things like not applicable.
  369. 30:28Um so, lots of flexibility.
  370. 30:29The 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
  371. 30:42is a lower score a good thing and then explanations.
  372. 30:45Again, those are kind of the reasoning for why the template or by the eval gave a certain response.
  373. 30:53And then what you're going to want to do is load in your data set.
  374. 30:57So those spans that you created and saved your data set, you can load them in.
  375. 31:01And now what we're in the spot to do is actually start testing our eval.
  376. 31:04We have all those inputs and outputs that are here.
  377. 31:08If you need to map them to different variables, mine happen to be the same, but you can do that here.
  378. 31:14And so now what you can do is actually start to run.
  379. 31:17I'm going to run with 41 mini, that seems good to me.
  380. 31:21And we'll actually start to see the output of our eval right here in the playground.
  381. 31:25And this is a great spot to just start iterating on your eval template.
  382. 31:30Look 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.
  383. 31:39So 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.
  384. 31:45And 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
  385. 31:56or for any application that you build and bring into our eyes after.
  386. 31:59So 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.
  387. 32:08I did want to kind of point out that we do have some tools to help you.
  388. 32:12I 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.
  389. 32:18So I definitely recommend helping or having Alex help you, especially after you've done kind of your initial eval pass.
  390. 32:25It can actually run the playground for you, look at the results, update the prompt and repeat.
  391. 32:30So that's really helpful for when you're writing evals.
  392. 32:33Um pulling out a little bit of the the remainder of the loop here.
  393. 32:38So 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.
  394. 32:48That's our managed agent in the platform that is able to look at your traces, find issues for you, even make fixes.
  395. 32:55Um so this becomes signal that our managed agents can then consume and ultimately help improve your application.
  396. 33:02Um these are some things I think good teams do next, alignment.
  397. 33:06Um 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
  398. 33:16um it matches the human feedback.
  399. 33:18Um online evals will be essentially us putting that into a task and have it running continuously over our traces.
  400. 33:24So 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
  401. 33:34your application.
  402. 33:36Um a key everybody to walk away here with is that every stakeholder evaluates the agent.
  403. 33:41This is not just one kind of role's job.
  404. 33:44You 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.
  405. 33:52So uh product, eng, support, um experts, um security, those are all folks.
  406. 33:58And 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.
  407. 34:08So you really want to use both there.
  408. 34:11Um and then I think what might be fun to try next is we do have all these new decision judges.
  409. 34:16Um 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.
  410. 34:25Um and yeah.
  411. 34:28And 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.
  412. 34:39Um and just some resources, we have some docs, um, evaluate your LLM as a judge, your judge docs.
  413. 34:44Uh, we do have some deep dives on like the decision model benchmarking.
  414. 34:48So, I think somebody had a question of like, when should I use LLM as a judge, when should I use judge?
  415. 34:53I think that's a really great use uh, case and uh, yeah, I'll be hanging out for the rest of the day.
  416. 34:58Arize has a booth in the expo starting at I believe 4:00 today.
  417. 35:01So, if you want to learn more about evals, see a little bit more of our product, definitely come find us.
  418. 35:06Um, and if there are any questions, um, happy to answer them and thanks so much for joining me today.