17/29
Part 3 of 5 · From vectors back to wordsLearn and do
Start every weight small, so the model starts unsure
A model's first loss depends on how its weights start.
GPT-2 starts every weight as small random numbers, with a spread of 0.02, and every bias at 0. A model method, _init_weights, does it in one loop over self.modules(), the model's layers, with nn.init.normal_ for the weights and nn.init.zeros_ for the biases.
The point is a model that starts out unsure. Small weights give small scores, small scores give a softmax close to equal over all words, and an unsure model has a known starting loss: about ln V, the natural log of the vocabulary size. The next part shows why.
All V scores start near 0. What does the softmax give each word?
Pick an answer above to see the rest