What is Cross-Entropy?
Cross-entropy is a measure from information theory that indicates how far a predicted probability distribution deviates from the actual one. In machine learning, it is the most common loss function for classification tasks and also for language models that predict the next token. It penalises confident wrong predictions especially heavily: assigning 99% to the wrong class yields a much higher loss than assigning 60%.