Building Reliable LLM Judges and Useful Synthetic Data
This lesson explains how to build reliable LLM-as-a-judge evaluators and useful synthetic test data, the techniques that large-scale evaluation of open-ended agent behaviour relies on, and their pitfalls.
Learning outcomes
After completing this lesson, you will be able to:
- Build an LLM-as-a-judge evaluator with a rubric.
- Mitigate judge biases such as position and verbosity bias.
- Generate synthetic data that fills gaps in real data.
Building an LLM-as-a-judge evaluator
An LLM-as-a-judge evaluator prompts a capable model with the input, the output, any reference or context, and a rubric, and asks for a score with a short reason in a structured format. Foundry's AI-assisted evaluators (groundedness, task adherence and others) are judges of this kind, and custom judges can be built for domain criteria such as "recommends only products in stock". Good judges use specific, observable criteria, a small scale (pass or fail, or 1-5 with anchors), examples of each score and a low temperature or low reasoning variability.
Designing a reliable judge
Judge biases and mitigations
Judges have known biases, which the following table lists with mitigations.
| Bias | Effect | Mitigation |
|---|---|---|
| Position bias | Prefers the first (or second) answer in comparisons | Randomize or swap order and average |
| Verbosity bias | Prefers longer answers | Rubric rewards correctness and concision explicitly |
| Self-preference | Prefers outputs from its own model family | Use a different model family as judge |
| Leniency | Approves vague or partially wrong answers | Specific criteria, reference answers, calibration |
Every judge is calibrated against human ratings before use, as described in the human review topic, and recalibrated when the judge model changes.
Biases and fixes
Synthetic data generation
Synthetic data is test data generated by models or programs. It fills gaps in real data: rare intents, edge cases, other languages, long conversations and adversarial inputs. Foundry provides a simulator in the Azure AI Evaluation SDK that generates queries and multi-turn conversations from source text or tasks, and an adversarial simulator for safety testing; the AI Red Teaming Agent generates attacks.
Synthetic data has limits. It reflects the generating model's assumptions, can be too clean or too uniform and can leak the expected answer into the question. Good practice is to seed generation with real examples and personas, review samples by hand, deduplicate, label the data as synthetic, and always keep a set of real production samples in the evaluation dataset.
Synthetic test data
An over-generous judge
A custom judge scores 94% of a support agent's answers as correct, but human reviewers rate only 78% as correct. Reviewers note that many approved answers are long and confident but cite the wrong policy version.
The judge shows leniency and verbosity bias. The rubric should require that the cited policy version matches the provided context, give examples of failing answers, and use pass or fail rather than a vague scale; the judge is then recalibrated against the human ratings. Using the judge's 94% as a release gate before that would hide real failures.
Name two biases of LLM judges.
Show answer
For example position bias, verbosity bias and self-preference, which are reduced with specific rubrics and anchored scales.
Exam Tips
Remember for the exam
- Judges need specific rubrics, anchored scales and calibration against humans.
- Mitigate position, verbosity and self-preference bias.
- Synthetic data fills coverage gaps; keep real samples and review generated data.