Held-Out Log-Perplexity: Tracking Progress Across LLM Generations
Nine model results show a steady but uneven decline in log-perplexity on an internal code dataset. This article explains the metric, converts the reported values to perplexity, and compares changes across model generations, with attention to the conditions required for meaningful comparisons.
1. Understanding the Metric
Log-perplexity typically refers to a model’s average negative log-likelihood per token on a held-out text dataset:
log-perplexity = -(1/N) * Σ log p(x_i | x_<i)
Here, N is the total number of tokens, and p(x_i | x_<i) is the probability the model assigns to token i given the preceding tokens. A lower value means the model assigns higher probabilities, on average, to the tokens in the dataset.
Perplexity is the exponential form of log-perplexity. When natural logarithms are used:
perplexity = exp(log-perplexity)
Consequently, a one-unit reduction in log-perplexity reduces perplexity by a factor of e.
Before comparing results, check two things:
- Whether the reported metric uses natural logarithms or base-2 logarithms.
- Whether the results use the same tokenizer and evaluation dataset.
Values calculated with different logarithm bases or tokenization schemes are not directly comparable.
2. Organizing the Results
The source material reports nine values. The table below preserves their original order and converts log-perplexity to perplexity, assuming natural logarithms. The perplexity values are calculated here; they were not supplied in the source.
| ID | Description | Log-perplexity | Calculated perplexity, approximately |
|---|---|---|---|
| M1 | First-generation base model | 0.986 | 2.68 |
| M2 | Second-generation base model | 0.913 | 2.49 |
| M3 | Third-generation base model | 0.888 | 2.43 |
| M4 | Fourth-generation base model | 0.871 | 2.39 |
| M5 | Fifth-generation base model | 0.848 | 2.34 |
| M6 | Sixth-generation base model | 0.828 | 2.29 |
| M7 | Seventh-generation base model | 0.783 | 2.19 |
| M8 | Eighth-generation base model | 0.761 | 2.14 |
| M9 | Unreleased internal model | 0.732 | 2.08 |
The model names in the source have been replaced with identifiers. The held-out dataset consists of internal code data, so these results reflect the models’ predictive performance on code text.
The reductions between successive versions are uneven:
- M1 to M2: A decrease of 0.073, the largest step in the series.
- M6 to M7: A decrease of 0.045, the largest step among the later models.
- M3 to M4: A decrease of just 0.017.
The overall trend is downward, but the pace varies. It cannot be described as a constant-rate improvement.
3. Comparing Two Intervals
The source identifies two intervals for comparison. Their changes can be calculated using the same method.
First interval: M2 to M3. Log-perplexity falls by 0.025, corresponding to an approximately 2.5% reduction in perplexity.
Second interval: M3 to M8. Using the table values, log-perplexity falls by 0.127, from 0.888 to 0.761. Under the same natural-log assumption, this corresponds to an approximately 11.9% reduction in perplexity.
