2026-12-06
2026-12-06 ~ 2026-12-06
TL;DR
- The Paradox: Switching a 7B masked diffusion LM (
Dream-v0-Instruct-7B,lr = 5e-7,verlFSDP2) frombf16tofp32master weights boosted MATH500 and GSM8K across every length—and immediately drove Countdown straight to 0.00%.bf16mantissa swamping had been acting as an accidental step-size damper; once weights could actually move, every latent bug in our RL stack woke up at once.- Layer 1 — The Format-Bonus Amplifier (length 128): Sweeping
lr,entropy_coeff, cosine schedules, and rollouttemperature(0.2 → 0.8) pushed peak accuracy to 42.58% and cured zero-grad deadlocks—yet still washed accuracy back to 0.00% withgrad_norm = 16.95. Under GRPO std-normalization, Countdown’s tinyformat_score = 0.1turns an all-wrong group of 8 rollouts ($s \approx 0.035$) into $\pm 2.47$ advantages—matching the gradient strength of solving the arithmetic. Switching to a pure binary $\lbrace 0, 1 \rbrace$ reward fixed length 128 out of the box (46.09% peak, zero collapses).- Layer 2 — Sequence-Length Systems Bugs (lengths 256 & 512): Scaling that exact binary-reward recipe to 256 and 512 tokens collapsed again. Inside the D1 actor loop,
data = {**data, ...}shadowed aTensorDictinto a Pythondict, turninglen(data) / ppo_mini_batch_sizeinto $10 / 16$ per micro-batch—a 2× / 3× gradient multiplier once sequences crossed 5,120 tokens per GPU. Combined with AdamW drift across 63–82% zero-gradient steps (and an FSDP2DTensornorm-sync trap), long runs slowly destabilized.- The Proof & The Boundary: Exact
token-meanmicro-batch weighting + FSDP2-synced zero-grad step skipping +weight_decay = 0.0(while keeping post-EOS tokens unmasked) stabilized D1 at 256/512 (39.84% / 35.55% peaks) and Coupled-GRPO across 128/256/512—yet still failed on Sudoku, proving systems fixes cannot rescue dense partial-credit noise (correct_cells / 9) under zero-KL GRPO.
The blog is co-authored with Gemini.