Learning to Post-Train
Introduction
This is a running log of small-scale experiments to train a model that watches a live RL post-training run, spots what is going wrong, and changes the run so it ends with a higher held-out score than the same run left alone.
The model I am using is Inkling 2 Mini [1]. The runs it watches are also RL runs of Inkling 2 Mini, trained with LoRA in miles [2] on a single B200 GPU. So the model watches runs of itself, and only the supervisor’s weights carry across episodes; each inner LoRA is thrown away when its run ends.
The setup builds on AutoRL [3], where frozen API models (gpt-6.1-sol and glm-5.2) supervise RL runs without being updated. Existing papers that do train a post-training agent either use supervised fine-tuning on collected traces (RSI-Dojo [4]) or optimize one-shot job configs before a run starts. Here the outer supervisor is itself trained with RL on mid-run decisions, and tested on tasks it never supervised.

One change since the first sketch in Figure 1: instead of running the offline warm-up stage first, I now train on live supervision runs first (Figure 1, a-ii) and keep the offline warm-up (Figure 1, a-i) as an ablation. If supervision alone cannot move held-out performance on a single run family, offline warm-up will hide why.
Finding an inner run that fits a small budget
Cost sets almost every design choice here. Every time the supervisor acts at step \(t\), we run two copies of the inner training job for \(H\) steps—one with the change, one without—and evaluate both on held-out items. If one inner step costs $2.00, a single 5-step fork costs $20, and a hundred outer decisions cost $2,000.
For outer-loop RL to be affordable on one GPU, the inner task needs three properties at the same time:
- Cheap, fast steps (
~$0.20per step, no per-episode container build or spin-up delay). - Headroom without broken graders: base Inkling 2 Mini has to start well below the ceiling (
~30–65%against a90%frontier score), and missed questions need to be real model mistakes rather than buggy unit tests. - Fixable flaws in the default recipe that show up in the logs and rollout dumps.
Getting all three took several false starts.
What we measured across candidate inner tasks
All numbers below were measured in miles on our own B200 GPU (no external inference API):
| Candidate inner set | Base Mini start | Cost of 1 step (4×4) |
Cost of 1 fork (\(H=5\) + eval) | What happened |
|---|---|---|---|---|
BIRD-Platinum (miles text_to_sql val, 398 items) |
72.1% (8K, with hints)76.6% (16K, hints withheld) |
~$0.21 |
~$2.10 |
Too easy as a held-out test; keep its 69-database training split as our training pool |
R2E-Gym (tasks an external Qwen3-32B solved 1 of 4) |
68% (41 / 60) |
~$1.70–$2.50 |
~$15–$22 |
Difficulty labels from other models did not carry over; Mini is stronger on Python repos |
SWE-rebench V2.1 hard band (Qwen3-Coder-480B \(\le 0.5\)) |
82% (49 / 60) |
~$1.70–$2.50 |
~$15–$22 |
Still far above the target band |
R2E-Gym multi-file screen \(\to\) 30 tasks Mini failed |
46% (36 / 78) screen19% (11 / 59) confirm |
~$2.40 |
~$18–$22 |
Half of the 30 failed tasks (15 / 30) had broken hidden tests; ~10× too costly per fork |
BIRD mini-dev 2026 (SQLite, 500 items, 11 dev DBs) [5] |
60.0–64.0% on 200-item reward split (41.9% on 4 hardest DBs in Gate 1 dump) |
~$0.21 (~82.5 s) |
~$1.65 (~11 min) |
Chosen inner benchmark: 90.0% frontier ceiling, 0 broken tests, $0 sandbox cost, 0 DB overlap with train |
Two lessons stood out from the software-engineering (R2E-Gym and SWE-rebench) runs:
- Other models’ failure rates are a poor difficulty filter. Subsets picked because
Qwen3-32BorQwen3-Coder-480Bstruggled on them landed at68–82%for base Inkling 2 Mini. - Filtering by your own model’s failures selects for broken tests. When we screened 78 multi-file
R2E-Gymtasks and took 30 that Mini failed, reading all 49 failed trajectories showed that 15 of the 30 tasks were unsolvable from the prompt: hidden tests asserted exact unstated error strings, required undocumented flags, or contradicted the issue text (on onenumpytask, the prompt said an example call must run “without any errors” while the hidden test assertedValueError). On the 15 fair tasks, Mini solved11 / 29(38%). Combined with$0.11–$0.16per containerized attempt, SWE tasks were the wrong inner loop for tight-budget outer RL.
Three engineering traps in the SQL inner loop
Returning to multi-turn SQLite (examples/text_to_sql in miles, where the model runs exploratory SELECT queries against real databases before submitting a final <solution> query) kept episodes in-process on the GPU box at $0 sandbox cost. Before the inner loop could actually learn or fork, we had to fix three concrete bugs:
bfloat16weight merging rounded away 93% of LoRA updates. Our first 20-step SQL run barely moved (72.1% → 73.1%). Forensics on the weight sync showed why:milessynced LoRA to SGLang by merginglr = 5e-5updates (~1e-5in size) intobfloat16base weights, whose spacing near typical weight magnitudes (|W| ≈ 0.02) is~1.2e-4. At the second sync,93.3%of merged elements rounded back to the exact base weight. Switching to native LoRA adapter serving in SGLang (PR #53710) on top of the NVFP4 base model fixed this: only the434adapter tensors copy over CUDA IPC each step (~0.5–1.1 s, checked by SHA-256), peak memory on one B200 sits at113–134 GiB(leaving45–66 GiBfree), and fixing an expert-weight naming mismatch (w1/w2/w3vs.gate_proj/up_proj/down_proj) lets saved LoRA checkpoints reload cleanly for branching.- Unbounded SQLite joins hung worker threads. During a 1,000-question pass-rate screen, throughput collapsed from
1.3 sper episode to17.5 sper episode at 73% completion as background threads got stuck inside accidental Cartesian joins until the 75-minute job timeout killed the run ($10.52wasted, nothing saved). Adding a 3-second thread-localsqlite3progress-handler deadline aborts runaway model tool queries without affecting reference grading. A 200-question multi-turn evaluation now finishes in3.9 minuteswith zero hangs. - Why the naive 20-step baseline still stalled (
64.0% → 55.0% → 59.5%)—and why that helps supervision. We filteredBIRD-Platinum(hints withheld,≤ 4,096prompt tokens) to702multi-join + subquery/CTE training questions and ran a clean 20-step4×4baseline (45.3 min,~$7on one B200, saving checkpoints at steps5, 10, 15, 20). Accuracy stayed flat for four reasons that are plain to read in the rollout dumps:- Zero-gradient steps (
12 / 20steps hadgrad_norm = 0.0000): at4prompts ×4samples, 60% of steps landed on four4/4or0/4groups simultaneously, leaving only 8 real updates in the whole run. - Full-parameter learning rate on LoRA: the recipe’s
5e-5cosine schedule (decaying to5e-6, sized for 300-step full-weight runs) starved rank-16 LoRA updates by roughly 10×; 5 of the 8 non-zero updates fired after LR had already decayed below1.3e-5. - Per-turn token cap and premature stops (
40%of missed evals): across the89missed questions in our Gate 1 post-step-0 eval dump (111 / 200solved),53opened<solution>(50complete queries with genuine SQL mistakes such asLEFT JOINvs.INNER JOIN, missingCAST(col AS REAL)on text columns, orCOUNT(DISTINCT CASE ...), plus3cut mid-SQL at2,048tokens), while36never opened a<solution>tag at all—either hitting the2,048-token per-turn cap inside<|content_thinking|>/ verification text or stopping on Turn 1 after writing"I'll inspect the relevant tables..."with zero tool calls (which the episode runner immediately grades as-1.0). - Few-shot prompt bleed: the shipped prompt uses a Qwen XML worked example about farm animals, causing Mini to open answers on Magic: The Gathering card databases with
"Verification of external knowledge (\"pig is represented by species = 'pig'.\"): not applicable...".
- Zero-gradient steps (
Fixing the obvious LoRA LR (3e-4 constant), turn budget (5 tool turns, 3,072 tokens/turn, 16K context), and batch size (8×4) gets the baseline moving, while leaving data filtering, prompt cleanup, reasoning effort, and reward shaping for the supervisor to adjust mid-run.
How supervision works
Three-way held-out split
To keep the outer loop honest, the 500 SQLite questions in BIRD mini-dev 2026 (none of whose 11 databases appear in the 69 BIRD-Platinum training databases) are split once with a fixed seed, stratified by database and difficulty:
| Split | Questions | Role |
|---|---|---|
reward.jsonl |
200 | Scores the branch and the twin to compute the supervisor’s counterfactual reward |
selection.jsonl |
100 | Picks supervisor checkpoints and hyperparameters |
test.jsonl |
200 | Untouched until the final three-arm comparison |
What the supervisor reads and changes
At a step boundary—right after a weight sync and before the next rollout batch—the inner run pauses at a saved checkpoint \(m_t\). The supervisor inspects the run state and picks an action (including "do nothing"):
| Interface | Details |
|---|---|
| Reads | Per-step training metrics (reward, zero-gradient share, grad_norm, KL, entropy, truncation rate, step time); sampled rollout trajectories and tool errors; held-out scores at earlier checkpoints; current run config and prompt; its own past actions in this run and remaining action budget \(B\) |
| Changes training config / code | Learning rate and schedule, batch/group size, clipping, KL/process penalties, loss/advantage settings in miles |
| Changes episode harness | System and few-shot prompt, tool formatting, reasoning_effort, per-turn token cap, max SQL tool turns |
| Changes training data | Filtering or reweighting the prompt pool (for example, dropping 4/4 solved schemas or prioritizing multi-join failures) |
Three levels of transfer testing
Once trained on SQL supervision episodes, the supervisor’s weights are frozen and tested at three distances from training, each comparing no supervisor, untrained supervisor, and trained supervisor:
| Level | Inner run | Question answered |
|---|---|---|
| 1. Same task, new seeds | Text-to-SQL in miles, scored on untouched test.jsonl (200 items) |
Did outer RL improve supervision on the training environment at all? |
| 2. New task, same library | Math with Python tool (examples/retool_v2 in miles) and procedural SQL (ledger) |
Does supervision carry to a task and grader it never saw? (Main result) |
| 3. New task, new library | Multi-file RL in TRL from FrontierRSI [7], plus long runs (PostTrainBench [8], Olmo-3-7B RL [9]) | Does the skill carry outside miles and to multi-hour runs? |
Offline warm-up (ablation): Predict, Read, Build
Can offline tasks teach a model the sub-skills of supervising RL runs—forecasting curves, diagnosing faults, and editing training code—for pennies before it ever touches a live GPU run? To test that cleanly as an ablation, we built a verified offline pool (126 Harbor tasks in configs/pool_v1.jsonl, plus Tea Leaves and RFT-FaultBench) organized around three skills:
| Skill | The question | What the model hands in | How the grader checks it | Datasets |
|---|---|---|---|---|
| Predict | Where is this training run headed? | A curve forecast, final score, or pairwise winner | Against the recorded run log (CPU, 1 model call) | Tea Leaves [10] |
| Read | What broke in this RL run, and how do you fix it? | A structured diagnosis, or one patch to the run | Against the known root cause, or by rerunning training | AutoRLBench [11], RFT-FaultBench [12] |
| Build | Can you write code that improves training? | A loss, estimator, or ML-library patch | Hidden unit tests, or training on held-out tasks | HF_ML_Tasksmith [13], AutoResearchExam [14], DiscoGen [15] |
Each dataset in the pool was timed on a sample of tasks with Inkling 2 Mini under a 128-turn cap so slow verifiers do not bottleneck RL:
| Dataset | Pool tasks (train / sel / test) |
Median Mini attempt time | Time limit |
|---|---|---|---|
| RFT-FaultBench | 146 (unsplit) |
3.3 min |
30 min |
| AutoRLBench, diagnosis | 50 (35 / 5 / 10) |
4.4 min |
30 min |
| AutoRLBench, repair (CPU) | 3 (3 / 0 / 0, +5 GPU prepared for test) |
7.0 min |
30 min |
| HF_ML_Tasksmith | 36 (25 / 4 / 7) |
7.3 min |
30 min |
| DiscoGen (A10G GPU) | 20 (14 / 3 / 3) |
18.3 min |
30 min |
| AutoResearchExam (CPU) | 17 (12 / 2 / 3) |
29.2 min (at 30m cap) |
60 min |
Benchmarks with multi-hour budgets—Scale RSI Bench [16] (1.5–12 h), AgenticRL-Bench [17] (shipped 8 h; Mini spent a median of 17 min across 9 attempts and scored 0 on all 9), and PostTrainBench (10 h on an H100)—stay evaluation-only.
Three offline tasks up close
Predict, from Tea Leaves (paper, data, 918 train / 682 test runs including 150 RL runs). Given the first 20% of a training curve along with its config and code, predict the rest of the trajectory. As the Tea Leaves authors put it, understanding a training change has three levels: describing it, implementing it, and anticipating what it will do to a run. Supervision leans heavily on the third.
Read, from RFT-FaultBench (paper, data). Given per-step logs (reward, KL, entropy, response length, and sampled generations) from either a healthy RL run or one with an injected bug, return a structured diagnosis:
{"status": "anomalous", "fault_family": "credit_assignment", "fault_type": "advantage_instability",
"evidence": "what in the logs shows it"}Build, from DiscoGen (paper, repo). Given a working PPO trainer where only loss.py is editable, run short training experiments on two environments, then hand in loss.py to be graded on two unseen environments (82–96% of wall time is spent inside training commands).
How untrained Inkling 2 Mini did on the offline tasks
Running base Inkling 2 Mini across samples of the offline pool showed clear room to learn:
- False alarms on healthy runs: on RFT-FaultBench it flagged all four healthy runs as broken (mean score
0.42). - Diagnosis is much easier than repair: on AutoRLBench diagnosis (
20attempts on5tasks) rewards spanned0.09to1.0, whereas on AutoRLBench repair it fixed only1run in12tries. - Module edits rarely cleared noise: on DiscoGen (
6attempts across3loss/optimizer tasks),3of6attempts degraded the baseline and only1cleared the 1-sigma margin above it (reward0.066under the clipped scale;5of6scored0). - Easy library PRs saturate quickly: on HF_ML_Tasksmith,
15of20sampled attempts hit1.0.
Current status and next steps
| Piece | Status |
|---|---|
miles + SGLang NVFP4 LoRA adapter serving & checkpoint reload on 1× B200 |
Done (434 / 434 tensors SHA-256 verified in ~0.5–1.1 s syncs; ckpt/ saves every 5 steps) |
Inner dataset & 3-way split (BIRD-Platinum hard train \(\to\) BIRD mini-dev 2026 200 / 100 / 200) |
Done (0 DB overlap, 3 s SQLite timeout, 3.9 min per 200-item eval) |
First 20-step baseline (lr = 5e-5 cosine, 4×4, 2,048 tok/turn) |
Done (45.3 min, ~$7; exposed zero-grad steps, under-scaled LoRA LR, and 2,048 turn-cap cutoffs) |
Updated 20-step inner baseline (lr = 3e-4 constant, 8×4, 5 turns, 3,072 tok/turn, 16K ctx) |
Running now on 1× B200 |
Step-boundary fork plumbing + shared-seed A/A noise test (PLAN.md Steps 2–3) |
Next |
Untrained vs. RL-trained supervisor on SQL, then transfer to retool_v2 / ledger |
Upcoming |
Appendix: every dataset we screened
We reviewed roughly 180 datasets and benchmarks—many from papers and dataset cards, and the serious candidates file by file.
Used for inner RL or transfer tests
- BIRD mini-dev 2026 (3-way held-out SQL benchmark),
BIRD-Platinum/ ReViSQL (milestext_to_sqltraining pool),milesretool_v2(math with Python tool), proceduralledgerSQL tasks, UltraTerminals (candidate Harbor transfer slices after per-task license/canary filtering)
Kept for the offline warm-up ablation
Evaluation only: owner do-not-train markers or canaries
- RSI Bench, AgenticRL-Bench, AutoLab, Accelerate Bench, HPCAgent-Bench, MLGym-Bench, cpu2gpu, leakbench, Auditing Sabotage Bench, FrontierCS 2, Terminal-Bench
Evaluation only: multi-hour runs
Outside our domain
Score can be forged, or answers leak into the workspace
Incomplete or broken task definitions
Too slow or costly per attempt for outer-loop RL
- R2E-Gym (also 50% broken tests on failure-filtered multi-file slice), SWE-rebench, frontier-ml, AI4AI-Bench, ProgramGym, TerminalHorizon, SWE-fficiency
Too heavy to download or hand-build environments for
Duplicates, supervised-only, or general SWE/terminal pools
- Finch Collection, RSIGym (SFT LoRA, not RL), MiMo, SETA, TMax, smol-software-harbor, and ~15 others