What you will be able to do
- Explain what the expectations field holds and which reserved keys built-in judges read from it
- Classify each built-in single-turn judge as requiring ground truth or reference-free
- Tell apart look-alike judge pairs such as Correctness and RetrievalGroundedness, RetrievalSufficiency and RetrievalRelevance, ToolCallCorrectness and ToolCallEfficiency
- Explain why ExpectationsGuidelines takes expectations but is not listed as requiring ground truth, and where it can run
- Classify the multi-turn judges by their ground-truth requirement
- Decide whether a custom make_judge() judge needs ground truth from its template
Key concept
expectations (ground truth) — An optional dictionary on each evaluation record that holds the known-correct answer, facts, tool calls or per-row rules for that input. A judge requires ground truth when it compares the agent's output against something in this dictionary. Judges that compare against the request, the retrieved context or a general rule do not.
1.Ground truth lives in the expectations field
Every judge in MLflow answers a question by comparing the agent's output to something. For most judges, that something is already in the record: the user's request, the retrieved context or a fixed rule. A smaller group compares the output to a known-correct answer that someone wrote in advance. These are the judges that require ground truth. On a dataset that has only questions, they have nothing to score against.
Ground truth is stored in one place: the expectations column of an evaluation record. Only inputs is required. expectations is optional, so a dataset can be labeled or unlabeled. The same holds in the two other data shapes. You can skip running the agent and pass pre-computed inputs and outputs, or you can pass existing traces. In both cases expectations is an optional extra column of ground truth for scorers.
The dictionary is free-form, but a few keys are reserved because built-in judges look for them by name. Putting the right facts under the wrong key fails quietly. A person sees a labeled record, but the judge finds nothing it reads.
| Key | Used by | What it holds |
|---|---|---|
| expected_facts | Correctness judge | List of facts that should appear |
| expected_response | Correctness judge | Exact or similar expected output |
| guidelines | ExpectationsGuidelines judge | Natural language rules to follow |
| expected_retrieved_context | document_recall scorer | Documents that should be retrieved |
The guidelines key is read by ExpectationsGuidelines, the judge that applies per-row rules labeled by domain experts. The plain Guidelines judge reads no key from expectations: it takes only inputs and outputs and applies one global rule set to every row.
Checkpoint 1 of 8· Check yourself
A team labels each evaluation record with expectations = {"answer": "the known-correct reply"} and then runs the Correctness judge. What is wrong with this setup?
Built-in judges find ground truth by reserved key names. Correctness reads expected_response and expected_facts, so an answer stored under a custom key fails quietly: a person sees a labeled record, but the judge finds nothing it can read.
“expected_response | Correctness judge | Exact or similar expected output”Source: docs.databricks.com
2.Single-turn judges that need ground truth, and their look-alikes
Three built-in single-turn judges require ground truth: Correctness, RetrievalSufficiency and ToolCallCorrectness. Each one has a reference-free neighbour with a similar name that checks something nearby. To tell them apart, ask what the output is being compared against.
| Judge | Arguments | Requires ground truth | Compares against |
|---|---|---|---|
| Correctness | inputs, outputs, expectations | Yes | The labeled expected answer or facts |
| RetrievalGroundedness | inputs, outputs | No | The retrieved context (is the agent hallucinating?) |
| RelevanceToQuery | inputs, outputs | No | The user's request |
| Safety | inputs, outputs | No | Nothing: checks for harmful, offensive, or toxic material |
| RetrievalSufficiency | inputs, outputs, expectations | Yes | The ground truth facts the context must support |
| RetrievalRelevance | inputs, outputs | No | The user's request (is the context on topic?) |
| ToolCallCorrectness | inputs, outputs, expectations | Yes | The expected tool calls and arguments |
| ToolCallEfficiency | inputs, outputs | No | Nothing: checks for redundant tool calls |
| Guidelines | inputs, outputs | No | Natural language criteria applied to every row |
Correctness versus RetrievalGroundedness. Both catch wrong answers, but they come at them from different directions. Correctness asks whether the response matches the answer experts wrote, which it reads from expected_response or expected_facts. RetrievalGroundedness asks whether the response is supported by the documents the agent retrieved. An agent can stay fully grounded in an outdated policy document and still give an incorrect answer. Only Correctness catches that, because only Correctness has a label to compare with. So when a team has a known correct answer for each transcript and wants to score agreement with it, Correctness is the judge. RelevanceToQuery and Safety are further off. One checks that the response addresses the question, the other checks for harmful content, and neither looks at a reference answer.
RetrievalSufficiency versus RetrievalRelevance. Both grade the retriever, not the response. RetrievalRelevance asks whether the retrieved chunks are on topic for the request, and the request alone is enough to answer that. RetrievalSufficiency asks a harder question: did the context contain everything needed to write a response that includes the ground truth facts? A retriever can return five relevant chunks about refund policy and still miss the one clause that states the 30-day limit. You can only spot that gap if you know the expected facts, so RetrievalSufficiency takes expectations.
ToolCallCorrectness versus ToolCallEfficiency. Suppose the dataset records, for each test case, which tools the agent should have called and with which arguments. ToolCallCorrectness compares the agent's actual calls against that record. ToolCallEfficiency never sees such a record. It only judges whether the calls the agent made were redundant. An agent that calls the search API once with the wrong query is efficient but incorrect.
Checkpoint 2 of 8· Match them up
Each judge below compares the agent's output against a different reference. Match each judge to that reference.
Tap a term, then the definition that fits it.
Correctness and RetrievalSufficiency need ground truth because they compare against labeled answers or facts in expectations. RetrievalGroundedness, RetrievalRelevance and ToolCallEfficiency compare against the retrieved context, the request, or nothing, so inputs and outputs are enough.
“RetrievalSufficiency | inputs, outputs, expectations | Yes | Does the context provide all necessary information to generate a response that includes the ground truth facts?”Source: docs.databricks.com
Checkpoint 3 of 8· Exam question
A support-quality team has a labeled dataset of chat transcripts, each paired with a known correct answer written by subject-matter experts. They want an MLflow built-in judge that scores whether the agent's response matches this known correct answer for each transaction. Which judge should they use, and why does it require ground truth?
Correct answer: A — Correctness, because it judges each response against the expected_facts or expected_response supplied with the dataset record
- A. Correctness is the built-in judge that needs ground truth. It compares the agent's response with the expected_facts or expected_response stored in the evaluation dataset. That comparison is how it scores whether an answer matches what the subject-matter experts wrote, which is the check the team wants.
- B. Safety assesses a response's own content for harmful, offensive or toxic material. It does not compare the response with an expert-written answer, so the labeled correct answers play no part in its score. It cannot show whether a response matches the known correct answer.
- C. RelevanceToQuery judges how directly a response addresses the user's request. It needs no expected answer and does not read one. A response can be fully on topic and still differ from the experts' correct answer, so this judge cannot measure that match.
- D. RetrievalGroundedness checks whether the response is supported by the context the agent retrieved. It does not use an expert-written answer. A response can be faithful to the retrieved documents and still differ from the known correct answer, so it does not measure the required match.
Checkpoint 4 of 8· Exam question
A RAG engineering team has a benchmark set where each question has expert-written expected_facts. They want to confirm the retriever pulled documents that actually contain enough information to support producing those expected facts, not merely documents that are topically relevant. Which built-in judge fits this need and requires ground truth?
Correct answer: A — Run RetrievalSufficiency, which judges whether the retrieved context holds the content needed to back each reference fact for the question
- A. RetrievalSufficiency is the built-in judge that uses ground truth. It compares the retrieved context with the expected facts recorded for the test case and checks that the context contains enough information to produce them. That is the completeness check the team wants, as opposed to a topical-relevance check.
- B. RetrievalRelevance judges whether retrieved chunks relate to the user's question. It does not use expected facts, so a chunk on the right topic can pass even when the facts the team recorded are missing from the context. It cannot confirm sufficiency, and it does not require ground truth.
- C. RetrievalGroundedness evaluates the generated answer, checking whether its claims are supported by the retrieved context. It does not test whether the retrieved documents hold the information behind the expected facts, and it does not use ground truth. A faithful answer built on incomplete context would still pass.
- D. Guidelines applies general natural-language criteria to the output and takes no per-question expected facts. Criteria such as covering the right topics cannot verify that the retrieved context supports the specific facts recorded for each benchmark question. It also does not require ground truth.
Checkpoint 5 of 8· Exam question
An agent invokes external tools such as a calculator and a search API. The evaluation team has a dataset specifying, for each test case, the exact tool names and arguments the agent should have called. They want a judge that flags cases where the agent's actual tool invocations differ from this expected sequence. Which judge requires this kind of ground truth?
Correct answer: A — ToolCallCorrectness, which scores the tool names and arguments the agent used against the reference calls stored with each test case
- A. ToolCallCorrectness is the judge that needs ground truth. It takes the expected tool names and arguments stored with each test case and compares them to what the agent actually called, which is the check the team wants.
- B. ToolCallEfficiency looks at how many tool calls the run used and whether any were redundant or repeated. It judges this from the trace itself, so it needs no expected call list and cannot flag differences from one.
- C. Safety screens tool arguments and answers for harmful content. It is a reference-free judge, so it does not compare tool names or arguments to an expected sequence, and it cannot flag deviations from the dataset.
- D. RelevanceToQuery checks whether the agent's behaviour fits what the user asked. It rates this from the request and the run alone, with no expected tool-call sequence, so it cannot flag a mismatch against recorded ground truth.
3.The ExpectationsGuidelines edge case
ExpectationsGuidelines is the only built-in judge that reads expectations without counting as a ground-truth judge. It reads the reserved guidelines key: natural-language rules a domain expert attached to one specific row. It never compares the response to a known-correct answer. It checks whether the response follows that row's rules. So it needs the guidelines key filled in, but it does not need a labeled answer.
data = [
{
"inputs": {"question": "What is the capital of France?"},
"outputs": "The capital of France is Paris.",
"expectations": {
"guidelines": ["The response must be factual and concise"]
}
},
{
"inputs": {"question": "How to learn Python?"},
"outputs": "You can read a book or take a course.",
"expectations": {
"guidelines": ["The response must be helpful and encouraging"]
}
}
]Its sibling, the plain Guidelines judge, takes only inputs, outputs and applies one global set of rules to every row. That difference decides where each judge can run. Guidelines works in both offline evaluation and production monitoring, because a global rule fits any live request. ExpectationsGuidelines is for offline evaluation only, since its rules come from expert-labeled rows in an evaluation dataset. Use ExpectationsGuidelines when different examples truly need different criteria. Use Guidelines when one rule set covers everything and you want to keep scoring after deployment.
Checkpoint 6 of 8· Check yourself
After deployment, a support team wants an LLM judge to keep scoring live requests against one rule: "Never quote prices; refer pricing questions to sales." No one labels production traffic. Which judge should they choose?
Guidelines applies a global rule set from inputs and outputs alone, so it runs in both offline evaluation and production monitoring. ExpectationsGuidelines needs expert-labeled per-row guidelines in an evaluation dataset, so it is for offline evaluation only, and live traffic has no such rows.
“Built-in Guidelines() judge: Apply global guidelines uniformly to all rows. Evaluates app inputs and outputs only. Works in both offline evaluation and production monitoring.”Source: docs.databricks.com
Sources3
4.Multi-turn judges are all reference-free
Multi-turn judges score a whole conversation instead of one response. What they look for is covered in Issues that only appear across a conversation. The ground-truth classification is short: all seven built-in multi-turn judges take a session, and none of them requires ground truth. They are recommended both for evaluation during development and for monitoring in production.
| Judge | Arguments | Requires ground truth |
|---|---|---|
| ConversationCompleteness | session | No |
| UserFrustration | session | No |
| KnowledgeRetention | session | No |
| ConversationalGuidelines | session, guidelines | No |
| ConversationalRoleAdherence | session | No |
| ConversationalSafety | session | No |
| ConversationalToolCallEfficiency | session | No |
Three names invite the wrong answer. KnowledgeRetention sounds as if it needs a record of what the agent should remember. In fact its reference is the earlier turns of the same conversation, which the session already contains. ConversationalGuidelines takes guidelines as its own argument, not from expectations, so it works like the global Guidelines judge rather than like ExpectationsGuidelines. ConversationalToolCallEfficiency is like its single-turn namesake: it judges whether tool use was efficient and appropriate, without a list of expected calls.
Checkpoint 7 of 8· Check yourself
Your chatbot has thousands of production chat sessions, and none of them are labeled. You want to catch cases where the assistant forgets details the user gave earlier in the same chat. What do you need?
KnowledgeRetention takes only a session and doesn't require ground truth. Its reference is the earlier turns of the same conversation, which the session already contains. That lets it run on unlabeled production traffic, and the other options all depend on labels this team doesn't have.
“KnowledgeRetention | session | No | Does the agent correctly retain information from earlier in the conversation?”Source: docs.databricks.com
Sources4
5.Custom make_judge() judges: you decide
For a custom judge, the ground-truth requirement is not fixed. You choose it when you write the prompt. make_judge() takes natural-language instructions that must reference at least one of four template variables: {{ inputs }}, {{ outputs }}, {{ expectations }} and {{ trace }}. No other variables are allowed, and a made-up one such as {{ question }} raises a validation error. A custom judge requires ground truth exactly when its instructions reference {{ expectations }}.
from mlflow.genai.judges import make_judge
from typing import Literal
# Field-based judge: compare the response to the expected answer
correctness_judge = make_judge(
name="answer_correctness",
instructions=(
"Given the request in {{ inputs }}, decide whether the response in "
"{{ outputs }} matches the expected answer in {{ expectations }}.\n\n"
"Return 'correct' only if the response conveys the same facts as the "
"expected answer. Otherwise, return 'incorrect'."
),
feedback_value_type=Literal["correct", "incorrect"],
)Remove {{ expectations }} from that template and the same judge becomes reference-free. That is the right design when you want to score tone or format from inputs and outputs alone. A trace-based judge that reads only {{ trace }} also needs no labels. For example, a judge that checks whether the agent chose suitable tools reasons over what the agent actually did, not over an expected answer.
This choice matters because labels are expensive. Curating human labels takes time. The recommended path is to start with an evaluation set that contains only questions, run reference-free judges on it from day one, and add ground-truth responses over time. As labels arrive, ground-truth judges can run on the labeled rows. These are the built-in Correctness judge or a custom judge that references {{ expectations }}. They add metrics such as answer correctness that an unlabeled set could not produce.
Checkpoint 8 of 8· Fill the gap
This make_judge() call must score each response against an expert-labeled reference answer, so it should require ground truth. Which template variable fills the blank?
from mlflow.genai.judges import make_judge
from typing import Literal
# Field-based judge: compare the response to the expected answer
correctness_judge = make_judge(
name="answer_correctness",
instructions=(
"Given the request in {{ inputs }}, decide whether the response in "
"{{ outputs }} matches the expected answer in {{ ? }}.\n\n"
"Return 'correct' only if the response conveys the same facts as the "
"expected answer. Otherwise, return 'incorrect'."
),
feedback_value_type=Literal["correct", "incorrect"],
)A custom judge requires ground truth exactly when its instructions reference {{ expectations }}. {{ trace }} is allowed, but it shows what the agent did, not the correct answer. {{ question }} and {{ expected_response }} are not among the four allowed variables, so they raise a validation error. expected_response is a key inside expectations, not a template variable.
Source: docs.databricks.comSources
(6)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“expectations has several reserved keys that are used by built-in LLM judges: guidelines, expected_facts, and expected_response.”
↩︎ Ground truth lives in the expectations field“Exact or similar expected output”
↩︎ Single-turn judges that need ground truth, and their look-alikes“Ground truth labels, stored as a JSON-seralizable dict.”
↩︎ Key concept“expected_response | Correctness judge | Exact or similar expected output”
↩︎ Checkpoint - 2.
“Optional ground truth for scorers”
↩︎ Ground truth lives in the expectations field - 3.https://docs.databricks.com/aws/en/mlflow3/genai/eval-monitor/concepts/judges/guidelinesOfficial docs
“The ExpectationsGuidelines judge evaluates against row-specific guidelines from domain experts.”
↩︎ Ground truth lives in the expectations field“Apply global guidelines uniformly to all rows. Evaluates app inputs and outputs only. Works in both offline evaluation and production monitoring.”
↩︎ The ExpectationsGuidelines edge case“The ExpectationsGuidelines judge evaluates against row-specific guidelines from domain experts.”
↩︎ The ExpectationsGuidelines edge case“Apply per-row guidelines labeled by domain experts in an evaluation dataset. Evaluates app inputs and outputs only. For offline evaluation only.”
↩︎ Exam trap 3“Built-in Guidelines() judge: Apply global guidelines uniformly to all rows. Evaluates app inputs and outputs only. Works in both offline evaluation and production monitoring.”
↩︎ Checkpoint - 4.
“Is the response correct as compared to the provided ground truth?”
↩︎ Single-turn judges that need ground truth, and their look-alikes“Does the context provide all necessary information to generate a response that includes the ground truth facts?”
↩︎ Single-turn judges that need ground truth, and their look-alikes“Are the tool calls and arguments correct for the user query?”
↩︎ Single-turn judges that need ground truth, and their look-alikes“Use multi-turn judges both for evaluation during development and for monitoring in production.”
↩︎ Multi-turn judges are all reference-free“ConversationalGuidelines | session, guidelines | No”
↩︎ Multi-turn judges are all reference-free“Is the response grounded in the information provided in the context? Is the agent hallucinating?”
↩︎ Exam trap 1“Are the tool calls efficient without redundancy?”
↩︎ Exam trap 2“Does the agent correctly retain information from earlier in the conversation?”
↩︎ Exam trap 4“RetrievalSufficiency | inputs, outputs, expectations | Yes | Does the context provide all necessary information to generate a response that includes the ground truth facts?”
↩︎ Checkpoint“No (but needs guidelines in expectations)”
↩︎ Prediction“KnowledgeRetention | session | No | Does the agent correctly retain information from earlier in the conversation?”
↩︎ Checkpoint - 5.
“Your instructions must include at least one template variable, but you don't need to use all of them.”
↩︎ Custom make_judge() judges: you decide“Custom variables like {{ question }} will throw validation errors”
↩︎ Custom make_judge() judges: you decide“Omit {{ expectations }} when you don't have ground truth”
↩︎ Exam trap 5 - 6.https://docs.databricks.com/aws/en/agents/tutorials/ai-cookbook/evaluate-define-qualityOfficial docs
“You can get started by creating an evaluation set that only includes questions, and add the ground truth responses over time.”
↩︎ Custom make_judge() judges: you decide“if ground truth is available, it computes additional metrics such as answer correctness.”
↩︎ Custom make_judge() judges: you decide