AI Engineer

Don't Approve the AI Model. Approve the App - Doneyli De Jesus, Langfuse

1616 summary words 7 min summary Watch video

Start with the signal

7 min read

Summary

At-a-Glance

  • Verdict: Watch fully
  • Core thesis: For regulated AI, approval should attach to a versioned application and its controls—not to an underlying model—using internal golden data, multi-dimensional evaluation gates, trace evidence, and domain-expert review.
  • Why it matters: This is a concrete control-plane pattern for shipping and changing agents safely: model, prompt, tool, or configuration changes can be evaluated against the same use-case-specific release criteria rather than reopening a model-certification exercise.
  • Best use: Use it as a concise operating model for production agent evals, particularly where correctness, auditability, regulated outputs, and model portability matter.

Executive Summary

Doneyli De Jesus describes Langfuse's work with a top-five bank building a 10-K/earnings-call analysis agent for investment bankers. The bank's governing principle was explicit: it does not certify models; it certifies applications. Public benchmark leadership says little about whether an agent works safely and accurately with proprietary data, institution-specific context, and the bank's compliance obligations.

The proposed release process treats a golden dataset as software test cases. Each agent version runs against that dataset, producing traces as auditable evidence; evaluators score the run across selected dimensions; and a gate determines whether the application is promotable. Changes to prompts, models, tools, or configuration must rerun this clearance process.

A central case study shows why application-level control matters. A model scored 97% on groundedness against internal data but only 60% on numerical accuracy. Rather than searching for a universally better model, the team added a deterministic calculation tool; numerical accuracy rose to roughly 95%, clearing the bank's 85% threshold for that use case.

The talk argues for blended evaluation rather than a single aggregate score or pure LLM-as-judge approach. Deterministic tests cover stable, rule-based requirements; path evaluation checks whether the agent followed an acceptable process; LLM judges assess qualitative output dimensions. Domain experts set use-case-specific thresholds, review failing traces through annotation queues, and turn validated failures into additions to the golden dataset. The reported result was reducing evaluation cycles from weeks to minutes.

Key Takeaways

  • Claim: Regulated organizations should approve an AI application version, not an AI model in isolation. | Evidence: The bank told Langfuse, "we don't certify models here, we certify applications"; release-relevant changes include the system prompt, selected model, tools, and other agent configuration. | Implication: Build approvals and audit records around a versioned agent configuration plus its eval results, enabling model swaps without treating every vendor/model choice as the sole object of governance. | Caveat: This does not eliminate model risk; it shifts the decision criterion to whether the full configured application passes its use-case-specific controls.
  • Claim: Internal golden datasets—not public benchmarks—must anchor production evaluation for proprietary, high-stakes use cases. | Evidence: The bank's 10-K analyst needed institutional context beyond an earnings-call transcript; the proposed dataset format contains inputs, expected outputs, and metadata used to assess output quality and behavior. | Implication: For each agent, define a representative internal benchmark that captures the decisions, documents, edge cases, and failure modes that actually determine whether the system is fit to ship. | Caveat: A golden dataset is not static: reviewed production failures and expert feedback should become candidate test cases over time.
  • Claim: A multi-dimensional gate is necessary because high average quality can conceal an unacceptable failure in a critical dimension. | Evidence: In an end-to-end run across datasets of roughly 150 and 1,500 questions, an agent could pass groundedness, completeness, and usefulness while scoring zero on regulatory compliance; compliance was framed as binary and capable of blocking release outright. | Implication: Define hard-stop dimensions such as compliance, policy adherence, or safety separately from optimization dimensions such as helpfulness, and make release logic reflect that hierarchy. | Caveat: Thresholds should vary by application and dimension rather than using one universal percentage or average.
  • Claim: Agent quality improves more reliably by assigning deterministic work to tools than by expecting an LLM to solve every task itself. | Evidence: One tested model achieved 97% groundedness but only 60% numerical accuracy; adding a Python calculation tool for numerical operations raised that score to about 95% and pushed the application above the bank's 85% gate. | Implication: Use evaluation failures to identify where agent workflows need architectural controls—calculators, validators, retrieval constraints, or other deterministic components—instead of treating model selection as the primary lever. | Caveat: Tool addition itself becomes part of the application surface that must be evaluated for correct invocation and end-to-end behavior.
  • Claim: Evaluation should combine deterministic checks, trajectory/path checks, and LLM judging rather than relying entirely on LLM judges. | Evidence: The speaker distinguishes code-based deterministic scores, evaluation of whether the agent took an appropriate route to its answer, and LLM-as-judge scoring for qualitative aspects; she states that 100% reliance on LLM judges "is not going to cut it." | Implication: Design the eval stack by failure type: deterministic evaluators for objective rules, trace/trajectory evaluators for required workflow behavior, and model judges only where semantic judgment is unavoidable. | Caveat: The presentation does not prescribe a universal evaluator mix; it says teams must define metrics that matter for their own use case.
  • Claim: Trace-linked evaluation and expert annotation create an auditable continuous-improvement loop rather than a one-time pre-release review. | Evidence: Traces record what the agent was evaluated against; failed traces—such as regulatory-compliance failures—are routed into an annotation queue for domain experts. Prompt promotion or any configuration change triggers a rerun, while expert feedback can feed new examples into the golden dataset. | Implication: Treat observability, evaluation, human review, and dataset curation as one release system: every change should be attributable to evidence, and every material reviewed failure should be considered for regression coverage.

Detailed Brief

Deployment and governance constraints in financial services

  • Claims: The customer required AI systems to remain under institutional control rather than freely exposing sensitive workflows and data to external services.; Usability is a governance concern alongside correctness and compliance: a compliant system that analysts do not trust or adopt still fails organizationally.
  • Evidence: The speaker identifies three common requirements: on-premises operation, network/data-access gating, and air-gapped deployment.; Banks may repurpose data centers and stand up local GPU infrastructure, and some maintain research teams that train or fine-tune models.; The stated production bar includes meeting compliance requirements and avoiding user complaints that would undermine adoption and sentiment.
  • Caveats: These infrastructure constraints are presented from a financial-services engagement and should not be assumed necessary for every industry or risk tier.
  • Implications: Architecture decisions for sensitive agent systems should be made jointly with governance and deployment requirements, not added after application behavior has been designed.; Release criteria should include usability-oriented dimensions when the agent is intended to augment professional workflows.

Practical release-loop outcome

  • Claims: The value of the framework is operational speed with preserved evidence, not merely better offline scoring.; There is no universal template for agent evaluation; the dimensions and gates must be chosen per use case.
  • Evidence: Langfuse reports helping the customer move application evaluation from weeks to minutes, including workflows in risk and compliance that can otherwise take months.; The speaker repeatedly frames the process as iterative and tied to the organization's own data, domain experts, and risk tolerance.
  • Caveats: The weeks-to-minutes result is a reported case-study outcome, not a general performance guarantee, and the transcript provides no implementation-cost or baseline-process detail.
  • Implications: The strongest ROI comes when eval gates are automated in the change-management path and human review is focused only on curated, high-value failures.

Notable Concepts & Terms

  • Approve the application, not the model: The governing principle that the deployable unit is the complete agent configuration—model, prompt, tools, retrieval, and controls—not a model's generic benchmark score.
  • Golden dataset: The internal collection of test cases, expected outputs, and metadata used as the use-case-specific anchor for evaluating agent releases.
  • Quality gate / gate clearance: A pass-fail release decision based on defined thresholds across multiple evaluation dimensions; failing a critical dimension blocks promotion.
  • Trace evidence: The recorded execution evidence showing what an agent did and what it was evaluated against, used for auditability, diagnosis, and change comparison.
  • Trajectory or path evaluation: Assessment of whether the agent followed an acceptable route to its answer, not just whether its final answer appears plausible.
  • Annotation queue: A curated set of failed traces routed to domain experts for review, feedback, and possible conversion into new regression-test examples.
  • Deterministic evaluator: Code-based scoring that returns the same result for the same input, suited to arithmetic, rules, and other objectively checkable requirements.
  • Air-gapped deployment: A deployment isolation requirement used here to keep sensitive banking data and access within controlled infrastructure.

Operator Notes / Why Ken Should Care

  • Define a release manifest for every agent version: model identifier, prompt version, retrieval configuration, tool versions, policy configuration, and the exact eval dataset/evaluator versions.
  • Classify current agent metrics into hard-stop gates versus optimization metrics; do not permit high average scores to compensate for a compliance, security, or policy failure.
  • Add deterministic tools and evaluators wherever failures concern arithmetic, schema validity, required citations, authorization, or other rule-governed tasks.
  • Create a review queue that routes traces by failure category to the relevant domain owner, then establish criteria for promoting reviewed cases into regression coverage.
  • Require automated regression evaluation on every prompt, model, tool, or routing change before production promotion; retain the resulting traces and scorecards as release evidence.

Source/Metadata

  • Title: Don't Approve the AI Model. Approve the App - Doneyli De Jesus, Langfuse
  • Transcript words: 6242
  • Duration seconds: 1159
  • Timestamp note: No timestamps or chapters were present. The supplied transcript substantially repeats the presentation's second portion.
Full transcript 3250 words · 28 min read
0:12

I'm leading AI engineering solutions at Langfuse by ClickHouse and we are an agent observability and eval platform that a lot of users use open source and I'm here to talk to you about an experience that we had with one a top five bank helping them getting through how they can put safety guardrails whenever they were shipping AI applications into production and to make sure that they are running with the proper evals on that. I'd like to start with something that we learned with the experience with this customer: regulated industries don't necessarily care about the public benchmarks. I know that every week anytime a new model comes out we see all the benchmarks. You know Opus 5 is now leading the benchmarks in a multitude of dimensions and that's great that tells us what the models are really good at in terms of the technical capabilities and sometimes using open data sets that are out there but sometimes that doesn't mean that it will translate effectively to internal data and use cases that you have in your organization. Specifically around financial services where banks are very sensitive to their data and their use cases and for the most part they like to believe that that's part of their secret sauce the way that they build their own models, build their own data sets and also not exposing a lot of that data to the public. So that's why we needed to figure out a way that the financial services and this bank in particular could then say look we don't necessarily care what the model can do. What we care about is really whether this application that we're trying to build can ship into production. A good example would be a 10K analyst that they were trying to build for their investment bankers. Every time an earnings call comes out, they want to make sure that their teams can accelerate and get leverage from all the information that's out there and as soon as an earnings call is done they can get an analysis on all the transcripts. However that is not just a simple task of taking the call transcript and just summarizing it because there's a lot of knowledge that the analyst has and a lot of context about how the bank and the firm operates that is not necessarily ingrained or trained in the models out of the box. So how do you bring that knowledge and that context into the model and then furthermore once you've done that how do you reliably evaluate that the outputs that it's giving you are the correct ones and that you can clear those quality gates that you have put in place. So that was a big learning for us that they told us directly: look we don't certify models here we certify applications. It could be a 10K analyst or investment analysis and whatnot. The other learning from this experience is that in regulated industries and in finance in particular there are three main requirements when it comes to building solutions. The first one more often than not is they wanted to stay on their own premises. This could be either their own data centers because it's funny how things are kind of coming back to center because we have been doing all this movement into the cloud but now because of AI and how sensitive the information that we're feeding these models is, especially banks are rethinking and repurposing a lot of their data centers that they had and actually standing it up again and standing up GPU infrastructure to run models locally because of the sensitivity of the data that they are dealing with. The other requirement is that it has to be gated. It cannot just be going out to the internet for obvious reasons. They don't want to have even the appearance that some model provider will train on their data even if there's zero data retention and all these guarantees but banks are very sensitive to that and they want to make sure that stays within their control and sometimes you have even banks that actually have research divisions that actually spend time and have PhDs training their own models and fine-tuning them. The third aspect is that the deployment needs to be air gapped so that only the people that need to see that data and it's within their infrastructure, that is very critical. When we were talking to them, it's okay now you have all this platform, we have all these models but then we need to prove that the application is actually working the way that we want, that it is actually meeting the compliance requirements that we have as a regulated industry and third that our users are not going to come to us complaining that it's not usable because then it becomes a situation where you don't get user adoption and there's dissatisfaction and bad sentiment about using AI enabled solutions. So we needed to find a way to help them come up with a framework and a methodology for them to have a stamp of approval, pass fail, if an application or an AI agent had any change on their configuration, could be the system prompt, could be the model that they're using, a new tool, but then how do I give it okay this is ready to go into production or not based on these changes that we have given them? And then if we go at a very high level, how does that work mechanically? The first thing that we need is to build a golden data set. That's the first thing that's the anchor. A lot of this good news is a lot of these banks they typically already have a golden data set that they want to test against but sometimes what is missing is how they can operationalize the testing of the test cases against that data set. But that to me typically is the anchor. The way that I like to think about this if you come in from a software engineering background is these are your test cases. You will never push anything into production without passing it through QA. So this is the same principle. Then once you run this and you operationalize it, you're going to generate a bunch of traces and the traces are the evidence of what the model was evaluated on against this data set. So you have that evidence on the trace and then at the end with the trace as the evidence that you have, you can then generate the scores that are going to give you the pass fail across different dimensions that you select. When we started out this journey with this customer we first started with a couple of models, small and large models with different levels of intelligence and we noticed something interesting. So this one is a particular example of two numbers that has stuck out for us. The first one, 97 in groundedness, is that this model was really good at extracting information from internal sources and grounding the responses on actual data that the bank had. Perfect, 97, that is a passing bar, amazing. But then when it came down to give accurate numbers, then the number dropped. The model was tripping up because LLMs inherently are not great at math. They're just next token predictors. And then what happened was that even though it was grounded on actual information from the bank, whenever it needed to give financial numbers or just do simple math, the model was failing. And then I'll show you in a minute how we were able to go about that. This leads us to then what I said before, that they don't approve models, they approve applications. So how they can put a harness or controls around this model so irrespective of if tomorrow I swap a model, then the quality of my application will still remain the same.

0:19

Now we are expanding into the process that we help them establish starting from the left with the golden data set. Then you go into the inside of the agent. The agent is going to do a bunch of tasks. It's going to have a planning phase, it's going to retrieve data from your official sources and then you see the little box that is circled in blue, it's going to calculate. In this case what we did, we gave the model a tool for those areas where the model was coming up short, the 60 percent where it was not scoring well. Then we said you know what, this is a task that the model doesn't need to do on its own. We can just give it a tool because math is deterministic. It's going to be the same all the time and then we can improve the accuracy of the model. But at the same time, if you notice all the dimensions that we have, we are evaluating the application against a multitude of dimensions, not just one. We're not going to say well because everything on average is giving me above 90 percent then it's going to pass. That might not be the case. You might have different degrees or thresholds for the different categories that you have here in terms of accuracy, regulatory compliance and whatnot. And then at the end is where you define your gate. Anything that doesn't clear the gate based on your thresholds doesn't get promoted into production. This is just a snippet of the code and at the end a link to the repo and to the blog post that you can read more in depth about the work that we did here. But it's effectively you want to build your own benchmark instead of relying on the public ones that are available there. The first thing you need to do that is to build the data set. This is an example of what a typical dataset will look like. There are key pairs you have inputs, expected outputs and some metadata that you are then using to evaluate how the agent is performing both in terms of quality, behavior and the responses that it is giving you.

0:25

This is how it looks after we have scored or evaluated one agent run and you notice that I circled the calculate tool call because in this case now this is how we were able to get the model from 60 percent in numerical accuracy all the way up to 95 percent because we gave it a tool. Anytime there's a number that needs to be calculated just use this little Python code and off you go. And in that way you can improve the results that you're giving back to your customers.

0:31

The other step on this is about scoring. How do you score each of the dimensions that I was telling you before? We have a couple of ways that you can do this. You can have deterministic scores that, the name implies, is very simple. This is not LLM based. You just have code that is running and for the same inputs it's going to generate the same outputs all the time. And what we've noticed is with these solutions as they get more complicated, you need a blend of scores and evaluators that are deterministic and non-deterministic because otherwise relying 100 percent just in LLM judges is not going to cut it. The second path is you also want to figure out if the agent is taking the right route or path to get to the answer because it might be that the answer might look okay or complete or semi-complete but then maybe the route it took to get there might not be the appropriate one, might be missing steps. So you also can evaluate that. And the third one is about how you use an LLM as a judge to judge some of the more qualitative aspects of that answer. By doing all of this then we got to taking this little model that was failing with 60 percent and got it to over 90 percent and then we are clearing the 85 percent gate that the bank had for this particular use case by adding that tool but also by adding this evaluation framework on top. Then we can measure the accuracy and the quality of the agent across many different dimensions.

0:37

This is something very important because now you can go back and show the evidence of how you actually measure the quality of the agent but also more importantly you can link it to the changes that were made into the agent into the configuration, system prompt, model, tools that were used. And then you say oh but look at how by adding this tool, changing this model, we went from 60 percent accuracy over to 95, 90 plus percent accuracy. And now this is where you start defining your gates. This is where working with your domain experts becomes very critical. You don't want to just rely on technical ability for this. You want to make sure that if you're delivering on a risk use case that is going to be AI enabled, you have the risk people involved to tell you what is the bar that it needs to meet for them to feel comfortable putting this either internally or in front of customers. And that bar might be different depending on the use case. So that is why you need to have first the dimensions or the scores on which you're going to evaluate this application and then for each of those and for each use case or application you end up with different thresholds that the agent needs to meet in order for it to have that stamp of approval for it to go into production.

0:45

And this is what it looks like when we have a full end-to-end run across different data sets. We had one data set that was like 150 questions, another one was like 1500. But now you can measure the configuration of the agent across these different dimensions and vertices and you see how even though it is passing on groundedness, completeness, usefulness, you might say if I take the average of all of this then it should be okay. But in regulatory compliance it's getting a zero. That is one that is just binary. It's either zero or a hundred. You don't want to put in anything if you're a bank out there that is going to violate any regulatory compliance requirement that you have because you might get penalties, you might incur reputational damage and all of that. So it might be that one dimension actually completely shuts down the gate for you to move this into production. So that's why it's critical to have a multi-prong view on how you evaluate your agents.

0:50

And this is where when you start picking up all these failures or what we call them failure modes, this is where bringing back the domain experts is really critical. You can curate for them what we would call an annotation queue. So anytime there is a failure on regulatory compliance, I want to curate those specific traces or evidence right from my evaluation and put it in a place that my domain expert can come in and look at the trace, look at what happened and then give me feedback. And with that feedback I can then go back and feed that back into the agent to improve it.

0:58

And this is what it would look like connecting it to the process before but including that human expert in the middle. If you notice down below, anytime a couple of things are happening here. Anytime a prompt gets promoted or a change in the configuration, then it triggers a rerun of the gate clearance process or the evaluation process. But anytime a reviewer or a human expert comes in and gives me feedback that is a potential candidate to go back into my golden data set because now we have evidence from runs of the agent that have been reviewed and now we can say oh actually this one piece is a better bar to evaluate this particular dimension on the agent.

1:04

And this is the whole process end to end to make sure that we are including the domain experts but also making sure that we're clearing our quality gates. Then this got us to a place where we were able to help them go from weeks to minutes when it comes to evaluating your applications, especially in risk and compliance which typically take even months sometimes. But this process becomes very iterative. We can be very specific and focus on the areas that we want on the agent. Then there's no template for this. This industry is being developed right now. Typically you need to define what it is that you want to evaluate and the metrics that matter to you.

1:11

And the three things that I'd like to give you are: you need to write your own benchmark because the public ones don't really matter for your data because they were not done on your data per se. The second one is you have to gate the application, not the model. That gives you more flexibility if tomorrow you want to swap a model, you have already all the controls in the application and in the configuration of the agent and then it becomes easier for you to adjust. And then the third is let the domain experts come in and set the bar or the thresholds that are deemed reasonable in order for you to promote this into production. And finally, use your data. Your data is your bar. Your data is your gates, especially in regulated industries where you want to keep things in your premises and you're probably not relying on publicly available information. So thank you for the time. I know I'm a little over but I wanted to give you the detailed blog post of this work that we did. It also links to the repo that you can reproduce this yourself and I'm around if you have any questions. So thank you.

1:17

will translate effectively to internal data and use cases that you have in in your organization and specifically around you know financial services where banks are very very sensitive to the their data their use cases and for the most part they like to believe that that's part of their secret sauce the way that they you know build their own models build their own data sets and also not exposing a lot of that data to uh to the public um so that's why we needed to figure out a way that the you know financial services and this bank in particular that they can then say look we don't necessarily care what the model can do

1:58

what we care about is really whether this application that we're trying to build can ship into production a good example would be like a 10k analyst that they were trying to build for their investment bankers you know every time an earnings call is it's out there they want to make sure that their teams can accelerate and get leverage from all the information that it's out there and as soon as an earnings call is done they can get an analysis on all the transcripts and all that however that is not just a simple task of just taking the the call transcript and just like summarizing it and whatnot because there's a lot of

2:31

knowledge that the analyst has in a lot of context about how the bank and the firm operates that is not necessarily ingrained or trained in the models out of the box so how then then you bring that knowledge in that context into the model and then furthermore once you've done that how then you reliably are able to evaluate that the outputs that is giving you are the the correct ones and that you can kind of clear those quality gates that you have put in place so that was that was again a kind of a big learning for us that they and they told us uh directly look we don't certify models here we certify applications

3:11

right so it it could be a 10k analyst it could be an investment analysis and whatnot the other learning from this experience is that in regulated industries and in finance in particular there are three main requirements when it comes to building the solutions the first one that more more often than not they wanted to stay on their own premises um and this could be either their own data centers because it's funny how things are kind of coming back to to center because we have done we have been doing all this movement into the cloud but now because of ai and how sensitive the information that we're feeding these models is

3:52

then especially banks are rethinking and repurposing a lot of their data centers that they had and actually standing it up again and kind of standing up gpu infrastructure to run models locally because of the sensitivity of the data that they are dealing with on these models the other thing is the other requirement is that it has to be gated it cannot be just going out to the internet obvious for obvious reasons they don't want to have even the uh the appearance that some model provider will train on their data data even if there's like zero data retention and all and all this you know guarantees but banks are

4:30

very sensitive to that and they want to make sure that that stays within their control and sometimes you have even banks that actually have uh kind of research divisions that actually spend time and have phds training their own models and fine-tuning them and all that and the third aspect is with all of this is that the deployment needs to be air gapped right so that only the people that needs to see that data and it's within their infrastructure that is very very critical the the other thing is when when we were talking to them it's like okay now you have um all this platform we have all these models but then we need to prove

5:06

that the application is actually working to the way that we want one second that is actually meeting the compliance requirements that we have as a regulated industry and third that our users are not going to come to us complaining that is not usable because then you know it becomes a situation where you don't get user adoption and then there's a dissatisfaction and a bad sentiment about using ai enabled solutions so we needed to find a way to help them come up with a framework and a methodology for them to have like a stamp of approval pass fail if an application or an ai agent had any change on their configuration that

5:45

could be the system prompt that could be the model that they're using a new tool but then how do i give it okay this is ready to go into production or not based on on these changes that um we have given them and then if we go like very high level how does that work mechanically right the first thing that we need is to build a golden data set that's the first thing that's kind of the anchor um a lot of this good good news is a lot of these banks they typically already have a golden data set that they want to test against but sometimes what is missing is how they can operationalize the testing uh of the test cases

6:26

against that data set but that's to me typically is the anchor the way that i like to think about this if you come in from a software engineering background is these are your test cases right you will never push anything into production without passing it through qa right so this is the same principle then once you run this um and you operationalize it you're going to generate a bunch of traces and the traces are the evidence of what the model was trained on or sorry what the model was evaluated on right against this data set so you have that evidence on the trace and then at the end with the trace as the as the uh as the

7:04

kind of the uh as that you know evidence that you have you can then generate the scores that are going to give you the pass fail across different dimensions that you uh select when we started out this journey with this customer it was we first started with a couple with a bunch of models um a small large models with different levels of intelligence and we noticed something interesting right so this one is a particular example of two numbers that has stuck out for us the the first one 97 in groundness is that this model was really good at extracting information from you know internal sources and grounding the responses

7:46

on actual data that the bank had perfect 97 that is a passing bar amazing but then when it came down to give you know accurate numbers then the number was tripped the model was tripping up because again llm's the numbers inherently are not great at math they're just next token predictors and then what happened was that even though it was grounded the responses on actual information from the bank whenever it needed to give financial numbers or just do simple math the model was failing and then i'll show you in a minute how we were able to go about that and this leads us to then again what i said before that they don't approve

8:28

models they approve applications so how they can put a harness or controls around this model so irrespective of if tomorrow i swap a model then the quality of my application will still remain the same now we are expanding into kind of the process that we help them establish starting from the left with the golden data set then you go into the inside of the agent the agent is going to do a bunch of tasks it's going to have a planning phase it's going to retrieve data from your official official sources and then you see the little box that is circling blue it's going to calculate in this case what we did we gave the model a tool

9:14

for those areas where the model was coming up short right the 60 percent where it was not scoring well then we said you know what this is a task that the model doesn't need to do on its own we can just give it a tool because math you know is deterministic it's going to be the same all the time and then we can improve the the accuracy of the model but at the same time if you notice all the dimensions that we have we are evaluating the application against a multitude of dimensions not just one we're not going to say well because everything in the average is giving me above 90 percent then it's going to pass that might not

9:53

be the case you might have different degrees or thresholds for the different categories that you have here in terms of the accuracy regulatory compliance and whatnot and then at the end is where you define your gate you see not anything that doesn't clear the gate based on your thresholds doesn't get promoted into production this is just a snippet of the code and and at the end a link to the repo and to the blog post that you can read more in depth about the work that we did here but it's effectively you want to build your own benchmark instead of relying on the public ones that are available there and the the first

10:31

thing you need to do that is to build the data set like i said before this is an example of what a typical dataset will look like is there are key pairs you have inputs expected outputs and some metadata that you are then using to evaluate how the agent is performing both in terms of quality behavior and the the responses that is giving you as well this is how it looks after we have uh scored or evaluated one agent run and you notice that i circled the calculate tool call because in this case now this is how we were able to get the model from 60 percent in numerical accuracy all the way down to like 95

11:17

percent because we gave it a tool anytime there's a number that needs to be calculated just use this little python code and off you go and in that way you can improve the the results that you're giving back to your to your customers the other step on on this is about scoring how do you score each of the dimensions that i was telling you before we have a couple of ways that you can do this you can have deterministic scores that again like the name implies is you know very very simple this is this is not lm based you just have a code that is running and is for the same inputs it's going to generate the same outputs

11:56

all the time and what we've noticed is with these solutions as they get more complicated you need a blend of scores and evaluators that are deterministic and non-deterministic because otherwise relying 100 just in llm judges is not going to cut it um and then the the second one the path is you also want to figure out if the agent is taking the right you know route or path to get to the answer because it might be that the answer might look okay or complete uh or semi-complete but then maybe the route it took to get there it might not be the appropriate one might be missing steps so you

12:37

also can evaluate that and the third one is about how you use an llm as a judge to judge some of the more qualitative aspects of that answer and by doing all of this then we got to taking this little model that was failing with 60 percent we got it to over 90 percent and then we are clearing the 85 percent gate that the bank had for this particular use case by adding that tool but also by adding this evaluation framework on top that then we can measure the accuracy in the quality of the agent across many different dimensions and this is something very important because now you can go back and show the

13:20

evidence of how you actually measure the quality of the agent but also more importantly you can link it to the changes that were made into the agent into the configuration system prompt model tools that were used and then you say oh but look at how by adding this tool changing this model we went from 60 percent accuracy over to 95 90 plus percent accuracy and now this is where you start defining your gates right and this is where working with your domain experts becomes very very critical you don't want to just rely on technical kind of ability for this you want to make sure that if you're delivering uh on a risk use case that is going to be

14:07

an AI enabled that you have the risk people involved to tell you what is the bar that it needs to meet for them to feel comfortable putting this either internally or in front of customers and that bar might be different depending on the use case so that is why you need to have first the dimensions or the scores on which you're going to evaluate this application and then for each of those and for each use case or application you end up with different thresholds that the agent needs to meet in order for it to have quote unquote that stamp of approval uh for it to go into production and this is what it looks like when you we have like a full

14:49

end-to-end run across you know we had one data set that was like 150 questions another one was like 1500 so but now you can measure the configuration of the agent across this different dimensions and vertices and you see how even though it is passing on groundness completeness to use you might say well if i take the average of all of this then it should be okay but in regulatory compliance is getting a zero so that is one that is just binary it's just either zero or a hundred you don't want to put in anything if you're a bank out there that is going to violate any regulatory compliance requirement that you have because you might get penalties

15:34

you might incur into reputational damage and all of that so it might be that one dimension actually completely shuts down the gate for you to move this into production so that's why it's critical to have a multi-prong view on how you evaluate your agents and this is where when you start to kind of picking up all these failures or what we call them failure modes this is where bringing back the domain experts is really critical you can curate for them what we would call an annotation queue so then say anytime that there is a failure on regulatory compliance i want to curate those specific traces or evidence right from

16:16

my evaluation and put it in a place that my domain expert can come in and look at the trace look at what happened and then give me feedback and with that feedback i can then go back and you know feedback into the agent to improve it and this is what it would look like connecting it to the process before but including that human expert into the middle if you notice down below that anytime a couple of things are happening here anytime a prompt gets promoted or a change in the configuration then it triggers a rerun of the gate clearance process or the evaluation process but then anytime a rewriter or a human expert

16:59

comes in and gives me feedback that is a potential candidate to go back into my golden data set because now we have evidence from runs of the agent it have been reviewed and now we can say oh actually this one piece is a better you know bar to evaluate this particular dimension on the agent and this is kind of the whole process end to end to make sure that we are including the the main experts but also making sure that we're clearing our our quality gates then this got us to a place where we were able to help them go from weeks to minutes when it comes to you know

17:38

evaluating your applications especially in like risk and compliance which typically take even months sometimes so but this process it becomes very iterative we can be very specific and focus on the areas that we want on the agent then there's no template for this um you know this industry is being uh being developed right now so typically you need to define what is it that you want to evaluate and and kind of the metrics that matter to you and the three things that i'd like to give you with is you need to write your own benchmark because like i said the public ones don't really matter for your data because they were not done on your data per se

18:18

the second one you got you have to gate the application not the model that gives you more flexibility if tomorrow you want to swap a model you have already all the controls in the application and in the configuration of the agent and then it becomes easier for you to adjust and then the third let me make sure the domain experts come come in and set the bar or the thresholds are you are deemed uh reasonable in order for you to promote this into production and finally you know use your data is your bar is your gates especially in regulated industries where you want to keep things in your premises and you're probably not

18:56

relying on publicly available information so thank you for the time i know i'm a little bit over but i wanted to give you with uh the detailed blog post of this work that we did it also links to the repo that you can reproduce this yourself and uh i'm around if you have any questions so thank you

Reading tools

Type to find a passage

Appearance
Ask this transcript

Add a note