TL;DR
I scored models three ways on held-out problems: the greedy answer, avg@8 (share of 8 samples right) and pass@8 (any right). On the 8×H100 run, the gain from reinforcement learning (RL) over the fine-tuned model had p = 0.002 in avg@8, but 0.038 in pass@8. Evaluating the same weights twice moved MATH-500 avg@8 by 0.33 points, yet only 198 of 500 greedy answers came out identical.
On the control run, RL raised avg@8 by 32.2 points but pass@8 only from 69.6% to 84.0%: mostly sharpening, with a smaller gain in reach (about 12 points, all by update 50). Paired tests, a measured noise floor and matched settings make such numbers trustworthy, and the post ends with a checklist.
What you’ll learn
- What greedy, avg@k and pass@k measure, and the unbiased pass@k estimator.
- Four paired tests in plain words, as implemented in
code/rl/stats.py. - Why avg@8 detected a change that pass@8 and greedy barely did.
- How to measure a noise floor, and why greedy answers change with the batch.
- How to separate sharpening from new reach, and how settings move a base model’s score.
Three ways to score one problem
A held-out problem goes to the model, and a grader checks the final answer against the reference (Part 8). The model can answer greedily or by sampling. Sampling at temperature 1 draws each token from the model’s own probabilities, so repeated answers differ.
Greedy
Greedy decoding takes the single most likely token at every step. It gives one answer per problem, marked right or wrong.
avg@k
where \(n\) is the number of answers sampled independently at temperature 1 for problem \(x\), and \(c_x\) is how many the grader marks right. The benchmark score is the mean over problems.
In words: the share of a problem’s sampled answers that are right, averaged over the test set.
It estimates \(p_x\), the chance that one sample is right. PocketRL’s paper defines avg@8 as “the fraction of correct answers across eight sampled answers per question at temperature 1” [3].
pass@k
where \(p_x\) is the per-sample chance of a right answer on problem \(x\), and \(k\) is the number of independent attempts.
In words: the chance that at least one of \(k\) samples is right.
Sha Li puts it well: pass@k “is best read as a measure of potential” [2]. It asks whether a right answer exists somewhere in what the model can sample. To estimate it from \(n \ge k\) samples, use the unbiased estimator of Chen and colleagues [1]:
where \(\binom{a}{b}\) counts the ways to choose \(b\) items from \(a\), and the formula needs \(n \ge k\).
In words: of all the ways to pick \(k\) of the \(n\) samples, the share that contain at least one right answer.
Two special cases matter. At \(k = 1\) the estimator is \(c_x / n\), so avg@n is the unbiased estimate of pass@1. At \(n = k\) the ratio is 1 when \(c_x = 0\) and 0 otherwise:
where \(\mathbb{1}[\cdot]\) is 1 when the condition holds and 0 otherwise.
In words: with exactly as many samples as attempts, pass@k only asks whether any sample was right.
All my pass@8 numbers used 8 samples, so they are equation (4): unbiased, but one bit per problem.
Derivation: why equation (3) is unbiased
The \(n\) samples are independent, each right with chance \(p_x\). Pick \(k\) of them at random, without replacement: they are themselves \(k\) independent samples, all wrong with chance \((1 - p_x)^k\). Given \(c_x\) right answers among \(n\), a random \(k\)-subset is all wrong with chance \(\binom{n - c_x}{k} / \binom{n}{k}\), so that ratio’s expectation is \((1 - p_x)^k\). The plug-in \(1 - (1 - c_x/n)^k\) is biased low instead, because \((1 - \hat p)^k\) is convex in \(\hat p\) (Jensen’s inequality).
Megatron computes equation (3) as \(1 - \prod_{i = n - c + 1}^{n} (1 - k/i)\), which avoids huge factorials. Our evaluation stores pass@1 to pass@8 for every problem.
Which problems each metric rewards
where \(p\) is one problem’s per-sample accuracy and \(k\) the number of attempts.
In words: raising \(p\) on a hard problem moves pass@k a lot, while raising it on a problem the model often solves barely moves it.
Sha Li puts a number on it: “at \(k = 8\), a prompt with \(p = 0.1\) counts about 60 times as much as one with \(p = 0.5\)” [4]. By contrast, avg@k weights every problem equally, since its derivative in \(p\) is 1. Greedy follows only the single most likely answer.
| Metric | Per problem | Estimates | The question it answers |
|---|---|---|---|
| Greedy | 1 if the greedy answer is right | the greedy policy’s accuracy | What does deterministic decoding give? |
| avg@8 | \(c_x / 8\) | \(p_x\), the per-sample accuracy | How reliable is one sample? |
| pass@8 | \(\mathbb{1}[c_x > 0]\) | \(1 - (1 - p_x)^8\) | Can the model reach a right answer in 8 tries? |
The held-out sets
Every number here comes from problems the models never trained on.
- Laptop (Phase 0): 200 held-out problems from the warm-up tier of our arithmetic curriculum, 8 samples each.
- 8×H100 run: six sets, GSM8K (1,319 problems), MATH (5,000), MAWPS (520), MultiArith (180), ASDiv (407) and SVAMP (300). The evaluations after SFT and after RL used a fixed subset of about 200 per set: 1,178 problems in all. ASDiv and SVAMP are the “near” sets, because the RL training tier was built from them.
- Control run (one H100): PocketRL’s six sets, 1,547 problems in all. They are MATH-500 (500), AIME 2024 (30), AIME 2025 (30), AMC 2023 (40), Minerva Math (272) and OlympiadBench (675). A dev split of 166 training-distribution problems, scored greedily, serves as a check.
On the 8×H100 run and the control run, each problem gets one greedy answer and 8 samples at temperature 1; the laptop’s 8 samples used temperature 0.8, top-k 50 and top-p 0.85. Small sets need care. Always answering the most common gold answer scores 8.33% on SVAMP and 7.78% on MultiArith; GSM8K’s floor is 3.0%. On AIME, a single problem is worth 3.3 points.
Paired tests, in plain words
Why pair
Both evaluations score the same problems, before and after training. Problems differ far more in difficulty than two nearby models differ in skill, so each problem is compared with itself:
where \(\sigma_0\) and \(\sigma_1\) are the spreads of the per-problem scores before and after, and \(\rho\) is their correlation across problems. \(N\) is the number of problems.
In words: the more the two evaluations agree on which problems are hard, the more noise cancels in the per-problem difference.
Unpaired, \(\rho\) drops out and the noise is larger.
The paired difference, its standard error and t
where \(a_i\) is problem \(i\)’s score (its avg@8, between 0 and 1) and \(N\) the number of problems in both evaluations. \(s_d\) is the standard deviation of the differences.
In words: average the per-problem changes, then measure that average in units of its own standard error.
On MATH-500, from the base model to update 100, \(\bar d\) was +32.17 points, with SE 1.41 and t 22.9.
In code, this is paired_ci in code/rl/stats.py, called by compare_env in code/scripts/analyze_control.py.
The sign-flip test
where each \(\varepsilon_i^{(b)}\) is a random sign, +1 or −1 with equal chance, drawn afresh in each of \(B = 20{,}000\) rounds with seed 0. Zero differences are dropped, and the two 1s count the observed signs as one more round.
In words: flip a fair coin for the sign of each problem’s change, many times, and count how often chance matches the real total.
The test assumes only that, with no effect, each change is as likely to go up as down. Its smallest possible value is 1/20,001 ≈ 0.00005, which is why large effects print “sign-flip p 0.00005”.
The bootstrap interval
where each \(\bar d^{*}\) is the mean of \(N\) differences drawn with replacement from the observed ones. It is recomputed 10,000 times with seed 0, and the subscripts are percentiles.
In words: treat the test problems as the whole world, resample them, and keep the middle 95% of the resampled mean changes.
The interval covers the luck of which problems were drawn, not the luck of training. One run per model says nothing about a second run.
When items are not independent, such as conversations sharing a first prompt, cluster_paired_ci resamples whole groups instead.
McNemar’s exact test on yes-or-no outcomes
Greedy gives one right-or-wrong per problem, and so does pass@8. Only the problems that changed carry information. In this subsection only, \(b\) counts problems that went from wrong to right, and \(c\) those that went from right to wrong, as in mcnemar_exact(b, c):
where \(b + c\) is the number of problems that changed, and with no effect each would go either way with chance 1/2.
In words: with no effect, the flips split about evenly both ways, and \(p\) is the chance of a split at least this lopsided.
From the base model to update 100, MATH-500’s greedy answers went 194 wrong-to-right and 18 right-to-wrong: p = 2e-38.
For PocketRL’s six-set mean, set_means adds the sets’ errors in squares, \(\operatorname{SE} = \sqrt{\sum_s w_s^2 \operatorname{SE}_s^2}\) with \(w_s = 1/6\), because the sets are independent samples.
On the control run, that mean rose by 13.54 points, with SE 0.89 and t 15.2.
The statistics primer collects these tests on one page.
Why avg@8 detects smaller changes
On the 8×H100 run, GSPO-A was the RL model trained from the supervised fine-tuned (SFT) model (Part 9). Here it is against SFT on the same 1,178 problems, under all three metrics:
| Metric | SFT | GSPO-A | Test | p |
|---|---|---|---|---|
| Greedy | 1.9% | 2.6% | McNemar, 28 up and 19 down | 0.24 |
| pass@8 | 10.5% | 13.2% | McNemar, 120 up and 89 down | 0.038 |
| avg@8 | 1.46% | 2.04% | sign-flip, +0.58 points (SE 0.19, t 3.09) | 0.002 |
Three things make avg@8 the sharper tool:
- It uses every sample. A problem going from 1 right answer to 3 moves avg@8 by 0.25 and pass@8 not at all. By contrast, pass@8 keeps one bit per problem, and greedy one answer.
- More samples shrink the noise. For one problem, \(c/n\) has variance \(p(1 - p)/n\), so 8 samples instead of 4 cut its noise by \(1/\sqrt{2}\), about 30%.
- Greedy moves for reasons unrelated to the model, as the next section shows.
Even pass@8 from 8 samples is noisy between passes. On the 8×H100 run’s subset, a second RL arm looked ahead on greedy and behind on pass@8. A whole-set pass with fresh samples did not reproduce it.
The SVAMP subset’s gain also shrank on the whole set, from +10.5 to +6 points. Part of a subset’s large gain is the luck of the draw.
The metrics answer different questions, so pick the main one before seeing the data. Two pooled tests on one result also need a correction: Bonferroni’s moved pass@8’s p from 0.038 to 0.075.
Noise floors: the same weights, evaluated twice
After the control run’s last update and save, Megatron ran its validation once more without being asked. That wrote a third block of results: the same update-100 weights, evaluated again with fresh samples.
| MATH-500 | First | Repeat | Paired |
|---|---|---|---|
| avg@8 | 53.95% | 53.62% | −0.33 points (SE 0.86, t −0.4, sign-flip p 0.72; bootstrap [−2.02, +1.38]) |
| Greedy | 68.8% | 67.0% | 9 wrong-to-right, 18 right-to-wrong (McNemar p 0.12) |
| pass@8 | 84.0% | 83.6% | 22 newly reached, 21 no longer (any of 9 tries) |
| Identical greedy texts | 198 of 500 |
The paired tests find nothing between identical weights, as they should. But 60% of the greedy answers changed, and greedy accuracy carries about ±2 points of run-to-run noise. The avg@8 score averages that noise away.
The noise floor is also a yardstick. Evaluated on its own, the saved update-100 checkpoint changed 9 dev-split answers and kept 75 of 166 texts identical. The in-memory repeat changed 5 and kept 63. So the saved checkpoint is the evaluated model, within the noise.
Why greedy answers change with the batch
Greedy picks \(\arg\max_v z_{t,v}\), the token with the largest logit at step \(t\). When two tokens nearly tie, a tiny rounding difference can flip the choice, and the rest of the answer then diverges. Our converter check saw such a split: “To solve the problem” against “To solve the given problem”.
Megatron’s inference engine batches requests dynamically, and its bf16 arithmetic depends on each batch’s makeup. Thinking Machines found the same in inference servers [5]. An LLM’s forward pass is “run-to-run deterministic”, but it “lacks ‘batch invariance’”: a request’s output depends on the batch size. Part 5 explains the mechanism.
On the laptop, in fp32 with a fixed evaluation seed, evaluation was exactly repeatable. Two evaluations of the same weights agreed on every problem, and re-evaluating saved weights reproduced an in-run evaluation on all 200 problems.
Sharpening versus reach
RL can improve a model in two ways. Sharpening moves probability onto answers the model could already find: avg@8 rises while pass@8 barely moves. Reach makes problems solvable that no try solved before: pass@8 rises.
| MATH-500, control run | Base | Update 50 | Update 100 |
|---|---|---|---|
| avg@8 | 21.8% | 41.4% | 54.0% |
| Greedy | 33.6% | 65.4% | 68.8% |
| pass@8 | 69.6% | 83.2% | 84.0% |
| Any of 9 tries | 73.4% | 85.6% | 85.8% |
| All 8 samples right | 2 problems | 17 | 63 |
“Any of 9 tries” counts a problem as reached if any of its 8 samples or its greedy answer is right. From the base model to update 100, 80 problems were newly reached and 18 lost. Against the noise floor’s 22 and 21, the net is about +62 problems, or +12.4 points. From update 50 to 100 it was 24 and 23, the noise level: the second half widened nothing.
So RL raised the average sample by 32 points and the reach by about 12, all of the reach in the first 50 updates. After that, the model became reliable on problems it could already solve: 63 problems right in all 8 samples, up from 2.
The 8×H100 run pointed the same way on a weak model. GSPO-A raised pass@8 by 2.7 points, while greedy moved 0.7, not significantly.
RL can only sharpen what the model sometimes gets right. After SFT, our own model got 0 of 16 right on 78% of its medium-tier training problems. Part 14 tells that story.
How evaluation settings move a base model’s score
Decoding
The same weights give three numbers. Qwen2.5-Math-1.5B scored 33.6% greedy on MATH-500, 21.8% avg@8 and 69.6% pass@8. PocketRL’s 7B base read 50.0% greedy against 30.2% sampled, also on MATH-500. Never compare a greedy number with a sampled one.
A config file that switched off sampling
Qwen’s generation_config.json says do_sample: false, and our tokenizer folder had copied it. Megatron’s chat endpoint fills any sampling field a request leaves out from that file, so it decoded with top-k 1: greedily.
The symptom was 1.44 distinct answers per group of 8, where real sampling gives 8.0. On the first batch of training problems, the solve rate read 0.508 under greedy against 0.289 when sampled. The fix: never copy the file, check distinct answers per group, and read Megatron’s resolved “Sampling defaults” line in the log.
Truncated sampling
Top-k sampling keeps only the \(k\) likeliest tokens, and top-p keeps the smallest set whose probabilities sum to \(p\). On the laptop, the evaluation sampler used temperature 0.8, top-k 50 and top-p 0.85. Under it, the three seeds’ gains read +4.6 to +5.1 points; at temperature 1 without truncation, +2.4 to +3.2. The models were identical; only the evaluation sampler changed.
Prompt, grader and length cap
To reproduce PocketRL’s base number, I matched their prompt template, their grader, their 3,000-token answer cap and temperature 1. Our base then read 21.8% on MATH-500 against their 21.9%, and 9.7% against 10.0% on the six-set mean. PocketRL itself scores each released model with that model’s own training prompt. I ran no prompt ablation, so I have no measured prompt effect of my own.
The length cap matters too. On Minerva, the base model’s median greedy answer ran 3,237.5 tokens: on most problems it rambled into the cap instead of finishing. After RL the median was 711 tokens. Our own pretrained base scored 0 on every set: it never wrote an answer in the format the grader reads.
A checklist for honest RL evaluation
- Fix the test and the decision rule before the run. The control run’s pass line (+11.5 points at update 50) preceded any data.
- Use held-out sets, and check contamination yourself. NVIDIA’s decontamination kept test questions with only the numbers changed (Part 3).
- Report small sets beside their free score. Answering “1” every time scores 8.33% on SVAMP.
- Report avg@k with at least 8 samples at the training temperature, with greedy and pass@k beside it, never mixed.
- Pair the problems. Give the SE, t, a permutation p and a bootstrap interval, and McNemar for yes-or-no outcomes.
- Measure the noise floor by evaluating the same weights twice.
- Check that sampling samples: distinct answers per group, and the resolved sampling settings in the log.
- Say what an interval covers. It covers which problems were drawn; only more seeds cover training luck.
- Correct for multiple tests, or say that you did not.
- Say what the grader measures. Ours read only the final answer, not the working.
- Report answer length and the share of answers cut at the cap.
- Evaluate the saved checkpoint, and compare it with the in-run reading against the noise floor.
- Separate sharpening from reach: report avg@k, pass@k and the per-problem transitions.
Run it yourself
Hardware and time. The evaluations ran on one H100: the base model’s MATH-500 pass, greedy plus 8 samples on 500 problems, took 586 s.
The five other sets took 1,012 s for the base model and 923 s for update 100.
The analysis needs no GPU: analyze_control.py uses only the Python standard library.
Evaluate (on the H100, from the repo root). First set up the machine and convert the base model, as in the setup guide and the control-run guide. This is the control run’s base evaluation:
source /workspace/env.sh # written by the machine setup
RUN_DIR=/workspace/runs/control_base RUN_NAME=control_base EVAL_CKPT=/workspace/qwen/megatron \
EVAL_CONFIG=code/rl/control_eval500_env.yaml EVAL_PROMPTS=500 EVAL_COLLECT_PROMPTS=16 RL_SEQ=3584 RL_CUDA_GRAPHS=1 \
bash code/scripts/megatron/eval.sh > /workspace/runs/control_base.log 2>&1
grep "Sampling defaults" /workspace/runs/control_base.log # must show top_k=0, not top_k=1
Each line of the resulting eval_results.jsonl is one problem: the greedy answer, the grades of the 8 samples, and pass@1 to pass@8.
Analyse (any machine; <runs> is the folder holding the evaluations):
# Paired comparison: the base model against update 100 (the second evaluation appended to the run's file)
python3 code/scripts/analyze_control.py eval <runs>/control_base/eval_results.jsonl \
<runs>/control_gspo/eval_results.jsonl --after-eval 2 --json base_vs_update100.json
# The noise floor: update 100 against its repeat (evaluations 2 and 3 of the same file)
python3 code/scripts/analyze_control.py eval <runs>/control_gspo/eval_results.jsonl \
<runs>/control_gspo/eval_results.jsonl --before-eval 2 --after-eval 3
# PocketRL's six sets, each model gathered from two evaluations, with the unweighted and pooled means
python3 code/scripts/analyze_control.py sets \
--before <runs>/control_base/eval_results.jsonl --before <runs>/control_base_sets/eval_results.jsonl \
--after <runs>/control_gspo/eval_results.jsonl@2 --after <runs>/control_final_sets/eval_results.jsonl
# The tests behind the statistics
cd code && python3 -m unittest discover -s tests -p "test_stats.py" \
&& python3 -m unittest discover -s tests -p "test_analyze_control.py"
The in-run evaluations append to one file without an update number, so the script starts a new evaluation wherever a problem repeats.
What to expect. From base to update 100 on MATH-500: avg@8 +32.17 points (SE 1.41, t 22.9, bootstrap [+29.45, +35.00]). The repeat gives −0.33 points, with 198 of 500 greedy texts identical. The six-set mean goes from 9.67% to 23.21%.
Config files: code/rl/control_eval500_env.yaml (MATH-500) and code/rl/control_eval5_env.yaml (the other five sets).
Code:
- code/rl/stats.py:
paired_ci,cluster_paired_ci,sign_flip_pandmcnemar_exact. - code/scripts/analyze_control.py: avg@k, reach, the paired comparisons and the set means.
- code/rl/megatron_agent.py: the per-problem greedy answer, samples and pass@k.
- code/tests/test_stats.py and code/tests/test_analyze_control.py: their tests.
The step-by-step version is the evaluation guide.
What to take away
- avg@k is the unbiased pass@1; with exactly \(k\) samples, pass@k only asks whether any sample was right.
- Pair every comparison. A sign-flip test and a bootstrap interval need no normality assumption.
- avg@8 found the 8×H100 run’s RL gain at p = 0.002, where pass@8 gave 0.038.
- Measure the noise floor before reading small changes: in bf16, greedy texts change with the batch.
- RL mostly sharpens. Report reach and reliability separately.
- Decoding, sampler truncation, the prompt and the length cap all move a base model’s score; match them before comparing.
References
- M. Chen et al., “Evaluating Large Language Models Trained on Code”, 2021. arXiv:2107.03374
- S. (Zoey) Li, “What’s in Pass@K?”, January 2026. zoeyli.com/blog/Whats-in-Pass-at-K
- S. Chung and W. Du, “PocketRL: Training a 7B Language Model with Reinforcement Learning on One RTX 5090”, November 2026. arXiv:2611.37942
- S. (Zoey) Li, “Optimizing Pass@k as Reweighting Prompts”, September 2026 (in progress). zoeyli.com/blog/Optimizing-Pass-at-K-as-Reweighting-Prompts
- H. He and Thinking Machines Lab, “Defeating Nondeterminism in LLM Inference”, Thinking Machines Lab: Connectionism. thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference
- NVIDIA, Megatron-LM at commit d6316eb45: the
pass_at_kfunction. github.com/NVIDIA/Megatron-LM
Cite this
@misc{aboagye2026minidsv4part13,
author = {Aboagye, Prince Osei},
title = {Mini DeepSeek V4, Part 13: Evaluation: how to tell if training worked},
year = {2026},
howpublished = {\url{https://poaboagye.github.io/blog/13-evaluation/}}
}