Measuring the predictor
Fitting seen text differs from improving on new text. Scoring conventions can also create misleading comparisons. Separate training and validation, then explain what perplexity and byte-normalized loss actually measure.
#Section 21Training loss versus validation loss
Suppose Finch-24’s training loss keeps falling while its held-out loss bottoms out and then rises. The optimizer is succeeding at its assigned job: fitting the examples it sees. That does not mean the predictor is improving on new text. We need separate measurements of fitting and transfer.
Training loss measures next-token error on the training distribution under a declared measurement procedure. Validation loss measures that error on held-out examples used for choices such as the learning-rate schedule or checkpoint selection. Generalization is the ability to retain useful predictive behavior on examples outside the fitted sample. The earlier loss-curve introduction provides the basic picture; here the emphasis is on making those curves comparable.
An online training loss can include dropout, data augmentation, changing batches and parameters updated throughout the reporting interval. Validation normally uses fixed weights, evaluation mode and a stable held-out set. For a cleaner comparison, periodically score a fixed training subset with the same evaluation settings as validation. Otherwise some of the gap is measurement policy rather than memorization. With Finch-24’s no-dropout configuration, differences in data selection and timing still remain.
Reading the curve without inventing a diagnosis
Overfitting means further fitting to the training sample harms, or fails to improve, the chosen held-out objective. Underfitting means the model has not fitted the relevant predictive structure well enough. Insufficient capacity can cause underfitting, but so can a poor optimizer, too few updates, harmful regularization or broken labels. A high loss by itself does not identify which explanation is correct.
The illustrated validation curve bottoms out while training loss continues falling. The best held-out checkpoint can therefore precede the best-fitting training checkpoint. These curves are illustrative, not measured Finch results.
A flat pair of curves can mean optimization has converged, capacity is limited, or the learning rate is too small. A noisy validation curve may come from a small evaluation set or changing random windows. A sudden jump can mean a learning-rate change, a data-mixture change, a corrupt checkpoint or nonfinite arithmetic. Read the logs and inspect the data before assigning a story to the line.
Aggregation and honest selection
Sum negative log-likelihood and valid targets over the evaluation set, then divide once. Averaging batch means equally gives the wrong result when their target counts differ.
Read this as total validation loss divided by total supervised tokens: is the summed next-token NLL in batch , and is its valid-target count. Accumulate these totals with sufficient numerical precision and evaluate the same token positions for every model. Padding, context-only overlap and ignored targets contribute neither NLL nor denominator.
Validation is for development decisions; the test split is for an evaluation after those decisions are fixed. Repeatedly optimizing architecture and data choices against validation can overfit that split too. Record what was selected, how often the split was inspected, and whether the reported metric came from validation or an untouched test set. A model's best checkpoint is defined relative to the chosen objective, not every possible user task.
#Section 22Perplexity
A target probability of one quarter costs nats. Exponentiate that loss and you get 4. We have converted a logarithmic penalty into a reciprocal-probability scale. That is the starting point for understanding perplexity, abbreviated PPL.
For one target, the exponentiated NLL is its reciprocal probability. For an evaluation set, perplexity is the exponential of the mean token NLL, not the arithmetic mean of per-token reciprocals. It describes the geometric average penalty assigned to the observed continuations. Lower is better for the same data and evaluation contract.
Read this as the geometric mean of reciprocal correct-token probabilities: is the number of supervised targets and is the probability assigned to target under its declared context. The equality follows by exponentiating the average of logarithms. Here loss is in nats; if it were in bits, the corresponding exponential would use base 2.
A worked comparison
Perplexity exponentiates mean negative log-likelihood. It corresponds to a geometric average of inverse target probabilities, not an arithmetic average of per-token perplexities.
A model choosing uniformly among four candidates would also have PPL 4 on those targets. This gives a useful “effective branching” intuition, but a real model need not be uniform, and PPL is not a literal count of equally plausible next tokens. A loss improvement of 0.5 nats changes PPL by a factor of . Ratios are often easier to interpret than subtracting PPL values.
Tokenizer and context dependence
Changing tokenizers changes the prediction events and the denominator. A tokenizer can make the same string into fewer, harder-to-predict tokens or more, easier-to-predict tokens. Perplexity is therefore unsuitable for a direct cross-tokenizer ranking unless the tokenization is held fixed. The earlier vocabulary discussion introduces this problem; Section 23 works through a denominator that is shared by the raw text.
Context policy changes the conditionals too. Resetting at every disjoint chunk deprives boundary tokens of previous context. A sliding or strided window can preserve more context, but overlapping context tokens must not be counted again as fresh targets. The Transformers evaluation guide documents this fixed-context issue. Choose a policy, score each target once, and disclose stride, maximum context, boundary handling and any excluded initial targets.
Perplexity measures likelihood on the chosen corpus, not factual accuracy, helpfulness, reasoning reliability or calibration on every task. Label smoothing, class weighting and auxiliary objectives also mean a reported “training loss” may not be plain token NLL; exponentiating that mixed objective does not produce ordinary perplexity. Compute the metric from the actual unweighted next-token log probabilities. Evaluate the model distribution, before generation temperature or truncation.
#Section 23Bits per byte
Two tokenizers encode the same eight bytes, but one uses four tokens and the other uses eight. Suppose both assign their chosen encodings the same total NLL, nats. The first gets PPL 4 and the second gets PPL 2. There is no likelihood improvement in this example. The unit of averaging changed.
Bits per byte, or BPB, divides total negative log probability in bits by the number of evaluated raw bytes. A bit is the base-2 information cost of halving probability; a nat is the corresponding natural-log unit. To convert nats to bits, divide by . Byte normalization supplies a denominator tied to text rather than the tokenizer's segmentation.
Read this as total coding cost in bits divided by evaluated bytes: is the byte count of the same scored text span, is its token count, and is its mean token NLL in nats. The formula does not average per-token BPBs. It uses one text-level numerator and denominator.
The same sequence probability can produce different perplexities under different tokenizations. Dividing its information cost by the same raw bytes gives a common denominator, as the figure shows.
Bytes mean bytes
Use an explicit encoding such as UTF-8. The string café has four Unicode code points and five UTF-8 bytes in its composed form. A decomposed accent can encode differently; normalization decisions are part of the data contract. len(text) in Python counts code points, while len(text.encode("utf-8")) counts bytes. Count the actual canonical evaluation stream.
Special tokens have no ordinary text-byte contribution. Decide consistently whether document boundaries, BOS and EOS are scored and how their costs belong in the text-level numerator. Excluding a prefix from loss while counting its bytes in the denominator artificially improves BPB. Context-only bytes are conditioning information, not fresh evaluated bytes. Store scored spans or offsets so numerator and denominator refer to the same material.
What BPB fixes and what it does not
BPB removes the arbitrary number-of-tokens denominator, making a cross-tokenizer comparison more meaningful on the same losslessly represented byte stream. It does not make preprocessing, context length or dataset choice irrelevant. Different tokenizers also expose different numbers of raw bytes within a fixed token context; disclose that difference or control the raw-context policy where the experiment requires it.
A token model assigns probability to token sequences. If multiple token sequences decode to the same byte string, the likelihood of one canonical encoding is not necessarily the model’s marginal probability of that string, which would sum over all matching encodings. Standard BPB reporting uses a declared canonical encoding and its sequence likelihood. It is a useful reproducible comparison, not a proof that every tokenizer induces the same byte-level probability model.
| Property | Perplexity | Bits per byte |
|---|---|---|
| Numerator | Next-token NLL | Same NLL converted to bits |
| Denominator | Valid predicted tokens | Corresponding raw bytes |
| Output | Exponentiated mean | Mean bits per byte |
| Shared tokenizer needed | Yes for direct ranking | Not for the denominator |
| Shared data policy needed | Yes | Yes |
| Measures task success directly | No | No |