LLM Loss Curves Explained: Capability Signals in Log Perplexity
This article explains what log perplexity measures, how units and normalization affect comparability, why pretraining loss is worth tracking, and how to interpret a declining loss curve. It also covers cross-model positioning with no-thinking evaluation anchors and interpolation, plus practical guidance for engineering teams selecting and monitoring models.
1. What Log Perplexity Measures
A language model predicts tokens in a text one by one. At each step, the model produces a probability distribution over the entire vocabulary, and then we look at the probability assigned to the actual next token. Taking the negative logarithm of that probability gives the loss for that step. Averaging over all steps in a text gives the average negative log-likelihood, also called log perplexity. Its exponential is perplexity, which can be understood as the average number of candidate words among which the model is “hesitating” at each step.
Lower log perplexity means the model is less surprised by real text and predicts it more accurately.
Two details are easy to confuse:
- The base of the logarithm determines the unit. With natural logarithms, the unit is nats; with base 2, the unit is bits. They differ only by a constant factor: 1 nat = 1/ln2 bit.
- The normalization denominator determines comparability. Averaging by token gives per-token loss. Different tokenizers split the same text into different numbers of tokens, so per-token values cannot be compared directly across models. Averaging by UTF-8 byte gives bits per byte (BPB), which is independent of tokenization and better suited to cross-model comparison.
The following code demonstrates these conversions. The example values are only for illustrating the calculation process and do not represent results from any real model.
import mathdef loss_to_perplexity(loss_nats: float) -> float:"""Convert per-token average loss (nats) to perplexity."""return math.exp(loss_nats)def nats_per_token_to_bpb(loss_nats: float, tokens: int, utf8_bytes: int) -> float:"""Convert per-token average loss (nats) for a text to bits per byte (BPB)."""total_bits = loss_nats * tokens / math.log(2)return total_bits / utf8_bytes# Demo: the same 1,800-byte text is split into 512 tokensloss = 2.1print(round(loss_to_perplexity(loss), 2)) # 8.17print(round(nats_per_token_to_bpb(loss, 512, 1800), 4)) # 0.8618
2. Why Pretraining Loss Is Worth Watching
Pretraining loss measures the model’s predictive ability on large-scale corpora. Empirically, loss follows a smooth power-law relationship with training compute, parameter scale, and data scale; this is often called the scaling law. Loss can therefore serve as a health check metric for base models, showing whether training investment is producing gains without running costly downstream evaluations.
Loss is a necessary condition for capability, but not a sufficient one. Low loss does not mean strong performance on every task, because instruction following, tool use, and safety alignment are mainly determined by post-training. However, a model with a poor base is hard to bring to the same level through post-training. Base loss is therefore more of a reference for the capability ceiling than a predictor of final performance.
3. Reading a Declining Curve
1. A small absolute value does not mean a small change. Loss is on a logarithmic scale, and the relative change in perplexity is exp(-Δ) - 1. When loss drops by 0.01, perplexity drops by about 1%; when loss drops by 0.1, perplexity drops by about 9.5%. When evaluating a gap, convert the loss difference into a relative perplexity change, or compare BPB differences directly.
2. The rate of decline is uneven, so ask why. On the same curve, some phases drop quickly and others slowly. A fast drop may come from improved data quality, model architecture changes, training recipe adjustments, or increased compute. Curve shape alone cannot identify the source. Causal inference requires records of changes in training data, architecture, and compute.
3. Confirm consistent measurement definitions before comparing. On a single time series, the evaluation set, tokenizer, context length, and normalization method must remain consistent. When definitions change, the numerical difference may come from the measurement method rather than the model. For public data from a single source, check these definitions first.
4. Ignore gaps smaller than the error range. Evaluation results usually carry sampling error. A difference of only 0.001 is likely noise. If confidence intervals overlap, do not conclude that one model is stronger.
4. Cross-Model Positioning: Using No-Thinking Evaluations as Anchors
Vendors usually do not publish pretraining loss under a unified protocol. Researchers therefore often use an indirect method: select two adjacent versions with known losses as anchors, then map a model’s scores on a set of no-thinking evaluations through linear interpolation between the anchors to estimate roughly which base generation it corresponds to.
The no-thinking setting is chosen to exclude extra gains from reasoning chains. The resulting scores are closer to the base model’s own capability.
The basic interpolation logic can be written as follows:
def locate_on_curve(score: float, anchors: list[tuple[float, float]]) -> float | None:"""anchors: [(loss, no-thinking eval score), ...], sorted from high loss to low loss.Assume score increases monotonically as loss decreases. Return estimated loss,or None if the score is outside the anchor range."""for (loss0, s0), (loss1, s1) in zip(anchors, anchors[1:]):if s1 == s0:continueif min(s0, s1) <= score <= max(s0, s1):t = (score - s0) / (s1 - s0)return loss0 + t * (loss1 - loss0)return None
This method has three clear limitations:
- Metric choice can change the result. Reasoning evaluations and long-tail knowledge evaluations focus on different capabilities, and the same model may fall into different generation ranges on the two types of metrics. The difference between the two columns reflects metric choice, not the model’s true loss.
- When anchor scores overlap, interpolation loses meaning. If evaluation scores from adjacent versions are very close, or even inverted, the position given by linear interpolation has almost no resolution. In this case, explicitly state that the interval has overlap.
- Interpolation is an estimate, not a measurement. It cannot replace the real pretraining loss, and it should not be written as a confidence interval.
5. What Directly Published Vendor Data Can Confirm
Direct comparison on the same evaluation set is the most reliable approach. When two vendors both report loss on the same data, with the same tokenizer and the same definitions, the gap between them can be compared directly.
If there is no common measurement, look for a reference model that both have measured and use it as a bridge. Through the relative gap to the reference model, indirectly estimate the other model’s position. This method introduces additional error, and the result is often an interval.
In practice, conclusions from the bridge method are often sensitive to the estimation method. Under some assumptions, A leads B; under another assumption, the ranking may reverse. Therefore, reports should give intervals and state the assumptions, rather than writing only a single-point ranking.
6. Implications for Engineering Teams
Base model selection should follow your own tasks. Base loss reflects the potential upper bound, but business results depend on task adaptation, instruction following, output format, latency, and cost. Measure accuracy, stability, and unit cost on your own task set before making a decision.
Build fixed, traceable evaluation sets. Evaluation sets should be versioned and regularly checked for overlap with training data. If evaluation questions have already entered the training corpus, scores will be inflated and conclusions distorted.
Distinguish reasoning mode from regular mode. Reasoning mode usually brings longer outputs and higher cost. For simple classification, extraction, or rewriting tasks, regular mode is often sufficient. Choose the mode based on task difficulty rather than enabling the strongest setting by default.
Establish an internal perplexity baseline and monitor it continuously. If your team trains or fine-tunes its own models, record BPB regularly on a fixed corpus. After data updates or training recipe changes, if the baseline metric rises, investigate whether there is a problem in the data or training pipeline.
Here is a brief checklist:
- Are the units (nats or bits) and normalization method (per token or per byte) clearly stated?
- Do the compared models use the same evaluation set and definitions?
- Is the gap larger than the error range?
- Does the conclusion depend on a particular estimation assumption? If so, is it stated?
- Has the final decision been validated on your own tasks?
