Evaluating a language model on likelihood and downstream tasks

← Back to Blog & Articles

An extrinsic evaluation instead measures a model against some downstream use it was never directly optimized to minimize a loss against: does it answer multiple-choice questions correctly, does it solve a word problem, does it produce code that passes a test suite, do human raters prefer its response to an alternative’s.

An intrinsic evaluation measures a language model against its own training objective: given held-out text drawn from (an approximation of) the distribution the model was trained on, how well does the model’s predictive distribution match it? Perplexity, derived in full in the companion book (Probability and Information Theory for Language Modeling), is the standard intrinsic metric — recall that it is defined as PPL=exp(H(p,pθ))\mathrm{PPL} = \exp(H(p, p_\theta)), the exponentiated cross-entropy between the true distribution pp and the model pθp_\theta, and that it has the operational reading of an effective per-token branching factor, bounded below by the exponentiated entropy of the source itself. Intrinsic evaluation is cheap to compute (a single forward pass over held-out text, no task-specific labels or human judgment required), directly optimizable (it is, up to the exponentiation, exactly the training loss), and comparable across checkpoints of the same model family on the same held-out set.

An extrinsic evaluation instead measures a model against some downstream use it was never directly optimized to minimize a loss against: does it answer multiple-choice questions correctly, does it solve a word problem, does it produce code that passes a test suite, do human raters prefer its response to an alternative’s. Extrinsic metrics are what practitioners and users ultimately care about, but they are more expensive to compute, often require careful task-specific formatting and scoring, and — critically for this section — are not the quantity training minimizes at all. The rest of this section makes precise a fact every practitioner learns empirically: a model with excellent perplexity on held-out web text can still perform poorly on a specific downstream task, and the reverse can also occur. This is not a paradox or a measurement artifact; it follows directly from what perplexity does and does not measure.

Why distribution shift breaks the guarantee. Write pp for the distribution perplexity is measured against — ordinary held-out text, drawn from (approximately) the same distribution the pretraining corpus was drawn from — and write qq for the distribution of sequences relevant to some downstream task: multiple-choice exam questions formatted a particular way, multi-turn chat transcripts, chain-of-thought reasoning traces, or any other distribution that differs from ordinary prose in its formatting, vocabulary, or structure. Suppose the model achieves near-optimal cross-entropy on pp, i.e. H(p,pθ)=H(p)+ϵH(p, p_\theta) = H(p) + \epsilon for some small ϵ≥0\epsilon \geq 0; by the identity from the companion book, this means DKL(p∥pθ)=ϵD_{\mathrm{KL}}(p \,\|\, p_\theta) = \epsilon is small. The question extrinsic evaluation on the downstream task actually asks is whether DKL(q∥pθ)D_{\mathrm{KL}}(q \,\|\, p_\theta) is also small — whether the model’s distribution is close to correct specifically on the sequences the task cares about.

Assume qq is absolutely continuous with respect to pp (if it is not — if the task distribution places mass on sequences essentially never seen during pretraining at all — the argument below only strengthens, since pθp_\theta then had no training signal whatsoever from those regions) and write r(x)=q(x)/p(x)r(x) = q(x)/p(x) for the resulting density ratio. Then

DKL(q∥pθ)=𝔼x∼q[logq(x)pθ(x)]=DKL(q∥p)+𝔼x∼q[logp(x)pθ(x)],\begin{equation} D_{\mathrm{KL}}(q \,\|\, p_\theta) = \mathbb{E}_{x \sim q}\!\left[\log \frac{q(x)}{p_\theta(x)}\right] = D_{\mathrm{KL}}(q \,\|\, p) + \mathbb{E}_{x \sim q}\!\left[\log \frac{p(x)}{p_\theta(x)}\right], \end{equation}

obtained by inserting and subtracting logp(x)\log p(x) inside the expectation. The second term is an expectation over qq of the same pointwise log-ratio g(x)=log(p(x)/pθ(x))g(x) = \log\big(p(x)/p_\theta(x)\big) whose expectation over pp is exactly ϵ\epsilon — that is, 𝔼x∼p[g(x)]=ϵ\mathbb{E}_{x\sim p}[g(x)] = \epsilon. Rewriting the expectation over qq as a reweighted expectation over pp, using q(x)=r(x)p(x)q(x) = r(x)\,p(x),

𝔼x∼q[g(x)]=𝔼x∼p[r(x)g(x)]. \mathbb{E}_{x \sim q}[g(x)] = \mathbb{E}_{x \sim p}\big[r(x)\, g(x)\big].

This is the crux of the argument: 𝔼p[g(x)]\mathbb{E}_p[g(x)] and 𝔼p[r(x)g(x)]\mathbb{E}_p[r(x)g(x)] are, in general, unrelated quantities — a small unweighted average of gg places no bound on a reweighted average of the same function unless something further is assumed about how rr and gg co-vary, and there is a structural reason to expect them to co-vary in exactly the wrong direction here. Cross-entropy minimization under pp distributes its optimization pressure in proportion to p(x)p(x): sequences with small p(x)p(x) contribute little to the training loss and therefore receive little gradient signal, so nothing guarantees pθ(x)≈p(x)p_\theta(x) \approx p(x) specifically at those low-probability-under-pp points — g(x)g(x) can be large there without materially affecting ϵ\epsilon. If qq concentrates exactly on this kind of sequence — a specific instruction-formatted conversation style, a chain-of-thought scaffold, a rare but task-critical phrasing — then r(x)r(x) is large precisely where g(x)g(x) is large, and the reweighted average can be far larger than ϵ\epsilon, with no upper bound available from ϵ\epsilon alone. Formally: no inequality of the form DKL(q∥pθ)≤C⋅DKL(p∥pθ)D_{\mathrm{KL}}(q\,\|\,p_\theta) \leq C \cdot D_{\mathrm{KL}}(p\,\|\,p_\theta) holds for a universal constant CC without an explicit bound on supxr(x)\sup_x r(x) — a “bounded covariate shift” assumption — and nothing about ordinary pretraining supplies one between an internet-text corpus and an arbitrary downstream task’s distribution. Low perplexity on pp licenses no inference about qq unless qq is known to resemble pp in the specific sense of a bounded density ratio, which is exactly what “a different distribution or objective than pretraining” denies by assumption.

Why aggregation also breaks the guarantee, even without distribution shift. A second, independent gap exists even when q=pq = p exactly, and it concerns how perplexity aggregates across a sequence versus how task correctness is scored. Perplexity is an average over every token position, computed with equal weight regardless of how much that token’s correctness matters to any downstream use of the sequence: articles, punctuation, common function words, and other high-frequency, low-information tokens contribute the same weight to the average per-token loss as a single decisive token — the numeric answer to a math problem, the class label in a classification prompt, the polarity word in a sentiment judgment — on which an extrinsic accuracy metric depends entirely. A model can therefore achieve very low perplexity by being excellent at the many easy, highly predictable tokens in a sequence while being little better than chance at the few tokens that actually determine whether a downstream answer is correct, since those decision tokens are a vanishingly small fraction of the total token count the perplexity average is computed over. Because extrinsic scoring functions like exact-match accuracy depend on exactly this small, unevenly-weighted subset of tokens rather than on a uniform average, perplexity and task accuracy are measuring genuinely different functionals of the same predictive distribution, and improving one need not improve — and can even trade off against — the other.

The code below makes this aggregation gap concrete on a fully synthetic task, without needing a real trained model. Each toy sequence has five easily-predictable “filler” tokens (drawn from a vocabulary of 50 possibilities, standing in for ordinary syntax and common words) followed by one binary “answer” token that determines task correctness. Two toy models are specified directly by two scalar correctness probabilities each, rather than trained: Model A is very good at the filler tokens but only slightly better than chance on the answer token; Model B is somewhat worse on the filler tokens but much better on the answer token.

Running this prints Model A (filler-optimized) PPL = 1.435 task accuracy = 56.0% and Model B (answer-optimized) PPL = 1.575 task accuracy = 90.4% (the exact figures move slightly with n_sequences or the random seed, but the qualitative relationship is stable and follows directly from the probabilities specified above). Model A has the lower perplexity — the metric a purely intrinsic evaluation would report as better — while Model B, with worse perplexity, is dramatically more accurate on the one task-relevant token per sequence. Five out of six tokens in every sequence are filler, so the perplexity average is dominated by exactly the tokens that do not determine task correctness; the fraction of the average contributed by the answer token is small enough that a large accuracy difference on it barely moves the aggregate perplexity number, and can even be outweighed by a small filler-quality difference in the other direction, exactly as observed here.

Both gaps identified in this section — distribution mismatch and aggregation mismatch — point to the same conclusion: perplexity is a well-defined, useful, and cheap signal for one specific question (how well does the model’s predictive distribution match ordinary held-out text, averaged uniformly over tokens), and it is not a proxy for arbitrary downstream task performance, because downstream tasks generally involve a different distribution, a different (often discontinuous, decision-weighted) scoring function, or both. This is why the field maintains a large ecosystem of extrinsic benchmarks in addition to reporting perplexity — not as a redundant check, but as the only direct way to measure a quantity perplexity does not, and structurally cannot, bound.

Continue with the book

Explore the full treatment, worked examples, and exercises in LLMs Derived.


Companion article for LLMs Derived, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.

Scroll to Top