L\mathcal{L}

𝓛 β€” the loss

Read "L" or "the loss". The curly L is the single number that measures how wrong the model is. Training adjusts the weights to make it small.

L(ΞΈ)\mathcal{L}(\theta) is a function of the model's parameters ΞΈ\theta: plug in the current weights and get back a score for how wrong the model is on the training data. Training runs gradient descent on this number, repeatedly nudging the weights in the direction that lowers it.

A subscript names which loss: LNLL\mathcal{L}_{\text{NLL}} (negative log-likelihood), LCTC\mathcal{L}_{\text{CTC}} (a loss for speech alignment), Laux\mathcal{L}_{\text{aux}} (the extra balancing term in mixture-of-experts). A model's total loss is often a weighted sum of several of these.

Example

L=βˆ’log⁑0.8β‰ˆ0.22\mathcal{L} = -\log 0.8 \approx 0.22

If the model gave the correct next token probability 0.8, the negative log-likelihood for that token is about 0.22. Probability 1 would give a loss of 0.

Where the course uses it

Related terms