Initialization Sets the First Signal Scale

Seed and inspect the model before its first update. Relate parameter scale to residuals, attention scores, logits, uniform-loss baseline, and gradients without treating one tested scale as universal.

Before the first optimizer step, initialization determines the magnitudes of token records, attention scores, residual updates, logits, loss, and gradients. The model is structurally correct at many possible scales, but not every scale is equally easy to optimize.

The frozen experiment uses:

  • model seed 7;
  • zero-mean normal weights with standard deviation 0.10.1;
  • zero linear biases;
  • LayerNorm scales initialized to 1 and offsets to 0;
  • zero dropout.

These are one tested toy configuration, not general Transformer defaults.

Seed before Constructing the Model

Setting the seed after construction cannot reproduce parameters that have already been sampled. Data sampling and batch order use separate generators so changing one does not silently change the others.

Audit Distributions, Not One Convenient Number

For every parameter group, record at least shape, minimum, maximum, mean, and standard deviation. Then run one batch without updating and inspect:

QuantityFailure signal
embedding and position recordsall zero, non-finite, or dominated by one table
attention scoresnearly identical everywhere or extremely separated
residual norms by blockcollapse or rapid growth with depth
logitsalmost exact ties or extreme magnitudes
initial lossnon-finite or suspiciously near zero
gradient normszero, non-finite, or dominated by one tensor

With eight vocabulary entries, uniform next-token probabilities give ln(1/8)=ln82.0794-\ln(1/8)=\ln 8\approx2.0794 nats. The verified model begins near this value: 2.1898 on the sampled training corpus and 2.1918 on validation. Near-uniform initial predictions explain those values; the numbers do not prove that every internal scale is healthy.

Compare Scale while Holding Everything Else Fixed

An initialization ablation should change only the standard deviation. Keep the model seed, corpus, batch order, optimizer, and number of updates fixed. Measure initial logits, loss, residual norms, gradients, and later loss.

  • Very small weights can produce weak distinctions and small updates in some paths.
  • Very large weights can produce extreme scores, saturated probabilities, or unstable residual and gradient scales.
  • Normalization can reduce some scale problems without making initialization irrelevant.

Do not describe one successful standard deviation as universally optimal.

Q1. Interpret an initial loss

The vocabulary has eight tokens and all logits in every row are equal. What is the mean cross-entropy per target in natural-log units?

Compute it first, then check your number.

Hint
Calculate ln(1/8)-\ln(1/8).
Solution
ln(1/8)=ln82.079442-\ln(1/8)=\ln8\approx2.079442 nats.
Not attempted
Review

Not marked done.

Initialization Is the First Recorded Experiment State

Store the initialization rule and model seed in the configuration. A checkpoint can later preserve trained weights, but it cannot explain how an unrecorded run began.

Pause and reflect

In your own words, note what you understood, what remains unclear, or what you want to revisit. The note stays with this lesson.

0 of 1 exercises marked done

Review

Not marked done.

LLM PrimerInitialization Sets the First Signal Scalehttps://llmprimer.com/transformers/training-a-tiny-transformer/initialization-sets-the-first-signal-scale© 2026 LLM Primer