Language model loss: Difference between revisions
Notation: loss is L, compute is C; fix \prop which is not a LaTeX command (via update-page on MediaWiki MCP Server) |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
[[Category:Large language model]] | |||
[[Category:Large language | |||
The '''language model loss''' measures how "surprised" a [[large language model (LLM)]] is by the true values of tokens it attempts to predict. | The '''language model loss''' measures how "surprised" a [[large language model (LLM)]] is by the true values of tokens it attempts to predict. | ||
| Line 16: | Line 13: | ||
<blockquote> | <blockquote> | ||
$\vec x=(x_1,\cdots,x_T)$ is a text [[token]] sequence of length $T$ (e.g., <code>('I','am','myself','.')</code>). | $\vec x=(x_1,\cdots,x_T)$ is a text [[token (machine learning)|token]] sequence of length $T$ (e.g., <code>('I','am','myself','.')</code>). | ||
</blockquote> | </blockquote> | ||
| Line 44: | Line 41: | ||
== Perplexity == | == Perplexity == | ||
See [[perplexity (LLM)]]. | |||
== Loss and training compute budget == | |||
== Loss and compute == | |||
It is empirically determined | It is empirically determined | ||
| Line 64: | Line 51: | ||
\qquad \alpha \approx 0.05. | \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. | |||
<ref>{{#cite:Q3141}}</ref> | |||
Latest revision as of 08:36, 12 November 2026
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.