Set up your notebook. You will need it at the end of class.
Copy these. Leave space under each one for a definition.
- training
- inference
- token
Think about these. Nothing to write.
- You have all asked a chatbot the same thing twice. Today you find out whether you should have expected the same answer back.
Copy this into your Lab Notebook and leave room under it. You will answer it at the end of class.
If we send the same prompt to the same model twice, should we expect the same answer? Why or why not?
The life of a model has three phases, in this order.
Almost everyone mixes these up. Today only makes sense if you can hold them apart. All three happen to the same model, but only one of them is happening right now.
- Happened once, before you ever touched it. Months or years ago, in a building you will never see.
- The model was shown enormous amounts of text and adjusted its own numbers, over and over, to get better at guessing what comes next.
- Slow. Expensive. Millions of dollars. When it ends, it is done.
- A single moment. Training stops. All those numbers get written into a file and locked.
- That file is what gets copied around. Same file we talked about on Day 1 — it lives in storage, and later it gets copied into RAM or VRAM so a machine can actually run it.
- From this moment forward the model does not change. Not overnight, not on Tuesdays, not because you corrected it. Frozen means the numbers stop moving, forever, for that model.
- Happens every time anyone anywhere sends the model something. It is happening right now, on somebody's screen.
- The model just runs. It takes what you typed, does its arithmetic on the frozen numbers, and hands back an answer.
- Fast. Cheap per prompt. Nothing changes.
Everything the model 'knows' was set during training and locked at freezing. Inference is the model using what it has, not learning anything new.
"Frozen" means the model does not learn from you.
This is the piece students get wrong most often. It feels like the chatbot is learning about you — it uses your name, it remembers what you asked five minutes ago, it seems to adjust. So it must be picking things up, right?
No. What is actually happening is smaller and stranger than that. Watch:
- You tell the chatbot your name. Three messages later it uses your name.
- You correct it. It stops making that mistake for the rest of the conversation.
- You explain your situation. It answers as if it understood you.
- The whole conversation so far is resent to the model on every message. It reads the transcript fresh each time.
- Your correction lives in that transcript, not in the model.
- Close the tab and the transcript is gone. The next conversation starts from zero. You are a stranger again.
Same model. Same numbers. The illusion of memory is the transcript, not the model. Nothing you say changes what is inside the file. The learning ended before that file ever reached the machine you are typing on.
There are two separate days in the life of an AI model, and almost everyone mixes them up.
The first day is over. It happened in a building you have never seen, on machines you will never touch, months before you typed anything into a chat box. On that day the model was shown an enormous amount of text and adjusted itself, again and again, to get better at one narrow task: guessing what comes next. This process is called training. Training is slow and expensive, and when it ends, the model is frozen. Every number inside it stops changing.
The second day is today. It is also tomorrow, and it is every time anyone anywhere sends the model something. On this day the model learns nothing. It runs. It takes what you typed, does its arithmetic, and hands back an answer. This is called inference. Inference is fast, and it happens millions of times a day.
The difference matters because people assume that talking to a model teaches it. It does not. Correct a model in the middle of a conversation and it may use your correction for the rest of that conversation, but nothing you say changes the frozen numbers inside it. Close the window and the model has no record that you existed. The learning happened on the first day. You are living on the second.
Now consider what the model actually receives when you type. You see words. The model does not. Before anything else happens, your text is cut into pieces, and those pieces are called tokens. A token is sometimes a whole word, sometimes part of a word, sometimes a single mark of punctuation. The word cat is probably one token. The word unbelievable might be three. This cutting is called tokenization, and it happens before the model does any thinking at all.
Tokens are not chosen to make sense to a human reader. They are chosen to be efficient. Chunks of letters that show up constantly get their own token. Rare ones get split apart. This is why a model can fumble a question about spelling. Ask it how many times the letter r appears in a word and it may be working with two or three chunks rather than a row of individual letters. It never saw the letters the way you see them.
Once your text is tokens, the model predicts. It looks at everything so far and produces a ranked list of what token might come next, with a score attached to each one. Then it picks one, sticks it on the end, and runs the whole process again with the new, slightly longer list. One token at a time, until it stops. Every answer you have ever gotten from a chatbot came out the far end of that loop.
Here is the part that surprises people. The model does not always pick the highest scoring token. If it did, one prompt would produce one answer, the same answer, forever. Instead, most systems pick from among the top few candidates with an element of chance built in. The highest scorer usually wins. It does not always win. And because every prediction depends on all the tokens before it, one different pick early in an answer sends everything after it down a different path.
That is why two runs of the same prompt can come back different. Nothing broke. Nothing was updated. The model is still frozen exactly where training left it. The chance lives in the picking, not in the model.
This has a hard consequence for anyone trying to compare two tools fairly. Suppose you send a prompt to one model, read the answer, send it to another, read that answer, and decide the first one is better. What you have actually compared is two single runs. Run them again and the answers may shift. So the difference you noticed might be a real difference between the models. Or it might be the picking.
Telling those two things apart is not a small detail. It is the entire problem. A scientist who tested a drug on one patient and announced a cure would be laughed out of the room, and for the same reason: one run of anything tells you very little about what that thing usually does. The fix is not to trust the first result harder. The fix is to run it more than once, to change exactly one thing at a time, and to write down what you changed.
Next week you will be at a station with three models and one prompt. Every group in this room will send the same words. The answers will not match. Part of that gap is the models being genuinely different from one another. Part of it is chance. Your job across four days is to figure out how much is which.
What a token is
How many times does the letter R appear in STRAWBERRY?
A model will confidently miscount this. It defined the word for you in the same voice it just used to get the count wrong. So what happened?
It never had the letters. The word "strawberry" was already broken into two or three token pieces before the model saw anything. There is no row of individual letters inside the machine for it to count off. It is doing arithmetic on chunks, and the chunks don't spell.
This is a real, repeatable failure — and now you know why it happens.
The loop
The pick is not always the top score
The pick is not always the top score
Why two runs of the same prompt can come back different.
You have probably seen this happen. You ask a chatbot the same question twice and it says two different things. Most people assume something is wrong. Nothing is wrong.
- Something broke.
- The model got updated between your two tries.
- You worded it differently. (Assume you didn't.)
- The pick step (schematic 22) has chance built into it.
- The chance lives in the picking, not in the model.
- The model is still exactly what training left it. It just chose different this time.
This is the whole reason next week's lab exists. If two runs can differ, you cannot judge a model on one run. You have to be careful about it, and being careful is a skill worth building.
Partner work first. Then quiet work time.
- No cellphones
- No sleeping
- No non-academic use of Chromebooks
- A quiet room and music
- No interruptions from the teacher
- If you are caught up on this course's work, you may work on anything legitimate for another class