Section Insights
Introduction to Online Evaluation
What is online evaluation in production monitoring?
Online evaluation involves using a language model to automatically assign feedback to data points in production, particularly focusing on tagging runs with negative feedback.
- Online evaluation automates feedback assignment.
- It helps identify issues in data points based on user feedback.
- The feature is designed to enhance production monitoring.
Setting Up Filters for Negative Feedback
How do you set up a filter for negative feedback?
A filter is set to identify data points with a user score of zero, and an automation is added to tag these points with a 'vagueness' label.
- Filters help isolate specific data points for evaluation.
- Automation can streamline the tagging process.
- Setting a sampling rate allows for manageable data handling.
Configuring the Prompt for Online Evaluation
What is the significance of the prompt in online evaluation?
The prompt is crucial as it defines how the data is processed by the language model, using specific input and output variables to guide the evaluation.
- The prompt template must include relevant input and output variables.
- Proper configuration of the prompt is essential for accurate evaluations.
- Nested data structures can be handled within the prompt.
Defining the Schema for Feedback
How do you define the schema for tagging feedback?
The schema includes metadata keys that categorize feedback, such as 'vagueness', and allows customization of feedback types and requirements.
- Schemas provide structure to the feedback process.
- Customizable keys and types enhance the evaluation's relevance.
- Feedback can be marked as required or optional.
Implementing the Online Evaluator
How is the online evaluator implemented and utilized?
The online evaluator is set up to run over sampled data points, tagging them based on the defined rules, which helps in classifying and gaining insights from the data.
- The online evaluator automates the tagging of data points.
- It can provide insights into various inputs and outputs.
- Multiple evaluators can be set up for different tagging strategies.
Transcript
0:01 the last feature that I want to cover as part of this production monitoring and automation series is online evaluation and this is a really cool and much requested feature that we've heard and so I'm really excited to dive into this the basic idea of online evaluation is applying prompt plus an llm to assign feedback automatically to data points in production and so I'm going to show how to do that this is the documentation here and I'll have a link for this in
0:29 the description below but to start I'm going to jump back over to this familiar project that is chat Lang chain and so these are all the runs we have coming in and so one of the automations that we've set up is we want to tag all runs that have negative feedback with a vagueness tag and so basically the reason for that is we want to look at all runs with negative feedback and basically determine whether it's gotten negative
0:52 feedback because the question was vague or because the response was wrong and so we could look at all we could look at all data points by hand but instead we're going to have an llm do that and assign this tag and that's going to give us a good indication so the first part of that is setting up a filter and so this is covered in in the filtering video as well as the automation bit but basically
1:14 I'm going to set up a filter for where feedback user score is zero so I set up this filter now I'm going to add this automation I'm going to add something like vagueness as the name the sampling rate I'm going to set to one so I want to run this over all data points and that's because chat langing chain has a manageable amount of data points with negative feedback and then I'm going to select this online evaluation
1:44 component so when I select this I get this little button here called create evaluator and so I then open up this tab here and I can see a few things first I can see the secrets and API Keys associated with this online evaluator so remember this is using a language model and so we need to specify API keys for this language model so if I click in here I can see that I can specify my open AI key right
2:10 here I can then choose the model so here it's using GPD 3.5 turbo I can change it to any of the provided ones if I want I can also change the temperature should I choose the main interesting part comes in when you specify the prompt so when I go here I can click set in line prompt and I can get this template that pops up and there's a few things to note here first is the template so the template
2:38 has two input variables and it doesn't need to use these but it should use only these two because basically what's happening is is we're going to fetch the data from the run and we're going to pass it into this prompt template format that into a message and then we're going to pass that to the language model so here I can see that input and output are the two prompt variables and those are exactly what I should be using and and
3:04 these represent the inputs and outputs respectively of the Run and so if the input and outputs are nested if they're a dictionary with multiple keys or something that'll be rendered as a dictionary as well so keep that in mind when you're designing this prompt so here if I want I can go in and I can change the prompt and then the other really important thing that I can do is I can actually attach the a schema to
3:28 this and so this is important to understand the schema has a series of arguments each argument will end up being a metadata key that we attach to the run when it's finished so here I want to specify vagueness so I'm going to change the name of this from correctness to vagueness and this name this name of of of this key this is what will show up on my run as feedback then I'm also going to change
3:58 the description so like is the user input vague or not I can mark this as required or not so if I want to like optionally kind of like let the llm leave feedback I can I can unclick this and then I can choose the type so bullan string numbers nulls integers objects arrays I can I can choose all of that and this will be the the the type of the value that's left as feedback I can also add other things
4:27 so if I want to do vagueness and correctness in the same thing I definitely could and and these can be different types as well and then when that's all finished I can hit save and it will save this rule or it'll save this online evaluator as a rule that gets run over this part of over these sampled data points I can see that I've set this up here and and so I've already done this
4:58 and I can see that I get the V tags coming in and so if I filter a particular subset of runs so here I can see so this is a run if I look at feedback I can see that it had a user score of zero and I can see that it also had this vess component of one and this is actually left by the online evaluator I've also set up another evaluator that randomly samples data points and
5:25 tags them according to different categories so this was labeled as conceptual so hopefully this shows a few interesting ways that you can use these online evaluators to automatically tag look at classify provide more insights into the various inputs and outputs that I have coming into my system
Summary
- Online evaluation leverages a language model to automatically assign feedback to data points in production.
- Users can set up filters to identify runs with negative feedback, such as a user score of zero.
- The automation process involves creating an evaluator that tags runs based on specified criteria, like vagueness.
- Users can customize prompts for the language model to assess inputs and outputs of runs.
- A schema can be attached to the evaluator, defining metadata keys for feedback, such as vagueness or correctness.
- The evaluator can sample data points and categorize them, providing insights into performance issues.
- The setup process includes specifying API keys, selecting models, and adjusting parameters like temperature.
- This feature enhances the ability to classify and analyze data points without manual review.
Questions Answered
What is online evaluation in production monitoring?
Online evaluation involves using a language model to automatically assign feedback to data points in production, particularly focusing on tagging runs with negative feedback.
How do you set up a filter for negative feedback?
A filter is set to identify data points with a user score of zero, and an automation is added to tag these points with a 'vagueness' label.
What is the significance of the prompt in online evaluation?
The prompt is crucial as it defines how the data is processed by the language model, using specific input and output variables to guide the evaluation.
How do you define the schema for tagging feedback?
The schema includes metadata keys that categorize feedback, such as 'vagueness', and allows customization of feedback types and requirements.
How is the online evaluator implemented and utilized?
The online evaluator is set up to run over sampled data points, tagging them based on the defined rules, which helps in classifying and gaining insights from the data.