The cross-entropy loss is calculated between the logits and the label position to find the most likely span of text corresponding to the answer.