Pre-train and observe

Checkpoints and sampling

Compare saved model states with fixed prompts and sampling controls instead of choosing isolated outputs after the fact.

8 minute lesson

~~~

A checkpoint is a saved model state at one training step. It lets you resume and compare progress.

Choose an early, middle, and later checkpoint. Run the three baseline prompts against each one.

Keep temperature, top-k, top-p, min-p, maximum tokens, and random seed fixed where the app exposes them.

These controls act on one next-token distribution:

  • temperature changes how sharp or flat the distribution is
  • top-k keeps at most the highest-scoring k candidates
  • top-p keeps the smallest high-probability set reaching a probability mass
  • min-p removes candidates too weak relative to the best candidate
  • the random seed controls reproducible draws when supported

Do not change every filter at once. For the baseline, choose one documented preset and keep it fixed.

Run at least two sampling conditions for a useful contrast:

  1. deterministic or very low-randomness output for checkpoint comparison
  2. one moderate-randomness preset with three fixed seeds

One lucky stochastic sample is not evidence that a checkpoint improved.

Save every output, including weak ones. Add the checkpoint and settings above each sample in your notebook.

Look for changes in spelling, sentence closure, repetition, topic continuity, and similarity to the dataset.

If a later checkpoint produces worse text, check validation loss and several seeds before deciding it regressed. The latest weights are not automatically the best weights.

Sampling a saved checkpoint with temperature, top-k, top-p, min-p, token probabilities, and a fixed random seed

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →