Glossary · L

LLM-as-a-Judge

Evaluation method in which a language model scores or compares the outputs of an LLM application against defined criteria.

By Obseria TeamUpdated

Definition

LLM-as-a-Judge is an evaluation method in which a language model assesses the outputs of another LLM or AI application against defined criteria, such as correctness, faithfulness to sources, relevance or tone. The judge returns a score, a pairwise preference or a label with a justification, which makes quality evaluation scalable beyond what human reviewers can cover.

What is LLM-as-a-Judge?

LLM-as-a-Judge describes the use of a large language model as an automated evaluator. Classic metrics such as exact match or BLEU work poorly for open-ended answers: a summary can be correct in many different wordings. Human review is accurate but slow and expensive. A judge model sits in between: it reads the input, the generated answer and optionally a reference or retrieved context, and rates the answer according to a rubric.

The term became widely known through the 2023 paper "Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena" by Zheng et al., which compared judgments of strong models with human preferences and also documented systematic biases. Today the method is a standard building block of LLM evaluation, both in offline test suites and in continuous monitoring of production traffic.

Evaluation modes

  • Single-answer grading: the judge assigns a score, for example 1 to 5, or a binary pass/fail for one answer.
  • Pairwise comparison: the judge decides which of two answers is better, useful when comparing prompt versions or models.
  • Reference-based grading: the judge compares the answer with a known correct answer.
  • Reference-free grading: the judge checks properties that need no gold answer, for example whether a RAG answer is supported by the retrieved documents.

Typical criteria are correctness, faithfulness or groundedness (detecting hallucinations), relevance to the question, completeness, safety and compliance with style or format requirements.

Example of a judge prompt

A good judge prompt is narrow and explicit. An illustrative faithfulness check:

You evaluate whether an answer is supported by the context.
Context: {retrieved_chunks}
Question: {question}
Answer: {answer}
Return JSON: {"verdict": "supported" | "partially" | "unsupported",
              "reason": "<one sentence citing the context>"}

Binary or few-category labels with a short justification are usually more stable than fine-grained scales such as 1 to 10, and structured output makes the results easy to aggregate.

Known biases and limitations

Research has documented several systematic weaknesses of judge models:

  • Position bias: in pairwise comparisons the judge prefers the first or second answer regardless of quality. Mitigation: evaluate both orders.
  • Verbosity bias: longer answers are rated higher even if they add nothing.
  • Self-preference: a model tends to favor outputs that resemble its own.
  • Limited expertise: for math, code or specialist domains the judge can be wrong with confidence. Tools such as test execution or retrieval help.
  • Manipulability: the evaluated answer can contain instructions aimed at the judge, a form of prompt injection.

Best practices

  1. Calibrate against humans: label a sample manually and measure how often the judge agrees before trusting it.
  2. One criterion per judge: separate checks for faithfulness, relevance and tone are easier to debug than one overall score.
  3. Pin the judge: version the judge model and prompt, because a change of either shifts all scores.
  4. Sample in production: judging every request is costly; evaluate a representative sample plus all requests with negative user feedback.
  5. Combine with deterministic checks: schema validation, regexes and guardrails are cheaper and exact where they apply.

LLM-as-a-Judge in production monitoring

In production, judge scores become a quality signal next to latency, errors and token cost. Attaching the score to the trace of the original request lets teams filter for unsupported answers, find the retrieval step that returned the wrong context and see whether a prompt or model change improved quality. Note that the judge calls themselves consume tokens and add cost, so they should be tracked as well.

Offline and online evaluation

Judges are used in two places. In offline evaluation, a fixed dataset of representative questions is run through the application before every release, and the judge scores the answers. A drop compared with the previous version blocks the release, much like a failing unit test. In online evaluation, the judge scores a sample of real production traffic, which reveals problems a test set cannot anticipate, such as new question types or changes in source documents. Both need the same discipline: stable judge versions, a documented rubric and regular spot checks by people who know the domain, so that the judge itself does not drift unnoticed.

How Obseria helps

With AI observability, Obseria records LLM and agent calls as OpenTelemetry traces with latency, errors and token usage. Evaluation results from your judge, sent as attributes or events, can be correlated with these traces, so quality drops can be analyzed together with the requests that caused them.

Frequently asked questions

It can agree well with human ratings for clearly defined criteria, but it has known biases. Calibrate the judge against human labels, use narrow rubrics and re-check agreement when you change the judge model or prompt.

Usually a capable model, ideally from a different family than the evaluated one to reduce self-preference. Smaller fine-tuned judge models can work for narrow tasks once their agreement with human labels has been verified.

Guardrails act in the request path and block or modify output in real time. LLM-as-a-Judge usually runs asynchronously or offline to measure quality and find regressions, although a judge can also serve as a guardrail.

Each judgment is an additional model call with input and output tokens. Costs depend on the judge model, prompt length and sampling rate, so most teams evaluate a sample of production traffic rather than every request.

Put these concepts into practice

Try Obseria free for 14 days, with OpenTelemetry and no proprietary agents.