Learn Before
Formula

Span Prediction Loss Formula

The loss for a span prediction task is calculated as the average negative log-likelihood of the predicted probabilities for the start and end positions of the answer span. The formula is: Loss=1nj=1n(logpjbeg+logpjend)\mathrm{Loss} = -\frac{1}{n} \sum_{j=1}^{n} \big( \log p_j^{\mathrm{beg}} + \log p_j^{\mathrm{end}} \big) Where: - nn is the number of tokens in the context text. - pjbegp_j^{\mathrm{beg}} is the model's predicted probability that token jj is the start of the answer span. - pjendp_j^{\mathrm{end}} is the model's predicted probability that token jj is the end of the answer span.

Image 0

0

1

Updated 2026-04-18

Contributors are:

Who are from:

Tags

Ch.2 Generative Models - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences

Ch.1 Pre-training - Foundations of Large Language Models