8/14
Part 5 of 7 · Language modelsLearn and do
A language model's loss is cross entropy per token, and perplexity is its exponent
A language model is scored the same way, one token at a time: minus the log of the chance it gave the token that came next, averaged over tokens. PyTorch's CrossEntropyLoss computes it from the logits, and the GPT from scratch lesson trains on the same loss. Hugging Face's documentation defines perplexity as the exponentiated average negative log-likelihood of a sequence, which it notes is the same as e to the cross entropy.
A model gives the right next token a 25% chance every time. What's its perplexity?
Pick an answer above to see the rest
Train ever bigger models on the same text. Where does the loss go?
Pick an answer above to see the rest