AiCredits
Eval at Scale

Evaluate LLM Output Quality Without Human Review at Scale

Build a layered eval pipeline that auto-grades LLM outputs: deterministic rules, calibrated rubric judges, pairwise regression tests, and drift monitors.

Published 2026-10-28 Updated 2026-10-28 7 min

Why "No Human Review" Is the Wrong Target

Human review doesn't scale past a few thousand outputs a day — but the goal isn't zero humans. It's moving humans from inspecting every output to calibrating the system that inspects outputs. You label a few hundred examples once, use them to prove your automated graders agree with your taste, then let machines grade the traffic while humans audit the graders.

This distinction matters because most automated eval setups don't fail on model quality. They fail on trust: a judge that silently drifted, a rubric nobody validated, a pass rate that looked healthy while the product got worse. The stack below is designed to fail loudly and cheaply.

The Eval Stack: Four Layers That Fail Differently

LayerCatchesModel callsCost profile
Deterministic rulesEmpty output, broken JSON, wrong length, missing citation, banned phrases, refusalsNoneFree — run on 100% of traffic
Pointwise rubric judgeHallucination, incompleteness, tone and instruction-following driftOne flash call per sampleCheap per output; sample rather than grade everything
Pairwise comparisonPrompt or model regressions between two candidatesTwo flash calls per pairUsed in CI, not on production traffic
Distribution monitorsSlow drift: length shifts, refusal spikes, parse-failure creepNone extraAggregates scores you already collected

Each layer catches a different failure mode, which is why stacking them beats buying a bigger judge. Rules are exact but shallow. Judges are flexible but biased. Monitors are free but lagging. Together they cover the space.

Layer 1 — Deterministic Rules on Every Single Output

Rules are boring and they catch most production incidents. Validate JSON against your schema, enforce required sections or citations, cap length, detect refusal openers ("I can't help with that", "As an AI"), regex for PII and for banned claims your legal team cares about, and check that the response is in the expected language.

Their real value is as an alarm. A jump in schema-parse failures from a fraction of a percent to a few percent usually means a prompt change shipped, a model got re-routed, or a context window started truncating. You notice in minutes instead of in a support queue three weeks later. Run these on 100% of traffic; nothing else is cheap enough for that.

Layer 2 — A Rubric Judge That Returns Structured Scores

One call per output, temperature 0, and axis scores instead of a single holistic 1–10. Separate axes resist halo effects: a fluent answer can still score badly on groundedness. Force JSON output so results aggregate into a table you can query, and keep the rubric under roughly 150 words — long rubrics get partially ignored as reliably as long prompts do.

The snippet below combines both layers into a single gate function you can call per output.

import json, os, re
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AICREDITS_API_KEY"],
    base_url="https://api.aicreditsapi.com/v1",
)

RUBRIC = (
    "You are a strict QA grader. Score the ANSWER 1-5 on each axis.\n"
    "grounded: every claim is supported by CONTEXT (5 = fully supported)\n"
    "task_fit: fully answers QUESTION, nothing missing (5 = complete)\n"
    "format: obeys the required output contract (5 = perfect)\n"
    'Reply with JSON only: {"grounded":int,"task_fit":int,"format":int,"reason":"<=25 words"}'
)

def parse_json(raw: str) -> dict:
    try:
        return json.loads(raw)
    except json.JSONDecodeError:
        match = re.search(r"\{.*\}", raw, re.S)
        if not match:
            raise
        return json.loads(match.group(0))

def judge(question: str, context: str, answer: str) -> dict:
    resp = client.chat.completions.create(
        model="deepseek-v4-flash",
        temperature=0,
        messages=[
            {"role": "system", "content": RUBRIC},
            {"role": "user", "content": f"QUESTION:\n{question}\n\nCONTEXT:\n{context}\n\nANSWER:\n{answer}"},
        ],
    )
    return parse_json(resp.choices[0].message.content)

def rule_failures(answer: str, max_chars: int = 4000, must_include=()) -> list:
    fails = []
    if not answer.strip():
        fails.append("empty")
    if len(answer) > max_chars:
        fails.append("too_long")
    for token in must_include:
        if token.lower() not in answer.lower():
            fails.append(f"missing:{token}")
    return fails

def gate(question, context, answer, must_include=(), threshold=4) -> dict:
    fails = rule_failures(answer, must_include=must_include)
    score = judge(question, context, answer)
    worst = min(score["grounded"], score["task_fit"], score["format"])
    return {"passed": not fails and worst >= threshold, "rule_fails": fails, "judge": score}

Calibrate the Judge Before You Trust It

A judge you haven't validated is a random number generator with good manners. Take 150–300 inputs that span every route, language, and output shape you ship, label them pass/fail with two people, freeze the set, and measure agreement between your labels and the judge's verdicts. Use Cohen's kappa rather than raw agreement, because a judge that says "pass" 95% of the time scores well on raw agreement while being useless.

If kappa lands low, the rubric is usually the culprit — too vague, too many axes, or asking for a holistic score instead of specific ones. Fix the rubric before you blame the model.

from collections import Counter

def cohen_kappa(human, judge):
    """human / judge: equal-length lists of categorical labels."""
    assert human and len(human) == len(judge)
    n = len(human)
    labels = set(human) | set(judge)
    observed = sum(h == j for h, j in zip(human, judge)) / n
    expected = sum((Counter(human)[l] / n) * (Counter(judge)[l] / n) for l in labels)
    return 1.0 if expected == 1 else (observed - expected) / (1 - expected)

# print(cohen_kappa(human_labels, judge_labels))
  • Verbosity bias: judges reward longer answers. Add "do not reward length or confidence" to the rubric, then check the correlation between token count and score on your gold set.

  • Position bias: in pairwise mode, swap A and B, run both, and treat a split verdict as a tie.

  • Self-preference: a model judging its own family has blind spots. Route the disputed slice through a stronger tier or a different family.

  • Rubric drift: version the rubric string in git. A "small" wording tweak invalidates every historical score you have.

  • Reward hacking: if you tune prompts against the judge, its scores inflate. Keep a frozen holdout set nobody looks at until release.

Pairwise Tests for Regressions, Not Absolute Grades

Absolute scores drift between rubric versions and are noisy on a per-item basis. Comparisons are far more stable: give the judge two answers to the same prompt and ask which is better. This is the right tool for prompt changes, model upgrades, and routing decisions — not for absolute quality reporting.

Run it over 50–100 frozen prompts per change, in both orders, and count wins. If the debiased win rate doesn't clear ties by a clear margin, you don't have an improvement — you have noise plus a new prompt to maintain.

def pairwise(question: str, a: str, b: str) -> str:
    resp = client.chat.completions.create(
        model="deepseek-v4-flash",
        temperature=0,
        messages=[
            {"role": "system", "content": 'Compare the two answers. Reply with JSON only: {"winner":"A"|"B"|"tie","why":"<=20 words"}. Judge correctness and completeness, not length or confidence.'},
            {"role": "user", "content": f"QUESTION:\n{question}\n\nANSWER A:\n{a}\n\nANSWER B:\n{b}"},
        ],
    )
    return parse_json(resp.choices[0].message.content)["winner"]

def debiased_winner(question: str, candidate: str, baseline: str) -> str:
    first = pairwise(question, candidate, baseline)        # candidate in slot A
    second = pairwise(question, baseline, candidate)       # candidate in slot B
    flipped = {"A": "B", "B": "A", "tie": "tie"}[second]
    return first if first == flipped else "tie"

Reference-Free Signals That Catch Silent Failures

  • Self-consistency: sample the same prompt a few times at temperature ~0.7 and measure whether the answers agree semantically. Low agreement flags unstable outputs with zero judge calls.

  • Embedding distance to retrieved context: for RAG, flag answers that sit far from every retrieved chunk. Cheap and hard to game.

  • Length distribution: a sudden shift in mean or p95 length almost always means a prompt or routing change shipped.

  • Refusal and hedge rate: track "I can't", "it depends", and apologetic openers as a percentage over time.

  • Schema-parse failure rate: your cheapest drift alarm and the one that fires first.

  • Latency and token percentiles: early warning for prompt bloat or a model being silently re-routed.

Sampling, Confidence, and What It Costs

You rarely need to judge everything. Stratify by route, language, and stakes: grade 1–2% of a high-volume endpoint and 100% of a low-volume, high-consequence one. Then report a confidence interval rather than a bare percentage. With 200 graded outputs, a 92% pass rate is compatible with anything from roughly 87% to 95% — so don't chase a two-point move in a dashboard without adequate sample size.

Cost is the other reason to split models. Bulk pointwise grading is high-volume, low-complexity work: deepseek-v4-flash at temperature 0 is the right default for it. Reserve deepseek-v4-pro for the contested slice — the outputs where the cheap judge and your gold labels disagree, or where kappa is borderline. Off-peak runs cost less than peak, cache hits on a repeated system prompt are cheaper than fresh input, and flash costs less than pro across the board. Check aicreditsapi.com/pricing for current rates. AiCredits sells credits payable by card or PayPal with no Chinese phone number or bank account required, so you can stand the pipeline up without procurement gymnastics.

FAQ

How many human labels do I need to calibrate a judge?

150–300 well-spread examples is usually enough to catch a broken rubric. Diversity matters more than raw count: cover every route, language, and output shape you actually ship, or the calibration won't generalize to production.

Can the same model generate and judge?

You can, but expect correlated blind spots — models tend to prefer their own style and forgive their own failure modes. Use the cheap model as the first pass, then escalate disagreements and low-confidence cases to a stronger or different model.

What about non-English or domain-specific outputs?

Pointwise rubrics transfer reasonably well and pairwise comparisons transfer better. For regulated domains, push constraints into the deterministic layer wherever possible — a regex can't be talked out of requiring a disclaimer.

Do I need embeddings?

Not necessarily. They earn their keep for RAG groundedness checks and duplicate detection. For most pipelines, deterministic rules plus a calibrated rubric judge plus distribution monitors cover the majority of real regressions.

How often should I re-calibrate?

Whenever you change the rubric, the judge model, the generation prompt, or the product surface. Also re-run the frozen gold set on a schedule — quiet drift in the judge is real and invisible without a fixed reference.

Try Lint in 2 seconds

Wrote something? Paste it here for a free grammar check. No account needed.

More Tools →

Related Tools

Was this article helpful?

| Share on X Reddit Copy link

服务器宕机了?别等用户告诉你

Wakeless 梦哨 帮你 30 秒监控网站 / API / SSL 证书,宕机秒级告警到邮箱、飞书、Slack。免费档 30 个监控,永久免费,无需信用卡。

免费开始监控 →
💬
反馈意见 / Feedback ×