Bf16 might be freezing your weight updates
Posted by martincsweiss 2 days ago
Comments
Comment by ekelsen 31 minutes ago
Every link submitted by the author seems to be self promotion...
Comment by martincsweiss 3 minutes ago
Again - out of genuine curiousity - would you prefer I post other people's writings instead? Or is it the frequency of my posting (weekly-ish) / amount of work I'm producing that's more concerning to you?
Comment by electroglyph 44 minutes ago
i personally do finetuning in FP16 because then the LoRA merge at the end has less rounding error.
for most models it's lossless as well (when coming from a BF16 source), it's very quick to scan the weights and make sure they're all in range if you're concerned.
Comment by martincsweiss 5 minutes ago
Comment by martincsweiss 2 days ago
As a result, you have a sparse fine-tuner that trains the small-magnitude weights and freezes the rest, with the cutoff set by your learning rate. This is a thing - I found half a dozen peer-reviewed papers (with thousands of citations) that fine-tune this way, but none of them reference this behaviour.
I dug into one called Quiet-STaR, because (a) it's a cool paper, (b) they released their weights, and (c) their code works! So I diffed their base model and saw that indeed the small-magnitude weights were the only ones updated during their training. Then I reran its recipe with an optimizer that applies every update, and watched it diverge. A higher-precision optimizer needs a 3 to 10 times smaller learning rate to get the same result, and I couldn't achieve a better result.
This started with Barron, Gnanapragasam & Tschannen's "A Fix for Softmax and Cross-Entropy" (Oct 2026). They show that the standard way of computing cross-entropy rounds the correct answer's gradient to exactly zero once the model is confident enough (past a margin of about 5.5 in bf16, which they call the precision cliff), and that this, interacting with Adam, is what produces the "slingshot" loss spikes seen during grokking. Fix the rounding and the spikes go away: something people had studied as training dynamics was rounding.
That made me wonder what else out there is weird like this. This is one, and it runs the other way: their rounding bug adds instability to training; this one hides it.
The code, logs and evaluation results are in mweiss17/quietstar-bf16-adamw, in case you want to check the receipts.
Comment by ekelsen 1 hour ago
This issue was recognized a decade ago when we first started training with fp16.
Comment by martincsweiss 52 seconds ago
Also fp16 is much more precise, so this is far less of an issue, and as far as I was able to tell nobody had identified the actual effect (that finetuning in bf16 is NanoAdam with the masking amount / size of weights targetted determined by learning rate).
I figured that was an interesting inductive bias, to target small weights.