Sure, so I posed it as the model outputting probabilities, but in practice the model actually just outputs a value for each class (e.g, [20, -15, 1]), where we do something like soft-max to convert the logits into probabilities.
In your example, we’re using the negative log-likelihood which is actually what cross entropy loss ends up using. Keep in mind that NLL needs you to first use log softmax on the output of the model (if this isn’t already happening inside the model). See the example here 1 for more details.
So essentially, what NLL will do for each datapoint is consider if that datapoint belongs to some class. If it does, we want the model to be as close to 1.0 as possible. Otherwise, want it as close to 0.0 as possible. This is all done in a differential way so we can compute our gradients where the model understands how to push the value closer to 1.0 or 0.0 depending on the label.