Highlights

Contents

Part VII
07

Making the comparison believable

An implemented idea is not yet an established improvement. Training variation and unequal budgets can decide a comparison. Isolate the change, repeat runs, and measure useful quality and real cost together.

THE ARCHITECTURE INVESTIGATIONCost + future tokens01Sparse connections02Compressed history03Latent memory04Compare KV designs05Speculative decoding06Controlled experiment07Interpret + decide08

#Section 21Architecture experiment design

The sparse model finishes faster, but it also trained on fewer tokens. Its result cannot say whether sparsity improved efficiency at equal quality, because more than the mechanism changed.

Baselines and one variable at a time

A baseline is the reference implementation and recipe a change is judged against. Start from a working, tested model and a clear hypothesis, such as “a local/full layer schedule cuts KV payload while keeping distant retrieval at the declared budget.” Keep the baseline runnable instead of editing it in place.

A controlled experiment holds everything comparable except the factor under study. Changing attention, normalization, optimizer, tokenizer, and dataset together tests a package and cannot isolate the attention effect. An ablation removes or alters one component to test what it contributes.

MAKE THE CHANGED FACTOR VISIBLE IN THE RUN LEDGERfieldbaselinevariantdatasetsame splitsame splittoken budget4,096,0004,096,000seed labelsA, B, C, D, EA, B, C, D, Eattentionfulllocal + full
Figure 6.23A schematic run ledger pairs baseline and variant by seed, dataset, and declared budget. The changed attention pattern is explicit; hidden recipe changes would invalidate the attribution.

Equal compute, equal datasets, and equal training budgets

Equal-token comparison gives both models the same training tokens. Equal-compute comparison gives them the same training work. Equal-wall-time comparison gives them the same elapsed time on declared hardware. These answer different questions, and an architecture that changes cost cannot satisfy all three at once.

Auxiliary heads add objectives and computation without adding input positions. Distinguish processed positions from supervised targets when padding or masking is present.

Fix the primary constraint before seeing results. For “better loss after the same data,” use equal tokens and report compute; for “better loss within a budget,” use equal compute or time and report tokens. Keep dataset versions, splits, order, optimizer, and evaluation fixed where the question needs it. Matching parameters by changing width is a second design change and must be disclosed.

#Section 22Seed variance

Two unchanged baseline runs give different held-out losses, because initialization and batch order change the optimization path. A gain smaller than that run-to-run variation is hard to read from one comparison.

Random initialization and multiple seeds

A random seed initializes a pseudorandom generator that drives weight initialization, dropout, or shuffling. Seed variance is the spread across seeds under one recipe. A seed alone does not guarantee identical runs across devices, libraries, or nondeterministic kernels.

Illustrative held-out losses for five paired seeds follow. Pairs share seed labels and data order, though a changed architecture may consume random draws differently.

Seed label Baseline loss Variant loss Baseline minus variant
A 2.10 2.09 0.01
B 2.14 2.11 0.03
C 2.08 2.07 0.01
D 2.12 2.10 0.02
E 2.16 2.13 0.03
Mean 2.12 2.10 0.02
SHOW EVERY PAIRED RUN, NOT JUST THE BEST ONE2.062.082.102.122.142.16ABCDEslate: baselineorange: variant
Figure 6.24Every plotted illustrative loss is listed in the table. Lines join paired runs; they are not training trajectories.

Noise floor and why small improvements may not be real

A noise floor is the variation that limits how finely an experiment can separate effects. It is not a fixed cutoff equal to the baseline’s range; use the uncertainty of the difference you actually care about.

For paired differences Δi\Delta_i:

Δˉ=1n∑iΔi,SE=sΔn.\bar\Delta=\frac{1}{n}\sum_i\Delta_i, \qquad SE=\frac{s_\Delta}{\sqrt n}.

Average paired improvements, then estimate uncertainty from the variation of those differences.

An uncertainty interval depends on independence and distribution assumptions. It also misses unreported selection across many variants. State those limits alongside the result.

FIVE PAIRED DIFFERENCES, THEIR MEAN, AND A 95% STUDENT-T INTERVAL-0.010.000.010.020.030.04no effectACDBEmean 0.020.0075830.032417baseline minus variant loss; illustrative values, SE = 0.01 / √5 = 0.004472
Figure 6.25The five illustrative paired differences, their mean, and the computed 95% interval. The interval sits right of zero even though the baseline's own range, 0.08, is four times the mean gain.

The baseline range is not a significance threshold. Paired and unpaired uncertainty differ; show the run-level results.

#Section 23Undertraining and false conclusions

The validation curve is still falling steeply when training stops. One architecture may learn faster early while another needs longer to show its advantage. A short run answers a short-budget question only.

Insufficient tokens and too few optimization steps

Undertraining means the budget is too small for the regime the experiment means to test, judged from learning curves, data exposure, and the stated goal. Bad data, bugs, or a weak recipe can also cause poor held-out results.

A SHORT RUN OBSERVES ONLY PART OF THE LEARNING CURVEearly budgettraining exposureheld-outlossschematic curves; no measured values
Figure 6.26A schematic learning-curve comparison marks an early and a later observation window. It contains no measured values and shows why a short run cannot set a final ranking.

Tiny models and architecture effects hidden by noise

A tiny-model proxy is a small experiment meant to reveal how a larger design behaves. It is good for shape checks, mask checks, and debugging, but its quality ranking may not transfer when depth, data, optimizer, or hardware change. Some designs only matter at the scale where their bottleneck appears.

Hoffmann and colleagues studied how model size and training exposure should share a compute budget. Their historical scaling rule guides experiments; it is not a universal convergence certificate. Chinchilla scaling study.

So state what a small experiment can establish. An exact mask count and a passing cache test establish implementation properties; a quality claim needs training in the intended regime with controls. Do not drop an idea because one underpowered pilot was inconclusive, or promote it because the code runs.

#Section 24Measuring research architectures

The paper reports faster inference. Was the prompt processed faster, or were output tokens produced faster once the cache existed? The two phases have different shapes and bottlenecks.

Validation loss and BPB

Validation loss is the declared loss on held-out data under a specified tokenizer and reduction, usually mean negative log probability per token. Compare it directly only when tokenization and targets agree.

Bits per byte, or BPB, divides total negative log likelihood by the number of text bytes:

BPB=∑t−ln⁡p(xt∣x<t)Nbytesln⁡2.\mathrm{BPB}=\frac{\sum_t-\ln p(x_t\mid x_{<t})}{N_{\mathrm{bytes}}\ln2}.

Read this as convert total loss from nats to bits, then divide by the raw bytes the targets cover. Define how special tokens, boundary context, and padding count. Different tokenizers give the same bytes different token counts, which is why per-token loss compares poorly across tokenizers.

Memory usage, training speed, prefill speed, decode speed, and KV-cache size

Prefill processes the known prompt and builds its attention states. Decode extends the sequence one token, or one verified batch, at a time. Throughput is work per unit time; latency is elapsed time for one request or phase. A larger batch can raise throughput and worsen latency.

Measurement Declare Common mistaken inference
Validation loss/BPB Corpus, targets, denominator, tokenizer Lower train loss proves better generalization
Memory Weights, cache payload, peak allocated and reserved bytes Formula bytes equal whole-process usage
Training speed Useful tokens per second, batch, sequence length, precision More steps per second means more useful training
Prefill Prompt length, batch, kernel, warmup Prefill gain guarantees decode gain
Decode Context, emitted tokens, batch, sampler, cache Short-context speed applies at every length
KV cache Stored tensors, dtype, token count, padding/pages Fewer KV heads prove faster wall time

Synchronize asynchronous device work at timing boundaries or use device events. Warm up outside the timed runs, repeat, and record hardware and software versions. Reset peak-memory counters, separate allocated from reserved memory, and name the timing statistic.

#Section 25Quality vs efficiency

One variant lowers loss but adds decode latency. Another keeps loss and halves cache memory. They serve different deployments, and one “best model” label hides the choice.

Better loss but slower model and other trade-offs

A Pareto improvement makes at least one declared objective better and none worse. A Pareto frontier holds the candidates no other candidate dominates. Uncertainty and untested tasks still limit what the frontier says.

Illustrative candidate Held-out loss Decode time/token KV payload
Baseline 2.12 10 ms 32 MiB
A 2.10 12 ms 32 MiB
B 2.12 8 ms 16 MiB
C 2.18 6 ms 10 MiB
QUALITY AND TIME NEED THEIR OWN AXES6810122.102.122.162.18baselineABCdecode time per token (ms), lower is fasterloss, lower is better
Figure 6.27The plotted loss and time are illustrative arithmetic fixtures. Candidate B matches baseline loss while reducing time and memory; A and C trade quality for time in opposite directions.

Choosing meaningful trade-offs

A variant can dominate by preserving quality while lowering cost, or trade quality against cost. Attach uncertainty to either comparison and choose according to the workload.

Set acceptance criteria before testing. A memory-bound agent may need its cache to fit at the target batch while tool success stays above a floor; a claim about loss per training compute needs a different criterion. State the trade-off plainly: same task quality in less memory, or a stated quality cost for lower latency.