Language model loss
The language model loss measures how "surprised" a large language model (LLM) is by the true values of tokens it attempts to predict.
Formal definition
With model parameters $\theta$, the language model loss on training sample $\vec x=(x_1,\cdots,x_T)$:
$$ L(\theta) = -\frac{1}{T}\sum_{t=1}^{T}\log_b P_\theta(x_t \mid x_{1:t-1}) $$
$\vec x=(x_1,\cdots,x_T)$ is a text token sequence of length $T$ (e.g.,
('I','am','myself','.')).
Unit
The unit of the language model loss is determined by $b$.
| $b$ | Unit |
|---|---|
| 2 | Bit |
| e | Nat |
| 10 | Hartley |
Training reports conventionally quote $L_{\text{nat}}$.
Perplexity
See perplexity (LLM).
Loss and training compute budget
It is empirically determined
$$ L(C) \propto C^{-\alpha}, \qquad \alpha \approx 0.05. $$ where $C$ is the training compute budget.
As a consequence, halving the loss requires roughly $10^{6}$ times more compute.