The cross-entropy loss is calculated between the shifted logits and the labels to output the next most likely token.