Explore the research collection
2 entries · Follow this search
- Paper
Broken Symmetry in BF16 Attention: Why FlashAttention Gradients Blow Up Late in Training
Diagnoses a late-training blow-up training a 450M transformer on 50B tokens with FlashAttention-3 in BF16: healthy for 25B tokens, then gradient norm grows 1000x and loss ends 0.2 nats above FP32 attention — with no NaNs at all. Recomputing just two layers' attention backward in FP32 removes almost all excess gradient. Part of the cause is known (a fused multiply-add in the forward softmax, never fixed in FA3); repairing it stops the blow-up but leaves the query gradient wrong by more than its own size (219% median error). The deeper cause is a broken conservation law: the softmax score gradient dS sums to zero along every row, making dQ blind to where the keys sit as a group; rounding dS to BF16 leaves a small nonzero sum that leaks the mean key into dQ — and the leak grows exactly as late training makes keys large and attention sharp. Fix: GProj (gauge projection), which restores the zero row sum after the cast with two rank-one corrections per row — cuts median dQ/dK errors from 219%/13% to 0.34%/0.37% (FP32-attention level) for 4.7% more step time; in matched from-scratch runs it reaches the same loss as FP32 attention while FA3 and key smoothing destabilize. KohakuBlueleaf replied on the thread reporting the same class of precision bug in FA4/cuDNN/flex attention and their KohakuFA fix. If a BF16 run blows up late with no NaNs, check the attention backward. Directly relevant to the user's LLM training-run debugging work.
- Paper
Efficient Agentic Reasoning Through Self-Regulated Simulative Planning
SR2AM (Self-Regulated Simulative Reasoning Agentic LLM) decomposes agent deliberation into reactive execution (System I), simulative planning with the LLM as world model (System II), and a configurator that chooses whether to plan, continue, or skip (System III). Two instantiations: v0.1 records a multi-module prompted teacher (o4-mini); v1.0 reconstructs structured plans from DeepSeek-V3.2 traces. Both use SFT then GRPO. SR2AM-v0.1-8B (from Qwen3-8B) overall Pass@1 57.0, competitive with 120-355B tool-using systems; v1.0-30B (from Qwen3-30B-A3B-Thinking-2507) 71.3 Pass@1 with 25.8-95.3% fewer reasoning tokens than similar-scale agentic LLMs. RL lengthens plan horizon +22.8% while planning frequency grows only +2.0 pp. Code sailing-lab/sr2am.