Code · architecture · study mode
The LM head raw logits can grow unboundedly during training, causing loss spikes and instability. Instead of…
Full explanation below the code →
The LM head raw logits can grow unboundedly during training, causing loss spikes and instability. Instead of tanh(x/c)·c (Gemma 2 soft-cap), this uses a shifted sigmoid: 23·σ((x+5)/7.5). The +5 shift biases toward the active range, 23 sets the output scale, 7.5 controls sharpness.
Why does logit bounding stabilize training compared to letting logits grow freely?