Back to section lessons
Free overview · medium · Lesson 6 of 9

Train and compare fairly

Decide which of ten stories to hold back so you can test the model on unfamiliar text.

A model can memorize familiar phrases as it trains. Hold back some examples before training so you can compare model versions on text they did not learn from.

A small example

Suppose you have ten short stories. If you split neighbouring lines of a story between training and evaluation, its characters and repeated phrases appear on both sides. Try holding out two complete stories instead. The check is now closer to predicting text in an unfamiliar story.

What changed after another pass?

Suppose the model first predicted 7 out of 10 training continuations and 3 out of 5 held-out continuations correctly. After another pass through the training data, it gets 9 out of 10 and 2 out of 5. The extra pass helped with familiar phrases. On the held-out set, at least one previously correct prediction has turned into a mistake.

Five examples are too few to draw a confident conclusion about the model. They do give you something to inspect: which continuations improved, and did it start repeating a familiar phrase where it does not fit?

Done reading?

Mark the lesson as read to move your track progress forward.

Now build your own version

Write a training loop and evaluate new examples. Produce a report that counts every target, including unknown words.

What practice includes and how much it costs

MCP includes the full lesson and a local project with starter files. Work through the task with your agent, ask for a hint and run the checks on your computer.

$134 $67.00 for one year −50%

One payment, no auto-renewal · Terms

Buy for $67.00