Evaluating an LLM judge
An LLM judge is an LLM that grades the answers of your LLM application, such as a chatbot, a RAG assistant or an agent, against criteria you write in a prompt. It grades far more conversations than your experts can, but it can be wrong: too lenient, blind to a made-up fact, or fond of long answers. Before you rely on its grades, measure how often it agrees with your experts, and where it does not.
In an LLM static project, the judge's grades are an inference label, kept apart from your experts' labels. Your experts grade the same conversations. Kili then computes the judge agreement of each conversation, from 0% to 100%, and the Agreement tab of the Analytics page compares your judges.
Private betaThe judge agreement is currently in private beta. It is available to selected customers on request, and it may change before general availability. To request access, contact your Kili representative.
Before you start
- Project type: LLM static, with a multi-step or multi-group workflow.
- Access: private beta, on projects that use the new quality metrics computation: projects created after it was turned on for your organization.
- Roles: Project Admins and Team Managers read the Agreement tab.
Setting up the evaluation jobs
Ask your experts the questions your judge answers, as jobs of the project. A typical evaluation has:
| Job | Level | Example |
|---|---|---|
| A verdict on the conversation | conversation | Overall, is the assistant's answer good? Good, Needs work, Bad |
| The errors of each answer | completion | What is wrong in this answer? Made-up fact or rule, Breaks the policy, Incomplete |
| The reason for the verdict | conversation | Why?, a transcription job |
A free-text answer is rarely worded the same way twice. To keep the reason for the verdict out of the judge agreement, set isIgnoredForMetricsComputations on its job: refer to Customizing the interface through JSON settings.
Adding the judge's grades
The judge's grades become an inference label, named after the judge's model. Give each version of your judge its own name: Kili scores each one apart.
- From your tracing tool: import the agent traces with the scores of your judge. Kili adds them as the label of the model LLM judge. Refer to Importing agent traces.
- With the Python SDK: call
append_labels()withlabel_type="INFERENCE"and the judge's name asmodel_name. Refer to the LLM as a judge tutorial.
Your experts don't see the judge's label when they grade: the labeling interface opens with empty jobs, so the judge doesn't sway them.
Reading the judge agreement
Kili compares the judge's label with the label that finished the conversation, once its last workflow step is done: with a review step, the reviewer's label. A judge's label added to a conversation that is already finished is compared right away.
The judge agreement of a conversation is the average of its job scores:
- Classification: the share of categories the judge and the expert both chose. A single-choice job scores 100% or 0%.
- Answers per step (
completionandroundjobs): each answer is compared with the expert's answer on the same step. A step only one of them answered scores 0%. - Left out: a job neither of them answered, and a job excluded from metrics.
For the full rules, refer to How quality metrics are computed.
The judge agreement shows in three places:
- Queue page: the Judge agreement column, under the model icon. Sort on it to read the disagreements first.
- Explore: each conversation shows its judge agreement. Expand a conversation in the list to see its labels, the judge's under its model name, and click one to read it.
- Python SDK and API: the
inferenceMarkfield of each conversation, and of each inference label.
Comparing judges in the Agreement tab
Open the project's Analytics page, click Agreement, then Inference. The tab shows once a conversation has a score. Choose the period at the top: Last 7 days, Last 30 days, Last 90 days, Since project start, or Custom…. Days are UTC days.
- Models: each judge's agreement with your experts, best first. Click one to read it in detail below the charts.
- Models over time: each judge's agreement over the period.
- Agreement per class and model: each judge's agreement on each category, the best judge in bold.
- Models against each labeler: each judge's agreement with each expert. Click a cell to see the conversations.
When the project also uses consensus, review score or honeypot, the tab has a source for each, which scores your experts: refer to Agreement dashboard.
Limitations
- Projects created before the new quality metrics computation was turned on don't get the judge agreement.
Related pages
Updated about 4 hours ago