SynfraCore
Synfracore
Start Learning
Navigation

Academies

Platform

RoadmapsLabsCertificationsInterviewPYQsAI AssistantCareer
Start Learning Free Learning Roadmaps

AI Evals — Fundamentals

Core concepts and commands — hands-on from the start

📄
Last updated Dec 2026
Expert Content

AI Evals — Fundamentals

Vibes vs. evidence

One-line idea: "It felt better when I tried it" is an opinion about one sample; an eval is a repeatable measurement across many samples — and only one of those two actually tells you whether a change helped.

Everyday comparison: Tasting one spoonful of a soup and declaring the whole pot seasoned correctly is exactly how a kitchen ships an inconsistent dish — the spoonful you tasted isn't the spoonful the customer gets. An eval is tasting a measured sample from every batch, the same way, every time, so "better" means something a different person could check and get the same answer.

Memory line: A vibe is one data point with no record of what was tested. An eval is a record you can re-run and compare.

What a golden set actually needs to contain

A golden set is a fixed collection of inputs, run the same way every time a system changes, used to compare versions against each other. A useful one has three characteristics: it's representative of real usage (not just invented happy-path examples), it includes known-hard cases the system has struggled with before, and it's large enough to catch a regression affecting a meaningful slice of traffic without being so large that running it becomes impractical.

text
A weak golden set:          A stronger golden set:
- 5 easy, obvious inputs    - 30+ inputs spanning common cases
- No edge cases             - A dedicated slice of known-hard inputs
- Never updated             - Refreshed periodically with real traffic

Scoring methods, compared

Exact match compares output directly against one expected string — fast and unambiguous, but only works where there genuinely is one correct answer (a classification label, a structured field extraction).

Rubric-based scoring defines a checklist of specific criteria ("does the response mention the refund policy," "is the tone professional") applied consistently by a human or a model grader — slower to set up, but works for open-ended output where exact match can't.

LLM-as-judge uses a separate model call to score another model's output against instructions or a rubric. It's the option that scales to the volume human review can't keep up with, and tends to track human opinion reasonably well once the judge has something specific to check against — but it carries forward whatever biases and blind spots that judge model has, and a mistaken verdict repeated consistently can pass as settled fact for a long stretch before anyone double-checks it by hand.

Exact match
Fast, unambiguous. Only fits tasks with one genuinely correct answer
LLM-as-judge
Scales to open-ended output. Inherits the judge model's own blind spots

A fourth option sits between exact match and LLM-as-judge: regex / pattern matching (does the output contain a required phrase, match a required format) and semantic similarity (does the output's meaning land close to a reference answer, even with different wording). Both are checkable in code, no model call needed for scoring itself:

python
import re
from difflib import SequenceMatcher

def regex_match(output: str, pattern: str) -> bool:
    """Exact-match's more flexible cousin — checks structure, not exact text."""
    return re.search(pattern, output) is not None

def semantic_similarity(output: str, reference: str, embed_fn) -> float:
    """Cosine similarity between two embedded texts — catches a correct
    answer phrased differently, which exact match would wrongly fail."""
    import numpy as np
    a, b = embed_fn(output), embed_fn(reference)
    return float(np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b)))

def rough_overlap(output: str, reference: str) -> float:
    """A dependency-free fallback when no embedding model is available."""
    return SequenceMatcher(None, output.lower(), reference.lower()).ratio()

Common mistake + fix: Using exact match on a task where the correct answer can legitimately be phrased several ways ("yes, that's correct" vs. "correct"). Fix: exact match belongs on genuinely closed-form outputs (a label, a number, a structured field) — anything with legitimate phrasing variation needs semantic similarity, a rubric, or an LLM judge instead.

💡 In simple words

One-line idea: An LLM judge doesn't just inherit blind spots from what it was trained on — it also has specific, well-documented biases in HOW it compares two responses, not just what it thinks is good.

Everyday comparison: A judge at a cooking competition who always prefers the plate presented last, or always picks the fancier-looking dish regardless of taste, isn't evaluating fairly — even if each individual verdict sounds reasonable when explained. LLM judges have measurable versions of both failures.

BiasWhat it looks like

|---|---|

Position biasThe judge favors whichever response was shown first (or last) in the prompt, regardless of actual quality
Verbosity biasThe judge favors the longer, more detailed-sounding response, even when it isn't more correct
Self-preferenceA model judging its own family's outputs rates them higher than an equally good response from a different model

Try it in 2 minutes: You're comparing two prompt versions by having an LLM judge pick the better response from each pair, always showing version A first. The judge picks "first response" 80% of the time. Is version A actually better?

Answer: Not necessarily — that lopsided a split is a strong signal of position bias, not evidence that A is better. Fix: randomize which response is shown first/second across judged pairs, and check whether the preference rate changes.

Common mistake + fix: Trusting a single LLM-as-judge comparison without checking for these biases. Fix: randomize response order, and periodically calibrate the judge's verdicts against a small human-labeled sample (see Intermediate) before trusting it at scale.

Memory line: An LLM judge can be wrong about WHAT is good (blind spots) and also wrong about HOW it compares two things (position/verbosity bias) — check for both.

A minimal eval loop, concretely

text
1. Define the golden set — real, representative inputs
2. Run the current prompt/model against every input in the set
3. Score each output (exact match, rubric, or LLM-as-judge)
4. Record the aggregate score AND the per-category breakdown
5. Change the prompt or model
6. Re-run the same set, re-score, compare against the previous run
7. A drop in any specific category is worth investigating even if
   the aggregate score looks fine -- an average can hide a localized regression

Why human spot-checks still matter even with automated scoring

Automated scoring — exact match or LLM-as-judge — is what makes evaluation repeatable and fast enough to run on every change. It is not, by itself, proof that the scoring method itself is measuring the right thing. A periodic human review of a sample of outputs, especially ones the automated scorer rated highly, is how a systematically wrong judge or a poorly designed rubric actually gets caught, rather than quietly validating the same blind spot release after release.

Why "it felt better when I tried it" doesn't substitute for this

A handful of manual tries samples an arbitrary, usually small and unrepresentative slice of real usage, graded by one person's subjective impression in the moment — no fixed set, no consistent scoring, nothing to compare against next time. It can feel like real evidence precisely because trying something and seeing it work is a satisfying experience, which is exactly why it's easy to mistake for a rigorous check when it isn't one.

Try it: Pick a prompt or feature you've worked with recently. Write down five real inputs it needs to handle well, including at least one genuinely hard case. For each, write what scoring method (exact match, rubric, or LLM-as-judge) would actually tell you whether the output was good — not which one is easiest to set up.

Share:
Join our Community
Daily tips, job alerts, interview help — join engineers learning together
→
Up Next
⚡
AI Evals — Intermediate
Real-world patterns, best practices, and deeper topics
Also Worth Exploring
← Back to all AI Evals modules
← InstallationIntermediate →