Negative log-likelihood (NLL) measures how well a multiclass classifier assigns probability to the true label. For true label y and predicted probability p(y), NLL is −log(p(y)); higher confidence in the correct class produces a smaller loss, while low confidence produces a larger one. section 9.7
Calculating batch NLL
A neural network converts logits into class probabilities, selects the probability assigned to each true label, applies −log, and averages the results across samples. This average loss can guide training or evaluate a classifier.






