Deep Black BoxOpen up the black box of AI one problem at a time, with your own hands. 21 problems in all.
Question 11

Spotting when it has just memorized

Get 10 or more right on the test set.

Try feeding the student number in as an input (all 40 have a different number).
28 for training = used to set the knobs   12 for the test = never shown, not once
Feed the student number in
0 steps
Press [10000 steps].
How the 12 test cases break down (a confusion matrix)
–
What to take away
Full marks on the training set, yet a drop on data it has never seen — this is called overfitting.
Where this pays off
Watching the training score alone will not tell you. Always measure on data it has never seen.
The same thing happens on Titanic over at Kaggle — feed the passenger ID in and you get 100% in training and 53.31% on the real thing (lower than the 61.62% you get by answering “died” for everyone).
How many times round? The 28 training cases go through in groups of 7
One move on 7 cases is one iteration, and one lap through all 28 is one epoch.
Splitting them into 7s like this is a mini-batch. With 40 you could measure them all at once, but the real thing runs to 300 billion words, so only a slice can be measured at a time.
An LLM has the same shape. The number of knobs simply goes up to 175 billion.
Up next
Once there are 175 billion knobs, you need something that decides which words to look at. That is attention, in Chapter 3.