Latest / Agentic Conversations (formally mlops.community) / Are Evals Dead?
Transcript
- 0:00Why do you even need evils in the 1st place?
- 0:02Right? We started to see where things
- 0:04were failing and started to build evils for that
- 0:07specifically. You know, it's easy to say let's
- 0:09just test the agent end to end. What does end to end mean?
- 0:13In the times of machine learning, we were training a new
- 0:16model and you roll it out. You know, now it's coming to
- 0:18agents because agents are being productionized.
- 0:27How are you evaluating? How has that changed over time?
- 0:32We learned a lot obviously in the past years that process.
- 0:34We've been building many agents for many applications.
- 0:37And for the lesson we quickly learned that you need to have a
- 0:42way to understand how your agent is doing.
- 0:44Like now it's very easy to by code something and get it in
- 0:47production, but that doesn't scale.
- 0:50If you want to release this to millions of users, you will find
- 0:53that many times they break. And this is also reason why
- 0:57people don't trust Asians 100%. But we're here to change that.
- 1:03The way we approach it is also from kind of scientific approach
- 1:08because I'm a data scientist myself by background and like
- 1:13it's easy to use models with an API, just run a prompt and get a
- 1:18response. But actually what you write in
- 1:20this prompt can change a lot of the results.
- 1:23And the way I see it is, is much more like a data science kind of
- 1:27task where when you write a prompt, you're kind of training
- 1:30a model 'cause you're determining the outputs of of
- 1:33the agent, right? So it's very important to to
- 1:38have good evaluation sets. And at the beginning you don't
- 1:41have really production data, so you need to kind of bootstrap
- 1:46this whole thing. And it was very important to
- 1:50have a very created set of examples.
- 1:55For instance, this could come from product manager insights or
- 1:59discussion in the team, or maybe this is a specific use case that
- 2:03you want the agents to we need to work on.
- 2:07And, and there we basically built all these examples.
- 2:11So at the beginning to bootstrap this, this agent, we created a
- 2:15curated set of of test cases. We approach it like a software
- 2:19engineering project. In this case, we wanted to have
- 2:22some flows that we were sure that we're gonna work.
- 2:24Those flows you can use in CICD pipelines and and everything
- 2:29like more more like you would do for a software development
- 2:33project. Yeah.
- 2:35And that you, you make sure you like the main use cases are
- 2:38covered, but you also might wanna see all the parts that
- 2:42need testing and make sure that nothing breaks along the
- 2:45pipeline. That was the first level that we
- 2:49did. So understand what goes wrong
- 2:51where, fix it like iterate fast. And then we started to test the
- 2:57system ourselves, like on a wider, wider team within the
- 3:01company. And getting feedback from users
- 3:04was very specific feedback because we had internal users
- 3:07that were helping us with this. And with that, we started to see
- 3:11where things were failing and started to build evolves for
- 3:15that specifically. Something we did was also
- 3:19building evolves for multi certain conversations, like for
- 3:23guardrails. This is all the obvious case
- 3:26because when you have single turn conversations, it's very
- 3:30hard to to see if the guardrails can be broken or not.
- 3:34Yeah, sometimes you need the user who's very persistent, like
- 3:37I'm not talking really bad stuff because that is usually covered
- 3:42if you're using foundation models.
- 3:44But there are things like platform circumvention that is a
- 3:47bit more sneaky, like trying to users trying to get information
- 3:52that is not supposed to be public.
- 3:53You know, there is a lot of of things.
- 3:55Yeah, that. For users trying to get
- 3:58discounts. I imagine.
- 3:59Well, yeah, you know, once you release it, people are going to
- 4:03try their worst or their best, so yeah.
- 4:08Wait and can you break down this multi turn conversation evals
- 4:12and how you were? Basically it was 4 guardrails
- 4:15but you also wanted to evaluate that it wasn't giving discounts
- 4:20when it needed to be or it wasn't telling secret
- 4:22information that it shouldn't be.
- 4:24Did you basically set up another agent to try and red team it?
- 4:28Were you specifically trying to red team it?
- 4:30How did that work? So we created personas.
- 4:35There is yeah, we created an agent that was supposed to
- 4:38impersonate a user who had certain intention and we were
- 4:40defining this at the beginning and the agent had to be very
- 4:44persistent to try and break our own agent.
- 4:48So for instance, yeah, no matter what the other agent's response,
- 4:52try to get this information, try to be per SE events one nice and
- 4:57sometimes it was working and yeah, that's where you know you
- 5:01need to to do something about it.
- 5:03How were you updating that You realized something went wrong?
- 5:07You realized that the agent gave away information it didn't mean
- 5:10to? What did you then do to you just
- 5:12change the prompts? Or did you also add specific
- 5:16like hard coded rules? Yeah, it depends on the case.
- 5:19Like sometimes we didn't encounter it in our case, but
- 5:24sometimes you might have security issues that did not
- 5:27surface at the time and then you need to to do changes in the
- 5:32actual code. Sometimes it's just prompting
- 5:34being a bit more aggressive. Or you can add a reviewer that
- 5:39evaluates the output and checks, you know, some sort of content
- 5:41moderation step before the response.
- 5:45There are different techniques and you know, always start
- 5:49simple and then build up if it doesn't work.
- 5:51You did talk to me a bit about the simulations that you were
- 5:55doing because I think that kind of is in line with what you're
- 5:59talking about now. You were simulating in different
- 6:02ways like. Can you go into that?
- 6:04So the simulation that we did, we're kind of multi turn with a
- 6:08pretty fine number of turns. So we didn't drag them for very
- 6:12long. We just wanted to see whether
- 6:15the agent could break our agent in like 4 or five turns of
- 6:18conversation. And we had few phases to define
- 6:24this, like first we came up with examples ourselves because we
- 6:27wanted to, yeah, just make sure basics are covered.
- 6:32Then we started to get feedback. And then after this phase you
- 6:34can move to production data and see maybe we can move to this
- 6:39other parts of Evol's, which is equally important, which is
- 6:42error analysis. So there you really want to
- 6:45pinpoint what's wrong and add this to your evaluation set.
- 6:50So for instance, if we see a case where a user managed to get
- 6:53to sneak some information from the agent, then you add it also
- 6:56to this set. And you make sure you run it
- 6:58every time you're updating the code, or periodically depending
- 7:03on how frequently you need it. One thing that I'm fascinated by
- 7:08is the evals. You're kind of doing offline,
- 7:11right? But then you have prompt changes
- 7:15that you roll out and those are almost like online.
- 7:19Do you think about how to update the production system with the
- 7:25new prompts, but almost like do it in a champion challenger way?
- 7:30Or is it done slowly? Or do you just change it and see
- 7:34where things break afterwards? If I understand your question,
- 7:38like is it it's about basically measuring the impact of the
- 7:43change in the? Production system, basically,
- 7:47and especially because you change the prompt.
- 7:53How are you rolling it out? Yeah, this is same as rolling
- 7:56out a new model. Like in the times of machine
- 7:59learning, we were you're training a new model and you run
- 8:02it out. So first of all, you want to see
- 8:04how it compares to the previous. So you have an evil set to run
- 8:08it and you see the if there are discrepancies, if it's better,
- 8:12if there are some some tests that now fail and it didn't
- 8:16before, like if you introduce new errors.
- 8:18This is really important to do. First of all, on a trusted evil
- 8:21set, you run it there and then you can start to roll it out.
- 8:26You can do an AP test for instance.
- 8:28There are, there is a lot of literature about this because,
- 8:34yeah, this is what data science community has been doing a lot
- 8:38before. And, you know, now it's coming
- 8:39to agents because agents are, you know, are you being
- 8:43productionized. So now all these little things
- 8:46are starting to connect finally. It was.
- 8:50I didn't see this as much before, but now, yeah, it's
- 8:54really nice that we can use all these techniques and port them
- 8:56in the world of agents. Maybe that's a nice thread to
- 8:59pull on. Is what are some things that you
- 9:03can take from the traditional predictive machine learning
- 9:07world, like those eval sets that you're testing offline and then
- 9:11the slow rollouts or the Champion Challenger AB testing
- 9:14when you do roll out the model. But now we're not rolling out a
- 9:17new model, we're rolling out new prompts.
- 9:19What are some other things that you're taking or what are some
- 9:22things that are completely different?
- 9:23Imagine you have an input of a black box, which is your model,
- 9:26your prompt, and then you have the output.
- 9:29So that part needs to be tested well, so that I approach like a
- 9:32data science problem more than traditional machine learning
- 9:35sense, even though it's there is a more, there is a bit more
- 9:40explainability there. We can make easier changes in
- 9:44the prompts, but still that that part is very analogous.
- 9:49We've seen. The other is the fact that
- 9:51you're integrating this into a big software engineering project
- 9:55that is more complex than just getting an output from a model.
- 10:02So for instance, tool, tool calling is really important to
- 10:05get it right. Sometimes tools are whole
- 10:07workflows by themselves, like tool can be almost an entire
- 10:12agent or sometimes agents. So there is much more complexity
- 10:18in an agentic system, so many more things that can go wrong.
- 10:21And if you start to, for instance, change API holes where
- 10:26you have always the probability that things might go wrong, that
- 10:30you're going to get the wrong output.
- 10:31So it's really important to find out what the steps are and test
- 10:35everything. It's yeah, you know, it's easy
- 10:38to say let's just test the agent end to end.
- 10:41What does end to end mean? That there are all these
- 10:43components and you really need to understand what goes wrong.
- 10:47Also, at the end, why do you even need evils in the 1st
- 10:50place, right? You want to see what's wrong,
- 10:53What to improve? Is the product good enough to be
- 10:55released? I think for ether software
- 10:58engineering team you want to know what to do next.
- 11:01Yeah, that's the most important. You want to iterate fast, get
- 11:04output and release new version quickly.
- 11:08So you need evils to understand where things go wrong, What are
- 11:11the errors? Why does certain things happen?
- 11:14Having agents use other agents as tools, those agents now are
- 11:19they can fail, and maybe you don't really recognize where
- 11:24that happens, so debugging becomes very complex.
- 11:27It's the core of evaluating agents because at the end, users
- 11:31care about the end to end experience, right?
- 11:33We want to give a good experience to the user.
- 11:35So end to end is really important.
- 11:38So there is a level in which you want to test like how things go,
- 11:42like how what's the experience for the user itself.
- 11:45Yeah. So that's very important.
- 11:49It's not the only part of it. It's very important to us to dig
- 11:53deep and see for every step what can go wrong.
- 11:57This is more similar to traditional software engineering
- 11:59where you have unit tests for functions.
- 12:03We want to have brand new visibility into what can go
- 12:06wrong. We say we have the end to end
- 12:08experience where you can for instance, say this is what the
- 12:12user types and this is what the agent responds like the agent is
- 12:16doing web search, these are the search results, things like
- 12:18that. Or the user is searching for
- 12:21gluten free foods. Did the agent return gluten free
- 12:24food or not? This is this is something
- 12:27important to check, right? Because there are allergies in
- 12:30case of food. So to give you some ideas.
- 12:34But then yeah, you check that the user experience is fine, but
- 12:38then from the developer side, if I want to know what to fix, then
- 12:43I need to take all these tool calls, see what goes wrong and
- 12:48where. And I think it's very important
- 12:51to to use the right tools for that.
- 12:53Also we find many times this project have complex workflows
- 13:01and traditional platforms for evals are sometimes not enough
- 13:06like to visualize data and outputs.
- 13:09We sometimes have to build our own tooling.
- 13:11Interesting. Tell me more about that.
- 13:14For reasons to evaluate conversations in order for
- 13:17people who are non-technical to understand and see if something
- 13:20was good enough or not, we needed a good way to visualize
- 13:24this. And you know you have agents and
- 13:27tools, most frameworks allow you to visualize these things, but
- 13:31sometimes in the tool you also have other things going on that
- 13:34are very domain specific. So we had to build apps for, for
- 13:40them to, to visualize conversations.
- 13:42And I think this stuff is sometimes overlooked, but it's
- 13:46very important because you really need domain experts, you
- 13:49need PMS to, to look at this data because they are they're
- 13:52guiding the development of the product itself.
- 13:55So they really need to understand what is going on and
- 13:58it needs to be easy for them. I heard about a friend who
- 14:01actually Willem, who came on the podcast probably three months
- 14:05ago, and he was talking about how they built heat maps for
- 14:09where the agents were failing. And once they built these heat
- 14:13maps, they could see very clearly what the agent was good
- 14:16at and what it was not so good at.
- 14:19Yeah, I think this is the this is the core of evils like
- 14:23understanding where things go wrong.
- 14:26So we had it at the beginning. We we had simple prompts to
- 14:29evaluate conversations, which were like, is the agent
- 14:34returning a good response? Is the tone accurate?
- 14:37Like all these things, This is when you.
- 14:39Were using LLM as a judge. Yeah, yeah, yeah.
- 14:41This is for LLM as judge. And it's very easy for the for
- 14:45the judge to think that everything goes well, but you
- 14:48really need to to instruct them to look at the errors, like find
- 14:52out what is wrong, because they don't have this capabilities by
- 14:56themselves. Like they're very eager to
- 14:59please you when you show them data, usually talking about
- 15:04various foundation models here that you can use to evaluate.
- 15:08But what you want is not that. So yeah, this is a very cyclical
- 15:12process. You need to keep people in the
- 15:14loop. You need to pull people from
- 15:17technical and product sides in the loop, because you have
- 15:20evaluation sets what to evaluate, but also how.
- 15:24What is the quality of the evaluation output?
- 15:27Because I think it's worse to get wrong outputs to not get
- 15:32them at all. Like you think everything goes
- 15:34well and then it doesn't. Of course you don't want that.
- 15:37Yeah, those silent failures is something that I wanted to ask
- 15:40you about too, because a lot of times maybe everything seems
- 15:43like on the surface it went well, but when you dig in and
- 15:47you look at that user experience, you go, wow, this
- 15:49was a horrible user experience. Yeah, I think nothing beats
- 15:53using the app and and testing it and.
- 15:56Being your own beta tester basically.
- 15:58Yes, we I think dogfooding is one of the most important things
- 16:02to do if you're developing a product, you'd need to use it,
- 16:05you need other people to use it, You need your grandma to use it
- 16:09too. It's really, yeah, it's really
- 16:12important to see the flow cuz open these apps involve UI
- 16:15elements. It's not just the agent itself.
- 16:19It's easy to sit in our corner and just evaluate the agent
- 16:22sitting in the tool. Well, yeah, but what if the user
- 16:25gets a completely wrong experience?
- 16:28So there, yeah, there is, especially at the beginning of
- 16:31this project, there is a lot of information sharing and yeah,
- 16:35like involving multiple people in this.
- 16:38Well, there is a fascinating thing here too.
- 16:40When it comes to the evaluations that you were talking about and
- 16:45the visualization that you were mentioning, you want to be able
- 16:49to visualize it in ways so that non-technical people can also
- 16:52get an idea of what's happening. I just mentioned heat maps with
- 16:56my buddy William. Did you have other ways of
- 17:01changing that data to visualize it for the others that you found
- 17:06particularly helpful? Yeah, I think distributions are
- 17:10really important. Sometimes you don't know what
- 17:15errors you're going to encounter.
- 17:16So it's also important to keep things free form like have the
- 17:20agents like summarize what went wrong simply and then aggregate
- 17:24everything later is very important because you can think,
- 17:28OK, what are the category of errors that I can get?
- 17:31What is the taxonomy? You can have a tool error.
- 17:33You can have, I don't know, time out error like there are many.
- 17:36You can start writing them all. But at the end you have, if you
- 17:40get our data, then you can just use that, right?
- 17:44I mean, these things are not mutually exclusive, of course.
- 17:47Yes, yeah. So that's a interesting way of
- 17:51putting it is why not just let the agent tell you what went
- 17:56wrong and summarize what went wrong and then you can have that
- 17:59as another data point? Exactly.
- 18:01Yeah, yeah. I imagine there's no shortage of
- 18:04data for this. So in and in a way you can
- 18:09always get more data. You can always ask the agent for
- 18:11more data and say what went wrong or show.
- 18:15Then you can also look at the traces and logs from different
- 18:19tools. You can look at the eval sets
- 18:21and if it's failing any of those, yeah.
- 18:25Is there like a 8020 here that we, if you're going into it,
- 18:30you're saying these I 100% need to have as data points and they
- 18:37need to be this granular or this sophisticated before I feel
- 18:42confident in pushing my agent out to production?
- 18:46Yeah. That's, that's a very bold
- 18:50question because it's, it's really hard, especially at the
- 18:55beginning to know how this is going to how this is going to
- 18:59look, right. Like especially if you don't
- 19:02have production data, you're kind of imagining how things are
- 19:06going to work until you write it out to user.
- 19:09Yeah, you, you don't, you don't have this information even like
- 19:12you can think these are all the use cases I want to cover.
- 19:15OK, 99% are cover, I will release or maybe 50% if you're
- 19:20more comfortable. But at the end you need real
- 19:24user data. So I would frame it the opposite
- 19:28way. Like I think that the, the goal
- 19:31is really get feedback as soon as possible and, and get and get
- 19:35this out. And if you release to some
- 19:37users, for instance, you will start to to have conversation
- 19:40logs and then you can really see where all the failures are.
- 19:45So there are some that you might want to accept, some that you
- 19:47might not want. In the case of search, there is
- 19:51always a precision, a recall problem.
- 19:54For instance, in like with information about food, you want
- 20:00to be precise because if someone has set certain that
- 20:02restriction, they don't want to give them wrong information.
- 20:06So it really depends on the project.
- 20:09You really need to sit down and with people from engineering
- 20:13products and and define what these things are.
- 20:16Yeah, maybe we haven't talked about it yet, but.
- 20:19But defining what metrics are comfortable with is really
- 20:22important at the beginning. So OK, you have an idea of what
- 20:27is good enough right? Will I tolerate 50% of the
- 20:32search is going wrong? Like what is?
- 20:35What is the tolerance level for errors?
- 20:38What do you accept? Yeah.
- 20:40Again, it goes back to this idea of like there are hard line
- 20:43things that we first sure cannot do, like giving free food away
- 20:48or telling a vegan that this food is vegan, but it's not.
- 20:54It's actually meat. Those are things that you're
- 20:57going to piss some people off very quickly with.
- 21:01And so you recognize along these lines we need very, very low
- 21:07margin of error. But over here we can be a little
- 21:10bit more. Yeah.
- 21:13Generous with our margins of error and.
- 21:15I mean, this is AI, we need to embrace it, right?
- 21:19It's not like user also expects the agent to be conversational,
- 21:24so they might get something wrong and then recover and and
- 21:28then give the right result at the end.
- 21:29You know, there can be some hiccups along the way,
- 21:32especially at the beginning. But I think with new AI
- 21:36products, people are a bit more comfortable with that by now.
- 21:40Of course then you want to improve it, but you cannot do
- 21:43that without enough data. So it's a bit.
- 21:46You need to be comfortable with this uncertainty and and
- 21:50leverage it. Like use the feedback and and
- 21:53build on top. Is there anything that you are
- 21:59particularly surprised about that you've learned along the
- 22:02journey of building these agents, putting them into
- 22:05production, that you want to share right now?
- 22:08Or that you can share with us that if you were going back and
- 22:12you were building this on day one, you would focus a lot more
- 22:17attention on. I think in general how complex
- 22:20these systems can be, like how many moving parts that can go
- 22:25wrong. I think at the beginning it's
- 22:28easy to underestimate. Like you, you're testing
- 22:30yourself a couple of use cases, it works and then you're good.
- 22:34I'm not talking about this agent in particular, like in general
- 22:37my experience building agents. But then yeah, you release it to
- 22:42users and they will find ways to.
- 22:45Multivariate. It, yeah, or not using it the
- 22:48way you think because you're someone building agents, so your
- 22:52mindset is completely different. So for me the most important
- 22:56learning point was to really trust users and get feedback
- 23:00from them. Trust users to break the thing.
- 23:04Yeah, like get get people that you're that with your opinion
- 23:09you value and and ask them to to test.
- 23:12Yeah. And how are you reincorporating
- 23:15that back into the product? One of the things you can do is
- 23:19to get a channel for feedback and have people posting feedback
- 23:23and then gathering all this feedback, aggregating it and and
- 23:27defining a road map based on that.
- 23:29Like what are the the main issues to fix?
- 23:31You know you can use LLMS in every step here.
- 23:36Yeah, you you can have an agent reviewing feedback and all and
- 23:39prompting you things to improve. When you're doing these
- 23:43different kinds of visualizations and looking at
- 23:45the distribution and all of that fun stuff and you find certain
- 23:49things that are out of whack, you're then just reincorporating
- 23:53that into your eval set, or I guess where is step one?
- 24:00Yeah, it's both. It's like when you find an error
- 24:03in in an application and you fix it like you find a bug fix.
- 24:06It usually good practice to add a unit test for that if you can.
- 24:11So I think having a curated set of of examples and edge case is
- 24:16also is really valuable here. So when you find something that
- 24:21is a bit off and it's a good idea to include it and depending
- 24:26on the severity, then you can you can fix it.
- 24:29Like this is more of a product problem.
- 24:32Then are you comfortable with that, yes or no?
- 24:36I think that's good. Is there anything else you want
- 24:38to hit on? If you want to work on put
- 24:40projects like this, we're hiring a process, so feel free to
- 24:44messages, send us your CV and yeah, let's keep building great
- 24:49stuff. Nice.
- 25:24Yeah.