Pretraining Loss as a Yardstick for LLM Capability Generations

    Pretraining loss measured on a strictly held-out dataset can provide a relatively objective starting point for comparing base models. This article explains how log-perplexity is defined and computed, what must be standardized for valid comparisons, how anchor interpolation maps evaluation scores to loss ranges, and why metric choice, sampling error, and post-training differences matter when interpreting results.

    1. Why a Unified Capability Yardstick Is Needed

    Large models iterate quickly, and parameter scale, training data, and post-training methods differ from one model family to another. Release notes alone are often insufficient for judging the real gap between two models. If pretraining-stage loss can be measured on the same dataset that was not used for training, it provides a relatively objective starting point. Such a dataset is usually called a held-out set: it does not participate in training and is used only for evaluation.

    Pretraining loss has two advantages as a metric. First, it depends only on next-token prediction probabilities; it does not require human annotation or depend on a particular task format. Second, it is positively correlated with model performance across many task types, so it can serve as a rough proxy for base-model capability.

    2. Defining and Computing Log-Perplexity

    Let a token sequence of length N be x1 through x_N, and let the model’s conditional probability be p(x_i | x<i). Log-perplexity is defined as the average negative log-likelihood:

    LP = -(1/N) × Σ log p(xi | x<i)

    Perplexity equals exp(LP). The two are monotonically related, so when discussing trends, log-perplexity is more intuitive and its values are easier to compare.

    1. import math
    2. def log_perplexity(token_log_probs):
    3. """token_log_probs: natural-log probability of each token under the model"""
    4. n = len(token_log_probs)
    5. if n == 0:
    6. raise ValueError("Held-out sample is empty")
    7. return -sum(token_log_probs) / n
    8. def perplexity(lp):
    9. return math.exp(lp)

    Pay attention to units during computation. When using natural logarithms, the result is in nats; if base-2 logarithms are used instead, the same model will produce different values. Before comparing two numbers, confirm that they use the same logarithm base.

    3. The Held-Out Set Must Be Strictly Consistent

    Log-perplexity is comparable only under identical conditions. At minimum, the following four factors must be standardized:

    1. Data source and version: use the same corpus and confirm that it does not overlap with training data.
    2. Tokenization method: different tokenizers split text into different numbers of tokens, which changes the meaning of average loss.
    3. Context length and truncation rules: models that support long contexts may have systematically lower loss on long documents.
    4. Deduplication and cleaning pipeline: repeated text can artificially lower loss.

    If any one of these factors differs, the resulting numbers can only be used as references and cannot be compared directly.

    4. From Loss to Capability: Correlation and Anchors

    The relationship between loss and capability is correlational, not equivalent. Within the same base model, lower loss is usually accompanied by higher scores on no-thinking evaluation (without enabling an explicit reasoning chain). But when comparing across base models or organizations, architecture, data mixture, and post-training strategy all change the correspondence between the two.

    A common approach is anchor interpolation. First, select several models with known loss and evaluation scores as anchors. Then, for a new model with only a known score, perform linear interpolation between two adjacent anchors to estimate its corresponding loss position.

    1. def interpolate_loss(score, anchors):
    2. """anchors: [(loss, score), ...], sorted in ascending score order"""
    3. for (l1, s1), (l2, s2) in zip(anchors, anchors[1:]):
    4. if s1 <= score <= s2:
    5. ratio = (score - s1) / (s2 - s1)
    6. return l1 + ratio * (l2 - l1)
    7. raise ValueError("Target score is outside the anchor range")

    The following hypothetical numbers demonstrate the calculation. These values are for illustration only and do not represent any real model.

    Anchor A has loss 0.95 and score 60; Anchor B has loss 0.90 and score 70. If the model to be estimated has score 66, then ratio = (66 - 60) / (70 - 60) = 0.6, and the interpolated loss is 0.95 + 0.6 × (0.90 - 0.95) = 0.92.

    The interpolation result indicates which generation segment the model performs similarly to; it is not the model’s true loss value.

    5. Metric Choice Changes Conclusions

    The same set of models may be ranked differently on reasoning-oriented evaluations and long-tail knowledge evaluations. If anchors are taken from different metrics, the interpolated positions will also change. Therefore, conclusions must state the evaluation metric and report results for each metric separately. When two metrics place a model in substantially different positions, this usually indicates that the model’s capability structure differs from that of the anchor models, rather than that one number is wrong.

    6. Sampling Error Cannot Be Ignored

    Evaluation scores come from a finite set of questions and inherently contain random fluctuation. Two scores that differ by only a few hundredths may fall entirely within the same confidence interval. Interpreting such a small difference as a base-model difference is a common misjudgment.

    A bootstrap method can be used to estimate intervals:

    1. import random
    2. def bootstrap_ci(scores, n_iter=2000, alpha=0.05):
    3. n = len(scores)
    4. means = []
    5. for _ in range(n_iter):
    6. sample = [random.choice(scores) for _ in range(n)]
    7. means.append(sum(sample) / n)
    8. means.sort()
    9. low = means[int(n_iter * alpha / 2)]
    10. high = means[int(n_iter * (1 - alpha / 2)) - 1]
    11. return low, high

    If the intervals of two models clearly overlap, they should be treated as indistinguishable or assigned to the same generation.

    7. Different Versions of the Same Base Model

    Different post-training on the same base model can leave pretraining loss exactly the same while producing clearly different evaluation performance. Conversely, two base models with similar loss can also yield different results because of different post-training approaches.