21/29
Part 4 of 5 · The loss and the length limitLearn and do
The loss at the start
A fresh model is equally unsure about every word, so it gives each about 1/V. The loss of one guess is minus the log of the chance it gave the right word, and -ln(1/V) is ln V:
import math
print(round(math.log(5), 3), round(math.log(23), 3), round(math.log(50257), 2))
1.609 3.135 10.82
The practice model starts within 0.1 of ln 23, and GPT-2 near 10.96.
GPT-2 starts near 10.96, a little above ln 50,257 = 10.82. Why above?
Pick an answer above to see the rest