Softmax bug #2: distillation gradients are non-zero even when student equals teacher

jon_barron · x · 2026-10-24

Jon Barron details the second bug, "Softmax Cancellation": when output logits are very close to soft target logits (e.g. distillation with student initialized as teacher), current implementations produce non-zero gradients even when student == teacher. Fixing cross-entropy removes slingshot spikes and speeds up grokking; weight decay and Adam's eps (default 1e-8, right past the fp32 bug threshold) conspire to bound logit growth — possibly why small eps is considered dangerous.

Related event: Google researcher says all softmax and cross-entropy implementations have two numerical bugs(6 posts)→

Original post →

More from Research

Research channel →