4.4.16 · D3Alignment, Prompting & RAG

Worked examples — Evaluation of LLMs (benchmarks, LLM-as-judge)

2,430 words11 min readBack to topic

This page is a firing range. The parent note gave you two engines — Pass@k for objective benchmarks and Cohen's Kappa for LLM-as-judge agreement. Here we fire them at every case that can appear: the easy ones, the sign traps, the degenerate zero-inputs, the limiting values, and the exam twists.


The scenario matrix

Before defining a single symbol again, here is the map of every kind of situation the two formulas face. Read the columns as "what makes this case special."

Cell Formula The special condition What breaks / what to watch
C1 Pass@k Typical case: Nothing special — baseline
C2 Pass@k Degenerate low: (no sample ever passed) Estimator says ; must not error
C3 Pass@k Degenerate high: (every sample passes) Estimator says ; combinatorial form has
C4 Pass@k Limiting large vs How the score grows with more tries
C5 Pass@k Unbiased combinatorial estimator on ONE problem Sampling-without-replacement form
C6 Kappa Typical moderate agreement Baseline judge-vs-human
C7 Kappa Degenerate: judge and human always pick the same side () Denominator
C8 Kappa Negative kappa: judge does worse than chance Sign of goes below
C9 Both Real-world word problem: end-to-end eval report Combine both metrics
C10 Kappa Exam twist: given and , recover Algebra inversion

We now hit every cell.


Recall the two engines (symbols re-earned)

Recall Pass@k — what each letter means

::: total number of code samples drawn for one problem ::: how many of those samples passed all hidden tests ::: how many samples we "get to try" (report at) ::: the probability that at least one of tries succeeds

Recall Cohen's Kappa — what each letter means

::: observed agreement, the fraction of comparisons where judge and human chose the same winner ::: agreement expected by pure chance ::: agreement beyond chance, on a scale where is perfect and is "no better than luck"

The two forms we will use:

The symbol (" choose ") counts how many ways to pick items out of when order does not matter. We use it because "which samples did the judge happen to draw" is exactly an unordered choice.


C1 — Pass@k, the typical case


C2 — Pass@k degenerate low ()


C3 — Pass@k degenerate high ()


C4 — Pass@k limiting behaviour in

The next figure shows why more tries always help but with shrinking returns.

Figure — Evaluation of LLMs (benchmarks, LLM-as-judge)

C5 — Pass@k unbiased combinatorial estimator, single problem


C6 — Kappa, typical moderate case

This reproduces the parent's headline number, so you can trust the machinery.


C7 — Kappa degenerate ()

Figure — Evaluation of LLMs (benchmarks, LLM-as-judge)

C8 — Kappa negative (worse than chance)


C9 — Real-world word problem (both engines)


C10 — Exam twist: invert the formula


Recall Quick self-test

Pass@k when ::: always — no try can succeed Pass@k when ::: always — any try succeeds; note Why report next to ::: when one label dominates, and misleads even at high Sign of below zero means ::: judge agrees worse than chance — likely a systematic bias Invert kappa: :::

Related tooling and ideas: Prompt Engineering Best Practices shape the judge prompt, Few-Shot Learning can calibrate the judge, Constitutional AI supplies judging criteria, and evaluation of RAG systems layers retrieval-quality on top of these same metrics. The judge's verdict tokens are A, B, or Tie.