What is position bias in pairwise LLM-judge evaluation?
Position bias is an LLM judge's tendency to favor whichever answer appears first (or last), regardless of quality. Fix it by swapping the order and averaging both runs.
Imagine a taste-test where a judge tries two dishes, A then B, and picks a winner. A fair judge would pick the same dish no matter which plate came first. But real judges have a quirk: they often pick whatever they tasted first, just because it came first. So if your dish is always served first, it wins more often, even when it is not actually better. That is position bias in an LLM judge. The cheap fix is simple: run the comparison twice, once with your dish first and once with the rival first, then average the two results. If a dish only wins because of its slot, the swap cancels that out, and you are left with the true quality difference.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: define position bias, explain why a fixed order inflates win rate, give the swap and average fix, and contrast with single-answer scalar scoring.
Real products, models, and research that use this idea.
- LangSmith pairwise evaluators randomize candidate order by default and run at temperature zero for reproducible verdicts.
- Promptfoo surfaces position-swapped pairwise comparisons so teams can see verdicts flip when the order changes.
- Chatbot Arena and MT-Bench studies documented position bias as a core reason to randomize and swap answer order.
- RAGAS and TruLens lean on grounded, order-controlled judging rather than raw fixed-order pairwise scores.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you measure how strong the position bias is in your specific judge?
QWhy does swapping and averaging not fix self-preference or length bias too?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Running pairwise judging with a fixed order and trusting the win rate. The favored slot inflates one model's score, so the result reflects position, not quality.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.