When you wire an LLM into an evaluation loop, the first architectural fork is single-answer vs pairwise LLM judge. Each approach trades off differently on cost, latency, and the kind of signal you can trust, and the wrong pick will quietly corrupt your metrics.
How each judge works
Single-answer grading scores one completion in isolation. You hand the judge a rubric and ask for a numeric or categorical verdict. The model never sees alternatives.
from openai import OpenAI
import json
client = OpenAI(base_url="https://api.openai.com/v1")
def grade_single(question: str, answer: str) -> dict:
resp = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "system", "content": "Score the answer 1-5 on correctness, conciseness, and tone."},
{"role": "user", "content": f"Q: {question}\nA: {answer}"}
],
response_format={"type": "json_object"}
)
return json.loads(resp.choices[0].message.content)
Pairwise comparison shows two answers to the same prompt and asks which is better, or if they tie.
def compare_pair(question: str, ans_a: str, ans_b: str) -> str:
resp = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "system", "content": "Pick A, B, or tie based on which answer better satisfies the prompt."},
{"role": "user", "content": f"Q: {question}\nA: {ans_a}\nB: {ans_b}"}
]
)
return resp.choices[0].message.content.strip()
The single-answer vs pairwise LLM judge decision shapes your entire eval data model, from storage schema to alerting logic.
Prompt structure
Single-answer prompts must encode the full rubric. Pairwise prompts can be shorter because relative quality is easier for models to judge than absolute scales. In practice, pairwise instructions like “ignore length, focus on accuracy” reduce verbosity bias.
Capabilities
Absolute vs relative signals
Single-answer grading produces an absolute score. That lets you plot a time series: “average correctness rose from 3.1 to 3.4 after the prompt change.” It supports regression gates in CI.
Pairwise yields only relative preference. You learn that variant B beat A 70% of the time, but not whether either is “good”. To get a global ranking you must aggregate with Bradley-Terry or Elo, which assumes transitivity that LLMs violate occasionally.
What each detects
Single-answer catches “this response is malformed” via low score. Pairwise catches “B is more helpful than A” but will mark two broken answers as a tie or arbitrary pick. Use single-answer when you need a quality floor; use pairwise when you need a ranking.
Price and cost model
Call volume
Single-answer cost is linear: one completion per evaluated sample. If you grade 10,000 responses, you pay for 10,000 judge calls.
Pairwise cost is combinatorial if you do full round-robin. For k candidates, naive all-pairs needs k(k-1)/2 comparisons per query set. With 10 candidates and 1,000 queries, that’s 45,000 judge calls—4.5x the single-answer load for the same query volume. You can reduce this with tournament seeding or active sampling, but the floor remains above linear.
Token economics
Both methods meter by tokens. Input tokens dominate because you resend the prompt and answers each call. An OpenAI-compatible gateway like n4n.ai provides per-token usage metering and honors client routing directives, so you can cap spend by model tier when running large pairwise sweeps. Cache-control hints forwarded to providers trim repeated context costs when the same question is reused across pairs.
Latency and throughput
Parallelism
Single-answer grading parallelizes trivially. Fire 100 async requests, collect scores, done. No dependency between judgments.
Pairwise introduces scheduling overhead. You need a matchmaker that pairs candidates, then waits for all results before aggregation. Pipeline depth grows with candidate count. At 20 candidates, even with concurrency, tail latency is driven by the slowest bracket.
Concurrency pattern
import asyncio
async def grade_many(samples):
return await asyncio.gather(*[grade_single(q, a) for q, a in samples])
Pairwise needs a queue:
async def pair_tournament(matches):
return await asyncio.gather(*[compare_pair(q, a, b) for q, a, b in matches])
The tournament builder itself is synchronous and blocks on result aggregation.
If your eval must finish in minutes on a CI runner, single-answer is the only sane default. Pairwise fits offline nightly jobs.
Ergonomics
Storage and alerting
Single-answer integrates with dashboards immediately. Store the score column, set a threshold, alert on drop.
SELECT prompt_version, AVG(score) FROM judgments GROUP BY 1;
Pairwise requires a separate aggregation service. You store raw verdicts, then compute win rates:
wins = sum(1 for v in verdicts if v == "A")
win_rate = wins / (len(verdicts) - ties)
Tie handling, position bias correction (swap A/B order), and confidence intervals add code. Most teams underestimate this tax.
Schema impact
Single-answer: one row per evaluated item. Pairwise: one row per match, plus a derived table for aggregated ranks. The latter complicates joins with production logs.
Ecosystem
Tooling
Single-answer rubrics are easy to share as YAML. LangSmith, PromptFoo, and custom scripts all consume the same JSON.
Pairwise has heavier lineage: Chatbot Arena popularized the format, and libraries like llm-arena or evalplus ship matchmaking. If you route judge calls through n4n.ai, you get automatic fallback when a provider is rate-limited or degraded, which matters when a pairwise job issues thousands of dependent calls against 240+ models behind one endpoint.
Both approaches work with any OpenAI-compatible chat endpoint. The difference is tooling maturity: single-answer is a for loop; pairwise is a small distributed system.
Limits
Failure modes
Single-answer judges drift. The same rubric scored 4.0 last month may score 3.5 today because the judge model got a silent update. Calibration is fragile.
Pairwise suffers from verbosity bias—longer answers win—and position bias—A is favored if shown first. You must randomize order and often strip lengths.
Mitigations
For single-answer, anchor scores with gold examples periodically. For pairwise, run each pair twice with swapped positions and discard disagreements. Neither method replaces grounded checks (unit tests on output schema). Use them as signals, not oracles.
Head-to-head summary
| Dimension | Single-answer grading | Pairwise comparison |
|---|---|---|
| Output | Absolute score (1-5, pass/fail) | Relative preference (A/B/tie) |
| Cost scaling | O(n) judge calls | O(n²) for full round-robin |
| Latency | Embarrassingly parallel | Needs matchmaking, higher tail |
| Ergonomics | Store score, alert on threshold | Store verdicts, aggregate win rates |
| Best for | Regression tracking, CI gates | Model selection, human-aligned ranking |
| Key failure | Rubric drift, calibration loss | Position/verbosity bias, non-transitivity |
| Ecosystem | YAML rubrics, simple scripts | Arena-style harnesses, Elo libs |
Which to choose
Continuous quality monitoring in production. Use single-answer grading. You need a stable numeric signal to trigger alerts. Pairwise gives no baseline.
Choosing between two prompt variants. Pairwise is faster to set up than designing a calibrated rubric, and matches how humans review. Run 500 queries, swap order, report win rate.
Building a public leaderboard. Pairwise with Elo is the standard because users intuitively trust “model A beats B”. Expect to invest in bias correction.
Tight CI budgets. Single-answer wins on cost and wall-clock. One call per sample, parallelizable, done.
Hybrid path. Grade single-answer for absolute thresholds, then pairwise among only the top candidates to rank them. This keeps cost near linear while recovering preference signal where it matters.
The single-answer vs pairwise LLM judge trade-off is not ideological. It’s a scheduling and data-model problem. Pick based on whether you need a thermometer or a bracket.