Explore the research collection
14 entries · Follow this search
- Post
RL Fine-Tuning from Scratch: Build the Environment, Train with GRPO
Deep-ML's new hands-on Project (24 steps, tagged Hard / Reinforcement Learning / PyTorch) builds the entire RLVR pipeline from scratch in PyTorch: a Countdown-style arithmetic RL environment (three numbers, a target, postfix expression using each number exactly once), a reward verifier, tokenization, a causal transformer policy, SFT warm-start, then the three GRPO components — group-relative advantages, the clipped policy-gradient objective, and the k3 KL estimator. Includes a reward-hacking experiment (watching the policy exploit a lenient verifier) and training-loop diagnostics. No paper, no code repo — the platform's format is atomized coding problems solved in-browser on their compute, "no library call standing in for the thing you are trying to learn."
- Post
SGD, AdamW, and the mystery of α = 2
Charles Martin (WeightWatcher author) offers an explanation for why WeightWatcher's spectral renormalization-group diagnostics behave differently under SGD and AdamW: layer spectral exponents α often approach the ≈2 marginal regime with SGD, but with AdamW many layers land at α < 2 — the regime he flags as possible overtraining. The paradox: in his LeNet-5-on-MNIST example, the AdamW run (α < 2) has better test accuracy than the SGD run (α ≈ 2). His answer: SGD is scale-invariant — for an idealized scale-invariant loss, rescaling weights W → bW, WᵀW → b²X and learning rate η → b²η yields a rescaled copy of the same trajectory, and this symmetry underlies the RG-flow emergence and Exact RG fixed-point conditions — whereas AdamW's adaptive normalization changes the scaling law (learning rate scales as b rather than b² in the idealized limit), breaking the SGD scaling symmetry and shifting the spectral trace-log drift. Working hypothesis: SGD scale-invariance is consistent with the RG flow, while AdamW's implicit bias moves learning away from the α ≈ 2 regime — which explains why WeightWatcher worked well in the pre-AdamW era and why modern-optimizer models are harder to analyze. A standing research question, not a publication; discussion invited on the WeightWatcher Discord.
- Post
How to make a good RL task
Practitioner essay on designing RL tasks for agents. A task is four components — Prompt (the request), World (the data and dynamics of the environment), Verifier (the deterministic or model-based definition of "good"), and Intent (the explicit capability or failure mode being targeted) — and task generation is constraint satisfaction across their alignment axes. Prompt↔Verifier: the prompt must contain enough signal for a capable model to satisfy the verifier. Verifier↔Intent: the verifier is the sole source of optimization pressure, so any gap is reward hacking (buggy code passing tests; escaping the sandbox to hack Hugging Face for answers). Prompt↔Intent: prompts must stay distributionally aligned with production traffic. Worlds span real (uncorrupted repo) to fully synthetic (cloned travel sites); a world is sufficient iff it reliably elicits the target failure mode. Making good tasks means building revision loops that calibrate prompt, verifier, and world against intent: author → eval → audit traces → loop back to author or discard, with a verifier-calibration loop mapping edge cases against ground truth. A worked SWE pipeline uses solver agents, a verifier agent writing the grader, hacker agents seeking undesirable-but-passing solutions, and a review agent. Naively hardening tasks is warned against — it targets contrived axes. On the verifiability spectrum, most interesting work is semi-verifiable, and human experts are the ultimate verifiers. Task factories are the outer loop: distilling expert judgment into the generation pipeline so it yields better tasks at progressively lower cost — e.g. an investment banker flags unrealistic prompts, the recipe is updated, and expensive human gates compile down to agent proxies and eventually cheap classifiers like Jev. Cites the recent OpenAI/Hugging Face attack as the catastrophic end of verifier–intent misalignment.
- Post
Impactful scheduling for GPU clusters
Ai2's AI Infrastructure team replaced their priority-based GPU scheduler with a budget-based system: GPU time budgets allocated hierarchically by managers (lead researcher / PI / lead program manager / CEO), a hierarchical fair-share scheduler tracking occupancy over a 7-day sliding lookback window (lineage: Hadoop Fair Scheduler, SLURM Fair Tree, YARN Fair Scheduler), and a 'scheduling contract' time-slicing mechanism. The contract: every workload declares a minimum runtime (protected from preemption, charged to its budget, max 8 hours) or sets it to zero (unallocated, always preemptible but free). Allocated occupancy draws from the owner's budget and is protected during minimum runtime; unallocated occupancy keeps GPUs full when allocations don't match demand and can be preempted by any allocated request. This killed three pathologies of the old system: GPU 'squatting' (no-op workloads parked for later), priority inflation (100% of jobs at HIGH priority), and on-call toil negotiating shutdowns of non-preemptible jobs on failing hosts. Rollout results (30-day test period, cluster-by-cluster from end of July): teams received 98% of owed GPU hours (13 of 15 teams got 95%+, worst case 90%); occupancy held at 98% with 2-3x demand over capacity; median queue wait on the largest H100 cluster fell from 5 minutes to 24 seconds, p90 from 2.8 hours to 1.8 hours; debug-workload p90 wait fell from 2 hours to 30 seconds; repairs requiring a human-in-the-loop fell 74% via automatic draining of unhealthy hosts at minimum-runtime boundaries. Challenges recorded: interactive dev sessions now face an 8-hour protected-runtime cap (preemption wipes volatile state), so Ai2 is investing in a CPU-only cluster for data-prep sessions and restorable sessions; possible capacity fragmentation for the largest workloads is under investigation with the simulator. One user quote: the new system 'makes it feel like we have an extra 30% compute' via bursting beyond allocation limits when others underuse their share.
- Post
Improving Qwen3.8-27B-Medium on DeepSWE with GRPO: 500-task SWE agent dataset experiment (AfterQuery)
AfterQuery's internal post-training team trained Qwen3.8-27B (medium reasoning) with GRPO on 500 tasks from their SWE agent training dataset and reports DeepSWE pass@1 (avg of 3 attempts) rising from 27.8% to 39.1% (+11.3 points) over 15 GRPO updates. The dataset spans 10,000+ tasks authored by experienced software engineers and open-source contributors with expert review, built from real workflows in private enterprise codebases to avoid evaluation contamination; the 500-task subset was chosen in a 'learnable distribution' across 422 repos (Python 39.4%, TypeScript 24.2%, Go 20.4%, Rust 13.8%, JavaScript 2.2%) with 80.4% feature requests, 11.6% bug fixes, 8.0% enhancements. Training: 8 attempts per task, GRPO updating all LM parameters on each attempt's reward relative to the group, medium reasoning to speed rollouts; mean shaped reward rose 0.570 to 0.856 over 15 updates (each update a new batch of tasks), entropy held 0.509-0.605 nats/token with no sustained decline. Same-harness evals (mini-swe-agent, medium reasoning): DeepSWE pass@3 51.3%->68.1%; Terminal-Bench 2.1 pass@1 57.30%->61.42%, pass@3 73.03%->75.28%; SWE-Bench-Pro (Hard) pass@1 61.44%->64.71%, pass@6 flat at 88.24%.
- Post
Post-training infrastructure at Proximal
Proximal's engineering post on their internal post-training stack for agentic RL. Training and inference run on Modal GPUs (an internal fork of Miles, the OSS RL framework based on Slime); rollouts run in gVisor/microVM sandboxes on their own Kubernetes cluster, coordinated via a lightweight command daemon (pxd). Key design choices: async training where each rollout keeps the adapter it started on while new groups start on the newest published weights (rollouts >3 versions stale are never trained on; 128 finished groups per step; mean staleness 1.7 at 4:1 inference-to-trainer ratio); inference capture moved inside the replica after cross-region (Sweden vs US West) network waits cost minutes per rollout; single-replica on-demand GPU containers instead of 8-GPU nodes, growing inference 3:1 to 4:1 mid-run; a custom KV-cache-headroom router hitting 99.6% cache hit rate; fault tolerance via a durable rollout store on Modal Volumes (a run survived losing 40% of inference capacity mid-step, fully recovering in 19 minutes); LoRA weight sync over HTTPS sharded across ranks (delta sync tried, not worth it for small adapters); custom attention recomputation keeping only FlashAttention outputs + log-sum-exp, cutting step time 7.3% at long context. Sandbox fleet: tasks declare 1-8 vCPUs (mean 2.3); pods request 25% CPU / 40% memory of hard limits, packing 26 sandboxes per 16-vCPU node; image-aware scheduling raised cache hits 1% to 37% (2s cold starts); zstd over gzip sped image unpack 15-25%; their sandboxes beat a SOTA provider ~5x median / 7x+ p90 on command latency. Case study: Qwen3.8-27B with rank-32 LoRA, 128 envs/step, group size 8, vanilla GRPO on internal agentic coding tasks — DeepSWE pass@1 37.2% (+8.4 over base in 44 steps), pass@8 67.7% to 86.6%; gains survive dropping tasks flagged flawed by Epoch AI/Scrim/internal review. Built on OSS Miles and SGLang, with contributions back upstream (SGLang #43047, Miles #3977).
- Post
Cutting Pretraining Costs by 62% — Hyperstition (ANVIL III optimizer)
ANVIL III is a Muon-family optimizer presented as the biggest optimizer breakthrough since Muon (2024). It beats a fully tuned Muon by 20-28 millinats of final validation loss at matched token budget, holding across 124M, 350M, 774M and 1.2B parameters and across overtraining depths; the gap typically grows from 30% to 80% of training (up to ~50 mnat in some configs), with Muon partially catching up during annealing. At a fixed 8x-Chinchilla budget, fitted scaling curves imply optimizer-only compute savings of 32%/39%/39%/50% at the four sizes; combined with an architecture variant (≈25% near-Chinchilla compute saving) the headline is ~62% less pretraining compute at frontier scale, plus ~30% lower inference cost from faster decode. Mechanistically, an 'Adam SNR' probe (descent inequality = Gini of |u_i^T G v_i| over singular directions, scored on held-out batches) shows ANVIL III's update directions have persistently higher signal-to-noise across the whole singular spectrum; 90% of its singular directions go downhill on held-out data vs 67% for Muon (random = 50%), and it is far less sensitive to truncating the weakest singular vectors (removing weakest 20%: Muon +6.9 mnat, ANVIL III +1.8 mnat). The team also released Feather 1.7B (1.68B params, 200B training tokens), which beats Qwen3-1.7B-Base (~36T tokens) on math with ~180x fewer training tokens (MATH500 63.0 vs 53.0; GSM8K 83.4 vs 76.6; GSM8K Platinum 85.7 vs 74.4; GSM-Symbolic main 81.1 vs 62.7), with three rounds of benchmark decontamination documented. A deprecated ANVIL II set the public NanoGPT speedrun record (73.889s -> 39.914s, 1.851x speedup, 46.0% training-time reduction — a larger percentage leap than the previous 45 records combined) and is public as part of the submission; no license stated for the code.
- Post
E2S Finetuning: From Expert Demonstrations to On-Policy Learning
E2S (Expert-to-Student) Finetuning turns off-policy expert demonstrations into more on-policy SFT data via amortized sampling. The formulation is constrained generation: the expert trace defines the validity constraint C_tau (e.g., semantically equivalent responses, correct outcomes on math), while the student model decides the relative probabilities of valid responses. Among normalized distributions supported on the valid set, the closest to the student under KL is the student distribution conditioned on validity: q*(y) = p(y)*1[y in C_tau]/Z_tau. While Finetuning with Sampling (arXiv 2610.02140) reaches this target with per-example MCMC search, E2S amortizes the search by training a conditional sampler across examples with GFlowNets: trajectory balance with a shared offset z_tau becomes a group-relative loss (no normalizer network) that matches the accepted-output distribution. Implementation uses LoRA adapters on the student backbone as the sampler (expert trace conditions the sampler; student scoring and SFT use only the original prompt). Two variants: E2S-Offline (fit sampler once against the fixed student, generate a dataset, then SFT) and E2S-Online (refit the sampler against the current student after each update). In the Finetuning-with-Sampling math setting (Qwen2.5-3B, MATH levels 3-5, 8,230 training problems), Math avg. / Prior avg.: base 31.8/42.2, expert SFT 24.2/38.9, GRPO 45.7/41.4, MCMC+SFT 53.4/42.0, E2S-Offline 55.5/42.1 (+3.9% relative vs MCMC+SFT), E2S-Online 59.4/42.2 (+11.2% relative vs MCMC+SFT, +6.0 points vs MCMC+SFT, +35.2 points vs vanilla expert SFT, while matching the base on prior tasks). Drawing 1/2/4 responses per expert example lifts offline Math avg. 55.0 -> 56.3 -> 57.2. Diversity is a property of the target distribution (preserving relative mass across valid reasoning modes), not an extra bonus term.
- Post
The Unreasonable Efficiency of a Single Gradient Step (Base Labs)
Tests whether recent claims about rank-1/linear extrapolation of early RL updates (RELEX, arXiv 2605.21468; arXiv 2601.04537; arXiv 2510.00553) really hold, and finds them less general than claimed. Replication: training Qwen2.5-Math-1.5B with GRPO for 500 steps on MATH, extrapolating the first k steps via a fitted rank-1 direction recovers the full 500-step gains (66.0% with just the first 2 steps vs 63.8% actual step 500, base 46.9%); scaling the very first gradient step 1000x yields 66.7%. But: 72.0% of the corrected questions were base rollouts showing heavy repetition — RL fixed them mostly by stopping the model from doom-looping ('You are a helpful assistant. 🎉' repeated forever), i.e. exploiting linear structure is largely about removing easy failure modes, not gaining new capabilities. Off-distribution it breaks: first-step scaling does nothing for function calling or Knights & Knaves. Gains vanish at scale: on Qwen3-8B-Base the RELEX fit degrades vs actual training (RELEX-K 7.6% vs actual 97.0% on Knights & Knaves at K=500). Takeaway: RL trajectories being 'basically straight' is too good to be true; the extrapolation gains come from easier problems and fixing doom loops, while harder environments are less linearly extrapolatable. The team believes extractable structure still exists in general RL optimization dynamics and is continuing this direction. Code and checkpoints released in the article; practical lesson: always inspect rollouts, not just metrics. Relevant to the user's post-training work: a 'free lunch' check on recent RL-efficiency results.
- Post
The Anatomy of an Agent Harness
Synthesis of how Anthropic, OpenAI, LangChain, and Perplexity actually structure production agents - identifying 12 production-grade harness components (cited as the canonical reference by projects like Mnemosyne, which audits itself row-by-row against it). Framed the field's three-phase trajectory: competing on model weights, then context engineering, then harness engineering - each stage widening what the practitioner is responsible for shaping. LangChain's Vivek Trivedy formalized the companion distinction: 'If you're not the model, you're the harness.' The harness is the runtime shipped as a product (loop engine, tool registry with schemas/permissions/errors, state/memory persistence, control loop, verification layer, recovery policy, budget manager); you configure it, you don't construct it.
- Post
The most underrated part of Jev as a judge
Deep evaluation of Jev (TypeSafe AI's System One model — reads natural language but returns per-label probabilities instead of text) as an LLM judge. Ran five LLMs and two Jev configurations over 10 human-labeled Phoenix evaluator benchmarks, 10 runs each (36,190 judgments). Findings: Jev matched LLM judges at 98.3% accuracy (statistically tied) while costing 12–290x less ($0.06 vs $17.08 per 1,000 judgments for Claude Opus 5) and running 13–55x faster (133 ms vs 4.0 s median). The underrated part: Jev's probability is a strong self-uncertainty signal — all 3,561 predictions at ≥99% confidence were correct; its probability flagged its own errors (ROC AUC 0.95 drop-in / 0.99 native) far better than repeated LLM calls (0.62–0.84); and Jev entropy predicted where LLMs themselves waver (ROC AUC 0.85), giving a principled router for human review. Directly relevant to the user's Model Axes eval platform and the catalog's System One/JEV cluster (1363, 1434, 1541, 1542).
- Post
We built a 20x faster Grok bot (Cerebras agent speed write-up)
Cerebras X Article (2026-09-25) by @milkandmatcha and @0xSero: engineering write-up of a dinner-reservation personal-assistant demo using Qwen 3.8 27B on Cerebras with the Pi agent harness. Recorded same-request runs: Meta Muse ~4m36s, Claude Cowork ~6m25s (57 tool calls), Grok Bot ~7m40s; their optimized agent median ~22s (~19×; title says 20×). Claimed levers: (1) parallel independent restaurant availability checks, (2) faster Cerebras inference between tool steps, (3) pre-baked website-navigation skill reducing tool calls >80% (live availability/prices still checked). Explicit caveats: not a general ranking; skill discovery happens before the timed run; bundles model+harness+path. Mentions CompactionRL (arXiv 2607.05378). No new model weights.
- Post
How to Build Agentic Harness using Jev (Builder's Guide) — Avid / @Av1dlive
2026-09-23 X Article by Avid (@Av1dlive): builder's walkthrough of putting TypeSafe Jev (and local Laya) as a narrow, host-checked decision layer inside a coding harness. Concrete build is keel 0.2.0 (github.com/codejunkie99/keel; Rust/GPUI macOS app): host prepares eligible provider/model or tool-focus options → selector returns typed id or abstains → host re-validates before apply and writes decision receipts. Covers route selection for fresh unpinned tasks, DeepSeek-loop focus bundles (inspect/implement/verify/answer), ACP boundary (provider-owned loops), and an evaluation framing for 'self-improvement' without auto-training. NOT about agentic-stack (author's separate ~2.3k★ portable .agent/ memory layer).
- Post
How to train your own Jev for $17 (Together Tev1 tutorial)
2026-09-23 Together blog (also posted as X Article by @nutlope) walks through training a Jev-like classifier: clone github.com/togethercomputer/tev1, sample/normalize ~37,840–38,340 classification examples from MultiNLI, BoolQ, Banking77, AG News, SST-5, programmatic policies (~13.5k), routing (~6k), and research taxonomy (~3.8k), LoRA SFT Qwen/Qwen3.5-4B via Together Fine-tuning (~25 min, ~$17), deploy a dedicated endpoint, and query with state/question/options JSON returning a single option letter. Serverless reference model: together/Tev1-4B-experimental (HF togethercomputer/Tev1-4B-experimental). Explicitly autoregressive LM-head SFT — not a non-autoregressive Jev runtime. Dev eval cited on card: 880/1000 main decisions, 300/300 policy-transfer, 1300/1300 valid letters.