GRPO on 16 GB: Analytical VRAM Ceilings, KL Stability, and Five RLVR Reward-Gaming Leaks¶
Published: 2026-12-02 · Repository: cuhawk/grpo-16gb (671afc377a5a, 34 pytest collected) · Audit: grpo_audit_summary.json · Raw CSVs: VRAM sweep · 3-seed KL · reward-gaming cases
Claim¶
In the checked-in 30-row analytical NF4 sweep, 21/30 configurations fit the estimator's 15.2 GB usable limit for a nominal 16 GB RTX 5080, while 27/30 fit the 22.8 GB usable limit for a nominal 24 GB L4. The boundary shifts with sequence length and rollout group size: at 4,096 total tokens, 14B/G=4 estimates 15.78 GB (above the 5080 limit), and 27B/G=4 estimates 24.06 GB (above the L4 limit). The accompanying CPU-only, three-arm toy policy produced finite, nonnegative sampled Schulman $k_3$ KL in 24/24 runs across three seeds. More concerningly, the production deterministic verifiers awarded exact_pass=True to 5/9 adversarial completions.

Method¶
The grpo-16gb audit writes four deterministic artifacts. Its VRAM estimator covers five architecture profiles (1.5B, 3B, 7B/8B, 14B, 27B), G=4/8, and total sequence lengths 1,024/2,048/4,096 with equal prompt and completion halves. It assumes NF4 weights, LoRA rank 16, gradient checkpointing, paged 8-bit AdamW, and a fixed 0.85 GB CUDA overhead. Fit is computed against the estimator's usable 15.2 GB and 22.8 GB limits; these are analytical peaks, not observed CUDA allocations.
The verifier audit sends three valid controls and nine fixed adversarial completions through the production verify_completion dispatcher. The KL sweep is a CPU three-arm categorical toy policy, with seeds 42/137/2026, G=4/8, $\beta=0/0.02/0.04/0.08,160updates per run, and512independent final-policy samples per run. Each row also records1,000`-resample percentile bootstrap 95% intervals. No LLM weights or live GPU are involved in that sweep.
Measured Tables¶
Analytical NF4 peak VRAM (grpo_vram_ceiling_sweep.csv)¶
All 30 peak estimates below are the CSV's total_peak_gb values in GB. A fit count is the number of the three sequence lengths at or below each usable limit for that model and group size.
| Model profile | Group G |
1,024 tokens |
2,048 tokens |
4,096 tokens |
RTX 5080 fits / 3 | L4 fits / 3 |
|---|---|---|---|---|---|---|
1.5B |
4 | 2.72 |
3.02 |
3.62 |
3 |
3 |
1.5B |
8 | 3.02 |
3.62 |
4.82 |
3 |
3 |
3B |
4 | 3.88 |
4.25 |
4.98 |
3 |
3 |
3B |
8 | 4.25 |
4.98 |
6.43 |
3 |
3 |
7B/8B |
4 | 7.06 |
7.53 |
8.47 |
3 |
3 |
7B/8B |
8 | 7.53 |
8.47 |
10.35 |
3 |
3 |
14B |
4 | 12.31 |
13.47 |
15.78 |
2 |
3 |
14B |
8 | 13.47 |
15.78 |
20.41 |
1 |
3 |
27B |
4 | 19.57 |
21.07 |
24.06 |
0 |
2 |
27B |
8 | 21.07 |
24.06 |
30.03 |
0 |
1 |
| Total | 21/30 |
27/30 |
CPU three-seed Schulman $k_3$ sweep (rlvr_kl_stability_3seed.csv)¶
Each seed cell is the sampled k3_kl_mean from one CSV row. The final column is the arithmetic mean of the three rows' exact_categorical_kl values, rounded to four decimals; it is a different quantity from the sampled k3 estimate. Every run had finite_nonnegative_kl=True.
G |
$\beta$ | Seed 42 k3 |
Seed 137 k3 |
Seed 2026 k3 |
Three-seed mean exact categorical KL |
|---|---|---|---|---|---|
| 4 | 0.00 |
1.8959 |
2.7189 |
1.2285 |
1.8282 |
| 4 | 0.02 |
1.8270 |
2.5957 |
1.1839 |
1.8208 |
| 4 | 0.04 |
1.6546 |
2.5192 |
1.1896 |
1.8104 |
| 4 | 0.08 |
1.7168 |
2.4113 |
1.4240 |
1.7890 |
| 8 | 0.00 |
2.3560 |
2.2499 |
2.3677 |
1.8654 |
| 8 | 0.02 |
2.5050 |
2.2166 |
2.5492 |
1.8645 |
| 8 | 0.04 |
2.3323 |
2.1276 |
2.3940 |
1.8564 |
| 8 | 0.08 |
2.4062 |
2.2080 |
2.1916 |
1.8552 |
The exact categorical KL mean declines from 1.8282 → 1.7890 for G=4 and 1.8654 → 1.8552 for G=8 as $\beta$ moves from 0 to 0.08. Sampled k3 estimates fluctuate by seed and are not monotone at every beta. The raw KL CSV supplies each row's reward mean and bootstrap interval, k3 interval, and flat-group fraction.
Verifier outcomes (rlvr_reward_gaming_audit.csv)¶
| Task verifier | Valid controls passed | Adversaries accepted / tested | Accepted adversarial case IDs |
|---|---|---|---|
strict_json_schema |
1/1 |
0/3 |
— |
math_symbolic_exact |
1/1 |
4/5 |
math_length_inflation, math_duplicate_reasoning, math_contradictory_reasoning, math_empty_tool_echo |
python_unit_eval |
1/1 |
1/1 |
python_test_case_memorization |
| Total | 3/3 |
5/9 |
One Result That Contradicted Expectation¶
The verifier suite correctly rejected strict-JSON schema padding, a duplicate key, a wrongly typed value, and a wrong final math answer. Yet five adversarial completions still earned exact pass and reward 1.0. Four carried a correct final \boxed{42} while padding, duplicating, contradicting, or emptying the reasoning trace; the fifth returned correct results only for the three visible Python unit cases by memorizing their input lengths. Exact final-answer equivalence and finite visible tests verified the final artifact, but did not verify the reasoning or general behavior. These are reward-gaming leaks, not evidence of robust reasoning.
One-Command Reproduction¶
From a grpo-16gb checkout with its package dependencies installed:
The command regenerates grpo_audit_summary.json and the VRAM, KL, and reward-gaming CSVs. The repository README also documents the installed grpo-16gb audit --out-dir benchmarks command.
What I'd Distrust in This Experiment¶
- Analytical VRAM is not live GPU VRAM. The sweep assumes fixed model profiles and CUDA overhead; allocator fragmentation, version-specific logits buffers, and other runtime peaks can shift the actual ceiling. A claim that
14Bor27Btrains on either card needs measuredtorch.cuda.max_memory_allocated()andnvidia-smitraces from that hardware. - CPU three-arm KL stability is not LLM training stability. The
24/24finite result validates the toy simulation's numerical behavior, not policy behavior for a transformer, live GPU throughput, or a held-out pass@1 lift. The sampled k3 means are visibly noisy across seeds. - The reward audit is a fixed set of 12 probes. Its
5/9acceptance rate is an observed failure count for these crafted adversaries, not an estimated population failure rate. Hidden Python tests, trace consistency checks, and broader attacks are needed before trusting rewards for training. - The estimator's fit margin can be thin.
14B/G=4at2,048tokens has only1.73 GBestimated 5080 headroom; a nominal analytical fit is not a guarantee that a training run will avoid OOM.