Intro0:00
Hi everyone, uh, my name's Nick, and I'm here with Akshay to give a talk about evals. We are from— we're from Lyft, and we've been building Lyftt's customer support AI agent for a year or two now, and gave a lot of thoughts about how to build evals that actually matter and scale our AI agents, multi-agent— multi-AI agent system.
Just a little bit of quick introductions: my name's Nick, I'm a data science manager, I've been at Lyft for 6 years, a long-time Lyfter, and I'm really excited to talk to you a little bit more about evals. Hand it off to Akshay.
Hi everyone, uh, I'm Akshay. I'm in Nick's team, and we've been working together on customer support agents for Lyftt, improving the harness, improving the evals, things like that. And I've been at Lyft for almost 4 years now, and I'm very excited to be here and talk about building evals that actually matter.
Super excited to be here, and super honored to be— to be on the online track for AI engineer welfare. Yeah, and let's dive in. For the agenda of today, our talk will primarily focus on eval. We will start by sharing how we think about the end-to-end pipeline for evaluations for building support customer support AI agent system.
We'll go into— deep dive into each component more deeply as we go. We'll start by talking about offline evaluations, online evaluations, eval harness, as well as what we're planning to build going forward.
Alright, let's dive in. I want to quickly explain the, you know, high-level system of how we think about evaluation system for AI agents. So here you can see we have the development phase and the production phase. So during development, if you're building agents, you should be very familiar with, you know, managing contacts, building a rap pipeline to give your agents educational context, defining your tool, building your agentic graph, as well as writing a system prompt.
Eval Foundations2:03
So once all of that engine— agent engineering process is done, you have an— you have an AI agents. The way we think about this is, before we launch this AI agents to productions, we want to go through a rigorous offline evaluation process to make sure that this agent actually has sufficient performance before we launch this to a live users.
So coming from, you know, data science and machine learning background, we've been building model— machine learning model for— for a while. And I think the way that we think about agent development is very similar to building machine learning models as well.
If we are running offline evaluations for our machine learning model before that goes to productions, I think we should do the same for AI agents as well, or any other agentic platform— agentic applications. But what I think, you know, offline evaluation, how that— how that is different than traditional machine learning model is that, you know, we typically— we're building specifically for customer support AI use case.
We're building an agent that's multi-turn. So for offline evaluation, there will be a component of simulated conversations. So you want— you typically want to have a dataset, synthetic dataset, that's representative of your production's traffic, have a user LLM that plays— plays out the complete multi-turn simulated conversation, as well as having a grader, such as an LLM as a judge, to be able to evaluate how good that interaction was.
And then we have a launch gate,right? We want to make sure that we have certain criteria on our offline eval, and we're meeting that criteria before we decide to launch this AI agent to productions. And so the— the real imperative here really is that we don't want to use our live user as, you know, test data for our AI agents.
And I think in any— any cases, that— that is not— not good practice. So we really want to emphasize the importance of having an offline evaluation process. So once the agent hits productions, we also have an online evaluation pipeline as well.
We have our own favorite tracing tools to trace all the executions and contacts that the AI agent used to respond to a real user in— in productions environment. We have our online grader as well that grades how well our AI agent is doing in productions.
And as far as having a human-in-the-loop pipeline to do error analysis, identify failure mode, and feed back that insights to the development teams to continuously improve our AI agents.
I want to quickly go over, I think, three of the most common reasons why we think evaluation typically fail in— for— for different teams. So the first reason is that, you know, the— the grader that we create, the scores that we create, needs to be meaningfully gating something.
This is what we really emphasized on in the previous slide, that we need to have a launch gate. If your LLM as a judge is just floating out there, there's a score, but no one is really using that score as a meaningful gate for your development and productions environment, then that LLM as a judge is not— not available.
We have also seen a lot of— a lot of
mishaps people have when they're creating the LLM as a judge. There's a lot of different opinion out there on— in terms of how do you create a good LLM as a judge. And typically, and unfortunately also, very early on in our journey, the LLM as— the LLM judge that we created are very noisy, too generic.
It will output a score, and but people don't really believe in— in what the LLM judge is doing, or they don't think the LLM judge insight is actionable. And finally, I think when something regresses in productions, we need to have clear mechanisms to be able to— to— to catch that regression, as well as identify clear owners to be able to take actions on the insights of our graders and regression gate.
Very cool. I want to sequence into talking about our offline evaluation system. And as we— as I touched on early on, I think this is the most critical piece of going from development cycle to— to productions. We really want to have a robust offline evaluation system to be able to get more confidence in— in the AI agents that we're shipping to productions.
Offline Sim7:21
We took a lot of inspiration from this paper called "TOW Bench," which is developed by the wonderful people at Cyera AI, and this is specifically for customer support AI agent, but we also think this is applicable for any user-facing agentic applications.
So here, as you can see, this is an offline— offline simulations where you have the AI agent as well as a user LLM that are interacting with each other to produce the multi-turn traces. You have agent domain policy, which is essentially what the— you know, for each customer support use case, there is instructions, policy on how to handle different— different customer support issues.
So taking inspiration from "TOW Bench," this is sort of a high-level approach that we have in creating our offline simulator. As we mentioned earlier, we have our LangGraph agents that we've built, and we have defined and instructions for our— our user LLM,right?
As you can see, for simulation-wise, we define the user intent. We define, you know, what this intent is supposed to— to represent. And we define the user data point, or the world state of the— of our user. For example, you know, the driver that are coming to us might be a luxury driver that might have been driving for us for— for a couple of years, and so on and so forth.
And finally, to define the user— user behavior, or user personas, as we would typically see with our real, you know, real Lyft user as well, we also created these different personas for our user. One example here is that, you know, this can be a loyal, long-time Lyft customer, but they are frustrated with— with our Lyft earning systems.
So in our offline simulator, we have this LangGraph agent that are, you know, interacting with our user LLM model and generating these multi-turn trajectories of— of this multi-turn agentic— agentic trajectory. And we also built our offline— offline grader, or offline evaluator.
LLM judge is a big component of that. We will dive— dive a lot more deeper into how to build a great LLM as a judge. And apart from, you know, LLM as a judge, we also have more deterministic evaluator as well, and these usually look like a code assertion, as you will see in traditional unit test.
And for example, here, some— some of the deterministic criteria that we have created so far look something like this,right? If, you know, if in this— in this specific interactions, the AI agent is supposed to grant concession, we'll write, like, rules like this whether or not the AI agent has indeed grant concessions.
And we'll compare the agent— agent tool calls with the expected outcome to make sure that we— we can measure the accuracy of the agent instruction-following behavior.
So one of the big gotcha that we faced with running our offline evaluation is that creating synthetic data is— is one of the key challenges in making sure our offline dataset is representative of our productions data. So here we— you know, here we have a meme here.
User Sim11:17
What— ideally, what you don't want to be doing is just to simply prompt an LLM model to generate 50 different test queries for your offline datasets. So here's a couple of suggestions where you can approach this, you know, much more— much more realistically, and assemble a dataset that— that closely resembles to your production data.
So this is also something that we— we try to do for customer support AI agent as well. We take— we— we— we take some sample from our production data. So
a Lyft user has been reaching out to support for a long time. We take a sample of our real production example and supplement our offline dataset with that. And you— and the second thing that we can— we— we do is we mutate different criteria for— from our offline datasets to be able to cover different golden path and edge cases.
So
one problem with our offline evaluator is that, as— as we mentioned in the previous slide, if you were simply sampling different 50— 50 test use— test queries from— by using an LLM model, another thing— another big gotcha that we— we faced in— in building this offline simulator was that we were using a frontier lab LLM model to role-play Lyft user in our offline evaluations.
And for the most part, you know, our frontier lab model are trained to be helpful assistant rather than a Lyft user that might not— that might not sound as nice as— as always. So I— I think for everyone that have tried customer support before, you know, you don't typically reach out to customer support agent with a very nice verbatim.
So in our first pass at running our offline evaluation, what we noticed is that our LLM user sounds almost too nice. And as you can see on— on theright here, these verbatims are very, very— very, very complete. The use— the LLM user are very patiently explaining the issues that they are facing in productions.
And our first attempt at our offline evaluation gave us 90-plus pass rate or accuracy rate,right? This almost sounds too good to be true, and I think it indeed is too good to be true. So in reality, these are the real user verbatim that we get in productions.
As you can see here, those users, they are— they're impatient, they're already frustrated. So the verbatim, they— they— they don't want to explain their issues like a LLM user will. So typically what we see in production is— is something like this.
And in— in fact, in reality, the— the— this makes, you know, AI agents much more difficult to evaluate.
So what can we do here? How— how can we make sure our Lyft user LLM simulate this real-life Lyft user much closely,right? So what we— what we— how we approach this is we fine-tune a LLM model with Lyft user verbatim.
So instead of speaking like this, very verbose and very nicely and patiently explaining their issues, our LLM user will produce verbatim that resembles this much closely. And the benefit of this is, while— you know, we— we did see our evaluation score goes down after we fine-tune a LLM model that speaks more like our Lyft user, and therefore making our evaluation more difficult.
But in reality, this is really what you want when you're building this user simulator,right? If you have an eval that's too easy, that doesn't give you any real production insights into how your AI agent is actually going to perform.
And this also gives you a lot more room to be able to tweak your AI agents to deal with, quote unquote, "difficult users." And as I— as I gave a little bit of sneak peek earlier as well, we also did a lot of work to define Lyft user personas.
This can really ground our LLM user to adopt a specific Lyft user persona, and therefore simulate our real-life user much more closely. A couple of different user personas that we've defined here are, you know, bypasser user who just want to escalate to agent, regardless of— and not giving AI a chance, refund seeker, AI skeptics.
So the— we— we really also took inspiration from this paper from Microsoft user LLM, Microsoft paper, and I think they adopt a very similar— similar approach as well. They fine-tune a user LLM model and so evaluation score goes down.
But I think in— in reality, this is really— really what's expected and— and good for— for your applications.
Allright. I— I'll hand off to Akshay to talk more about LLM judge.
Allright. Hi everyone. So I'm going to take from here. I'll talk about the second problem which we usually face when we are doing evals with LLM as a judge. And here you can see, this is how pretty much everyone is using LLM as a judge to evaluate their agents.
LLM Judge17:38
The focus can be slightly different based on the use case. Someone can focus more on safety, someone can focus more on cost and latency, someone can focus more on quality. But people are going to measure these sort of metrics more or less.
So we want to detect leaks, we want to detect safety issues, and— and things like that. So some parts are deterministic, which can be evaluated by code, and some are not, which are evaluated by the LLM. Now, the problem with this approach is that these metrics are too generic and not actionable.
So, for example, we also started with our eval journey using prebuilt metrics from Deep Eval, which were— which were measuring tool usage appropriateness, response helpfulness, conversation naturalness, completeness, and things like that. And we did see those metrics. But the problem was these metrics were not actionable.
They were not giving us any actionable insights. If something— if, let's say, response helpfulness is 0.5, then what do we do with it? So things like— and other— other scores like toxicity score, bias, fairness, conciseness, all these are kind of relevant, but if the metrics are just as scores, we— we don't know what to do with them.
So we can use these prebuilt eval metrics as a baseline, but we shouldn't use them as our core eval metrics because we want eval metrics to be actionable and tied to the business outcome or the product which we are focusing on.
Okay, so what LLM as a judge should be? We collaborate very closely with domain experts and utilize their insights. So evals should be framed around a task success or failure. And a binary outcome is very easy to calibrate and train LLM judges that can consistently score your agentic trajectory.
When we partner with domain experts and data scientists to build metrics which are actionable and aligned with business goals, we can see much more meaningful results and actionable insights. Not only this is more consistent, but when an agent fails an interaction, we can systematically analyze the error pattern and have— and actually know what— what we can do to fix this.
Here is an example of an actionable metric for our use case, which is called education rubric. Here the AI— we— we define the metric how it should be, and we define success and fail criteria for LLM judge. So, for example, the AI agent tries too many times to educate the user if it could have excellate— escalated the— the issue, or if it's escalating too soon without giving any chance to educate the user.
So things like that comes under failure category. So we— we mark this as fail. But if it's unexpected behavior, we mark it as— as pass.
Okay. So
with this, how do we validate if our LLM judge is working as expected? First thing is we need to treat it as a classifier. So how we train our classification models in machine— traditional machine learning, we can also treat our evaluation judges as— as those traditional ML classifiers with binary outputs.
Once we have binary outputs for every metric or a task based on our business goals and functional requirements, we can hand-label around 100 examples with pass/fail labels and then split the data into train, dev, and validation sets, like how we used to do with machine learning models.
Then we score precision and recall for our judge based on human-labeled ground truths, which will give us an actual report on how good our judges are performing.
And how do we split our data to do— to calculate precision and recall is this. So we split the data similar to how we used to do in training machine learning models, but the difference is the percentage of splits.
And here we are not actually training model weights, so we are just using the data to inform judges' prompt. So the percentages are a little bit different. For example, in training data, we— we pick a few short examples from that— from this set for the judges' prompt, and then we iterate the prompt against the dev set and improve our harness or our prompt.
And then finally we validate against the test set to see that we didn't overfit on the dev examples. This is the practical
way of, like, splitting the data and then calculating precision and recall scores for your judge to actually know that the judge is working as— as expected.
Allright. Next slide. Okay. So this is another thing which— this is another thing which most of us ignore when we are doing evaluations, which is criteria drift and validating the validators. The key idea is that we actually discover what our evaluation criteria is by looking at the data and grading our outputs.
Eval Process23:24
Our— and our sense of quality will also evolve with— with new data we see and more examples we grade. So the evaluation should not be decoupled from model observations. In fact, they should be developed— they should be co-developed with the model when we are testing the evaluator and calculating the precision and recall scores.
So we— there— there's always a gap when we— when we talk about LLM as a judge. We cannot define the criteria beforehand and then evaluate agents against them. Our criteria should also be evolving as and when we see more examples.
And then we should refine our metrics for our judges and then evaluate judges on top of those metrics.
Okay.
So the next step,
one of the things which— which can make the numbers we are reporting more meaningful is to add some statistical rigor to it,right? We report alignment rates as bare point estimates. So if we add confidence intervals, we do some calibration and proper sampling, the same numbers can become more meaningful.
We should definitely reserve the expensive rigor for the moments a number actually gets something or like— like a shipping decision or we are reporting numbers to company leaders. But depending on the use case, we should definitely have confidence intervals for the— for the numbers we report because every score needs an interval.
So this is just a small example to give you an insight on what this actually means. Let's say we have two evaluators and one scores 84% and one— and the other scores 88%. And the number of samples we— number of traces which we have used is, let's say, 50.
So to show that, like, this is— this is a very small gain and we— we need much more than 50 examples to actually show that this gain— gain is real. With just 50 examples and only 4 percentage point percentage gains, again, we— we don't actually know if this gain is real or not.
So bigger gains and— bigger gains and paired designs need far less, and we can reserve the rigor, statistical rigor for— for things which matter the most.
Okay. So this is a non-exhaustive list of observed eval anti-patterns. I'm not going to read all of them, but these definitely contain some low-hanging fruits. We need to put in time and effort if we— if we need meaningful evals.
So we cannot rely on LLMs for everything yet. And what I can say is ignoring the data is one of the most important things which we shouldn't do and which we sometimes don't focus on due to lack of time or resourcing, but it acts as the foundation for meaningful evaluations.
If you don't look at the data, you won't be able to create meaningful criteria or labels. And if you don't have labels, you won't be able to evaluate your judges. And if you are not evaluating your judges, you don't know if your agentic pipeline is working as expected.
So this acts as a base. So one of the most important things we should not ignore. Okay. We— we said that we want to make metrics more actionable and standardize the pipeline, but how actually we should do it?
So this— this gives you, like, a template to— to do an error analysis loop. And it is important to know that this loop is something which runs continuously. It's not— not an one-off audit.
So we deep dive into raw traces. So once we have logged our traces for our agentic flows, multi-agent systems, or whatever we have in our use case, then we pinpoint failure modes. So basically we try to identify what exactly is failing.
And we only keep the metrics that change a decision. We remove all the noise. We only prioritize on the metrics which are tied to business use cases, functional requirements, and actually something which changes a decision. Then we form a fresh premise to reevaluate, and then we repeat it.
So we can have, like, a regular cadence of doing this pipeline. It can be weekly, it can be biweekly, but this is something which needs to run continuously and it's— it's not a one-off audit.
Okay. So tracing. Tracing, as we said, is one of the most important things, and everything kind of depends on it. For diving deep into raw traces, we definitely need to log them first. So we can use tools like Langsmith, Langviews, et cetera, to log and view the traces.
And here each trace captures the full graph execution, which nodes ran, what LLMs saw, which tools were called, what was the token usage, what was the latency for every call, and things like that. We can also enrich traces with metadata if we want, which gives you more insights than— than the actual data.
Okay. And we also have annotation queues. Annotation queues are nothing but an interface which is very helpful for domain experts to label or give feedback to evaluators in an easy-to-understand UI. So they don't have to look at the raw traces, JSONs, and stuff like that to figure out what to focus on.
They can use this annotation queue and they can give feedback or label examples easily. We can then add these traces to datasets for offline evaluation, or we can use this for our calculating our precision and recall for our judges.
So this forms the basis to validate the evaluation with ground truth labels.
Okay. I— now I'll hand it over to Nick to— to close the evaluation loop.
Thank you, Akshay. And I think the— the goal of having eval is to be able to feed our evaluation insights back into improving the model performance or the agent's performance. So here I'll introduce a couple of ways that we think about continual learning for our AI agent and closing the evaluation loop.
Continual Learning30:52
And here you have model learning, context learning, and harness learning. Model learning is really about, you know, post-training, updating the underlying model weights and training a custom LLM model. Context learning and harness learning is really more about improving everything else other than the model.
So context is improving what information the agent actually sees. This can be document, this can be the store memories of the user, two outputs, and so on and so forth. Harness, that means updating the model system prompt and two schemas, control flow, routing, retries, and— and so on and so forth.
So I think from, you know, the error analysis that Akshay had shared earlier, I think that has really helped us to understand how can we improve our agent prompt as well as updating— updating our knowledge base and tune the context management strategy that we have for our AI agent.
The identify failure mode really helped us be able to feed that insights into actual improvement for the agent AI agents.
So I want to quickly talk about what's next for us in our journey of building customer support AI agent at Lyft. We have a— we— we have— we have some— some level of ability to run our offline simulator, but in fact, I think, you know, it's not repeatable.
Future Plans32:32
These are currently stored as scatter script across different notebooks and different analysis repo. I think one thing that we're looking really— really looking into investing is a systematic eval harness and having a— a harness system that can help run our offline evaluation in— in a systematic and standardized manner and allow different people to contribute to our evaluation suite with a very— with— with predefined primitive and config-based workflow.
Another thing that we've been talking— thinking a lot about is post-training. As we mentioned earlier, you know, identify model failure mode has really helped us tune the agent context and as far as the agent harness. But over the years, we have gathered a lot of real user signals on our agent performance as well.
So we— we're really starting to think about how do we fine-tune a model that does different tasks for our customer support AI agent as well as framing a reward modeling problem to— to enable reinforcement learning.
I want to quickly share a little bit about the work that we're doing with eval harness and how we think about building— building— building eval harness for agent-facing— user-facing agentic applications. So again, eval is really that scaffolding that you— that we need to be able to run eval efficiently in a standardized format across all the different agents and sub-agents that we have for customer support AI agents.
Eval Harness34:11
And as you can see from my offline simulator slide earlier, our eval harness is config-driven, and these are typically stored as YAML files that's easily editable by different contributors and not just by engineers. Analysts and data scientists can— can contribute to this evaluation suite as well.
And, you know, with thousands, if not tens of thousands of examples in our evaluation suite, we need, you know, parallelisms and throughput to be able to run our offline evaluation in a reasonable amount of times and to enable user to be— different user to be able— to be able to contribute to our eval evaluation suite.
We also define, you know, primitives around our eval— eval harness. These are high-level things like task, datasets, personas, LLM adapter, and evaluator. And after all, you know, the benefit of having an eval harness is that you can define the config once and run these eval indefinitely many times across different— at different touchpoints or different gates of your agent development process.
This can be, you know, locally when you're developing this agent.
At any point when you tune a prompt, you can run the evaluation suite and get immediate— immediate feedback on how your agent is doing compared to the previous versions. We can run these at pre-commit cook to make sure that our performance doesn't degrade before we push a change to our agent service.
Another area that we are looking at is also CI/CD and how we can use our eval harness to build our regression test suite, acceptance test suite as well.
Wrap36:43
So that wraps up our presentation today. We've gone through a lot of— we've gone through a lot of— a lot of different topics for evaluations. Really, I think this is an end-to-end journey for building an evaluation pipeline that works for customer support AI agent or any user-facing agentic applications.
Akshay and I, we are very interested to hear about, you know, what you all have been working on and share any learnings that you have for eval. So feel free to contact us if you have any questions or you just want to share a brainstorm about how to improve your evaluation system.
Allright. Thank you, and I hope you'll enjoy the AI engineer world fair.
Thank you.
Thanks all.





