Dot products of high-dimensional vectors grow in magnitude with the dimension, pushing softmax into saturated regions where one weight is near 1 and gradients almost vanish.
Dividing by the square root of d_k keeps the variance of the scores roughly constant, so softmax stays well-behaved and training is stable.
Loading…