Sub topic 10
Variance across runs and settings
This chapter assumes you can read Python and have written a judge prompt that returns a structured verdict. It also assumes you know what a pass rate is.
Why the same input can get different verdicts
A judge is a language model that samples tokens. If you send the same prompt twice, you can get two different scores. Three things cause this:
- Sampling temperature. A higher temperature makes the output more random. A temperature of 0 reduces the randomness but does not remove it.
- Serving nondeterminism. Batching and floating-point differences on the provider's hardware can change outputs even at temperature 0. Some APIs also offer a seed parameter, which only makes outputs more repeatable, not identical.
- Borderline items. An answer that is a clear 5 or a clear 1 rarely flips. An answer that sits between two scores flips often.
Reasoning before the score adds another source of variance. The judge may write a different explanation each run, and that explanation steers the final score.
Measuring variance
Run the judge several times on every item and look at how often the verdicts disagree. The example below uses a simulated judge so it runs without an API key. Replace fake_judge with a real call.
import random
from collections import Counter
P_PASS = {"clear_pass": 1.0, "borderline": 0.5, "clear_fail": 0.0}
def fake_judge(item, rng):
return "pass" if rng.random() < P_PASS[item] else "fail"
def repeat_judge(judge, items, k=5, seed=0):
rng = random.Random(seed)
return {item: [judge(item, rng) for _ in range(k)] for item in items}
def unstable(results):
return [i for i, v in results.items() if len(set(v)) > 1]
def majority(verdicts):
return Counter(verdicts).most_common(1)[0][0]
results = repeat_judge(fake_judge, list(P_PASS), k=7)
print("unstable items:", unstable(results))
print({i: majority(v) for i, v in results.items()})The fraction of unstable items is your flip rate. Report it next to the pass rate. A pass rate of 80% with a 30% flip rate means a large part of your dataset is decided by chance.
Settings that change the result
Changes to the judge setup can shift scores as much as changes to the system under test. Check these:
| Setting | Effect on variance |
|---|---|
| Temperature | Lower values reduce flips but do not guarantee identical output |
| Reasoning before score | Can improve quality but adds run-to-run variation |
| Score scale | A 1-5 scale flips more often than pass/fail, because neighbouring scores are easy to confuse |
| Prompt wording | Small edits to the rubric can move the average score |
| Model version | A different version is a different judge |
Reducing and accounting for variance
- Set temperature to 0 and a seed where the API supports them.
- Use coarse scales. Binary or three-level verdicts are more stable than ten-point scales.
- Judge each item several times and take the majority verdict. An odd
kavoids ties. - Send unstable items to human review. They often show that the rubric is ambiguous.
- Keep the judge settings fixed while you compare two systems. Change one thing at a time.
Variance also feeds into the uncertainty of your final metric. A later chapter covers how to put confidence intervals on pass rates.
Exercise
A judge scores 100 items five times each at temperature 0. 12 items receive different verdicts across runs. What is the flip rate, and what two actions would you take?
Show answer
The flip rate is 12/100 = 12%. Take the majority verdict of the five runs for each item, and send the 12 unstable items to human review or use them to find ambiguity in the rubric. Also record the model version and settings so the run can be repeated.