WEBVTT

00:00:00.000 --> 00:00:01.725
A note before we begin.

00:00:01.725 --> 00:00:09.225
The narration in this video is synthetic speech, generated from the lecture notes of Dr. Sean Davis.

00:00:09.225 --> 00:00:11.850
It is not a recording of his voice.

00:00:11.850 --> 00:00:15.000
The lecture was given on October 15, 2026.

00:00:15.800 --> 00:00:22.131
This is a recorded version of a lecture from a course on artificial intelligence for medical students.

00:00:22.131 --> 00:00:28.028
The previous session covered machine learning: the fitting loop, and the E G F R as an example.

00:00:28.028 --> 00:00:32.124
This one takes that loop and shows how a chatbot is built from it.

00:00:32.124 --> 00:00:33.800
It runs about half an hour.

00:00:34.150 --> 00:00:39.042
The live session started with three quick questions about how the room uses chatbots.

00:00:39.042 --> 00:00:43.070
They are worth answering for yourself, so pause the video at each one.

00:00:43.420 --> 00:00:46.289
First: how often do you use a chatbot?

00:00:46.289 --> 00:00:50.290
Any of them counts: ChatGPT, Copilot, Gemini, Claude.

00:00:50.290 --> 00:00:53.838
In the live session, sixteen students answered.

00:00:53.838 --> 00:01:00.255
Half used one a few times a week, more than a third every day, and nobody said never.

00:01:00.255 --> 00:01:10.220
When this course ran a year earlier, about one student in five said never, or only once or twice, and so did several of the faculty.

00:01:11.033 --> 00:01:16.313
Second: how confident are you using a chatbot, from not at all to very?

00:01:16.663 --> 00:01:19.406
Confidence and frequency don't always match.

00:01:19.406 --> 00:01:26.200
Some people use one every day and still feel they're fumbling; some have barely tried and feel fine about it.

00:01:26.200 --> 00:01:27.509
Neither is a problem.

00:01:27.509 --> 00:01:31.499
A year earlier, most students answered "a little" or "somewhat".

00:01:31.499 --> 00:01:39.166
In this session, nobody picked "not at all" or "a little": about a third said somewhat, and two thirds said fairly or very.

00:01:39.166 --> 00:01:43.903
Remember your answer; it's worth comparing against at the end of the course.

00:01:44.733 --> 00:01:49.584
Third, and last: when you use a chatbot, what do you use it for most?

00:01:49.584 --> 00:01:51.693
Pick the one that's most true.

00:01:52.043 --> 00:01:54.364
The first three choices aren't mine.

00:01:54.364 --> 00:02:09.644
They're the three biggest categories in a 2025 study by OpenAI and economists who looked at one and a half million ChatGPT conversations: practical guidance, which includes tutoring and how-to advice; looking up information; and writing.

00:02:09.644 --> 00:02:13.705
Together those were nearly eighty percent of all conversations.

00:02:13.705 --> 00:02:17.058
The students in the live session didn't quite match.

00:02:17.058 --> 00:02:26.083
Writing or editing came first, at forty-four percent, then looking things up, at thirty-nine, and explaining or tutoring last, at seventeen.

00:02:26.433 --> 00:02:28.475
I also ask because the risks differ.

00:02:28.475 --> 00:02:32.333
An explanation you'll check against your notes is fairly low stakes.

00:02:32.333 --> 00:02:38.799
Using it like a search engine is where "fluent and unchecked" bites hardest, because the answer looks like a fact.

00:02:38.799 --> 00:02:42.713
Whatever you pick, it's worth noticing which kind of use you lean on.

00:02:43.533 --> 00:02:49.185
The previous session ended with a promise: a chatbot is the same loop, with words.

00:02:49.185 --> 00:02:51.253
This video keeps that promise.

00:02:51.603 --> 00:02:53.152
Why start with the loop?

00:02:53.152 --> 00:03:00.057
Because if the loop makes sense to you, almost everything surprising about chatbots stops being surprising.

00:03:00.057 --> 00:03:01.089
So, one picture.

00:03:01.089 --> 00:03:03.864
A model turns predictors into a prediction.

00:03:03.864 --> 00:03:10.833
Fitting means guessing the dials, scoring the misses with a loss, nudging the dials, and going around again.

00:03:10.833 --> 00:03:18.189
A neural network is that same loop with far more dials; for a large language model, billions to trillions of them.

00:03:18.189 --> 00:03:28.772
While we fit, we watch the error on a small held-out validation set, and that's how we spot a model that's too complex for the data we have, one that's overfitting.

00:03:28.772 --> 00:03:35.483
And a score on cases the model has already seen tells you very little; you need a test set it never saw.

00:03:35.900 --> 00:03:40.396
Today is about one kind of deep learning model, large language models.

00:03:40.396 --> 00:03:45.020
Image models work much the same way, with images where we'll have words.

00:03:45.370 --> 00:03:47.208
Today we feed that loop words.

00:03:47.208 --> 00:03:57.810
By the end, I'd like you to be able to explain to a classmate how a chatbot gets built, in three stages, and why that recipe makes it behave the way it does when you use it.

00:03:58.633 --> 00:04:02.098
Before any theory, I want you to be the model for a minute.

00:04:02.098 --> 00:04:05.033
I'd rather you feel this than hear me describe it.

00:04:05.383 --> 00:04:09.163
Finish the sentence with one word, whatever comes first.

00:04:09.163 --> 00:04:11.863
The patient was started on empiric what?

00:04:12.213 --> 00:04:15.813
Say your word out loud, or write it down, before you go on.

00:04:16.163 --> 00:04:21.807
In the live session this was a word cloud, and the room made not one answer but a spread.

00:04:21.807 --> 00:04:27.767
Antibiotics was by far the biggest word, with vancomycin, ceftriaxone and treatment behind it.

00:04:27.767 --> 00:04:29.416
Nobody looked anything up.

00:04:29.416 --> 00:04:34.742
You each predicted the next word from everything you've read and heard on the wards.

00:04:34.742 --> 00:04:38.483
Hold on to that picture, because it's the whole next slide.

00:04:39.300 --> 00:04:44.300
That cloud is a pretty good picture of what's going on inside a chatbot every time it writes a word.

00:04:44.650 --> 00:04:49.521
Each of you drew on every sentence like this one you've ever read or heard.

00:04:49.521 --> 00:04:51.404
Nobody consulted a reference.

00:04:51.404 --> 00:04:56.730
And together, your answers made a spread, with a few likely words and a long tail.

00:04:57.133 --> 00:05:05.793
A chatbot has learned from millions of sentences like this one, and similar ones, and from how each of them was finished.

00:05:05.793 --> 00:05:13.093
From that it gives every possible next word a probability, a spread like yours, and then it picks one.

00:05:13.500 --> 00:05:18.747
The detail I most want you to keep: it doesn't look those sentences up while it answers.

00:05:18.747 --> 00:05:28.763
Training boiled them down into its dials, the same way the eight thousand patients behind the E G F R got boiled down into a handful of numbers in the E G F R equation.

00:05:28.763 --> 00:05:32.520
That's why it can't tell you where a particular fact came from.

00:05:32.520 --> 00:05:35.620
The rest of the talk is how that boiling down works.

00:05:36.433 --> 00:05:42.193
This is the trick that made modern chatbots possible, and once you see it, it's hard to unsee.

00:05:42.543 --> 00:05:43.855
Take any sentence.

00:05:43.855 --> 00:05:47.207
The patient was started on empiric vancomycin.

00:05:47.207 --> 00:05:52.526
Now turn it into a table, the same kind of table we used for the E G F R.

00:05:52.526 --> 00:05:57.919
The predictors are the words so far, and the target is the very next word.

00:05:57.919 --> 00:06:00.178
"The" is followed by "patient".

00:06:00.178 --> 00:06:02.728
"The patient" is followed by "was".

00:06:02.728 --> 00:06:08.703
And so on, down to "the patient was started on empiric", followed by "vancomycin".

00:06:09.133 --> 00:06:10.898
Why does this matter so much?

00:06:10.898 --> 00:06:13.150
Because nobody had to label anything.

00:06:13.150 --> 00:06:20.817
For the E G F R, someone had to measure G F R in eight thousand people, which is slow and expensive, to get the answer column.

00:06:20.817 --> 00:06:23.677
Here the answer is already sitting in the text.

00:06:23.677 --> 00:06:27.328
Every sentence ever written is a set of free training cases.

00:06:27.328 --> 00:06:35.604
In practice the "words so far" aren't a single sentence; they can be thousands, even hundreds of thousands, of tokens of preceding text.

00:06:35.604 --> 00:06:43.453
That's the reason these models could be trained on a large share of the written internet, and the reason they got so big so fast.

00:06:43.867 --> 00:06:47.574
Now ask the two questions from the previous session.

00:06:47.574 --> 00:06:50.568
Does the training data contain the answer?

00:06:50.568 --> 00:06:51.922
Yes, the next word.

00:06:51.922 --> 00:06:53.348
What does it output?

00:06:53.348 --> 00:06:58.481
A category: one token out of a vocabulary of about two hundred thousand.

00:06:58.481 --> 00:07:06.181
So a language model is a classifier, and a chatbot is that classifier run over and over, one word at a time.

00:07:06.181 --> 00:07:10.387
If you remember one sentence from today, that one would do.

00:07:11.200 --> 00:07:16.124
One small detail, because it explains some odd behavior you'll run into.

00:07:16.124 --> 00:07:18.723
The model doesn't actually read words.

00:07:18.723 --> 00:07:22.280
It reads tokens, which are words or pieces of words.

00:07:22.630 --> 00:07:30.968
The box runs a real tokenizer in your browser, the one OpenAI's G P T 4 oh models use, and nothing you type leaves your computer.

00:07:30.968 --> 00:07:38.983
The example sentence, started on empiric vancomycin and piperacillin-tazobactam, comes out as nineteen tokens for six words.

00:07:38.983 --> 00:07:42.344
Common words like "on" and "and" get one token each.

00:07:42.344 --> 00:07:44.606
Drug names get chopped into pieces.

00:07:44.606 --> 00:07:53.267
That's part of why a chatbot can be shaky with rare drug names, with spelling, or with counting letters: it never sees the word whole.

00:07:53.267 --> 00:07:59.989
And when a tool tells you about limits, how much text you can paste in, it's counting tokens, not words.

00:07:59.989 --> 00:08:04.190
For the rest of the talk, when I say "word", I really mean token.

00:08:04.540 --> 00:08:09.951
If you have the deck open, type a made-up sentence of your own and watch it split.

00:08:09.951 --> 00:08:12.260
Never use one about a real patient.

00:08:13.067 --> 00:08:19.777
A neural network only takes numbers, so each token gets turned into a list of numbers, called an embedding.

00:08:19.777 --> 00:08:21.533
Those numbers are dials too.

00:08:21.533 --> 00:08:27.867
The fitting loop sets them, and tokens that show up in similar sentences end up with similar numbers.

00:08:28.217 --> 00:08:31.676
This picture is illustrative; I placed the points by hand.

00:08:31.676 --> 00:08:36.806
Vancomycin ends up near linezolid because they turn up in the same kinds of sentences.

00:08:36.806 --> 00:08:38.953
The loop diuretics cluster together.

00:08:38.953 --> 00:08:42.114
Both groups are a long way from the days of the week.

00:08:42.114 --> 00:08:45.335
Nobody ever told the model that these are antibiotics.

00:08:45.335 --> 00:08:48.377
It worked that out from the company the words keep.

00:08:48.727 --> 00:08:49.964
Why should you care?

00:08:49.964 --> 00:08:55.282
It's why a chatbot seems to know drug classes and synonyms without anyone teaching it.

00:08:55.282 --> 00:09:03.198
If vancomycin and cefazolin sit close together, the model can write cefazolin into a sentence where it only ever saw vancomycin.

00:09:03.198 --> 00:09:13.155
It's also one reason it can slip a neighbor into a fluent sentence, one antibiotic where another belonged, without the sentence sounding any less sure of itself.

00:09:13.155 --> 00:09:16.247
The real lists have thousands of numbers, not two.

00:09:17.067 --> 00:09:20.367
On the word cloud you only had one sentence to go on.

00:09:20.367 --> 00:09:24.290
A model sees all the words so far, and that changes the answer.

00:09:24.290 --> 00:09:29.147
This slide is really about why the context you give a chatbot matters so much.

00:09:29.497 --> 00:09:30.777
Two short notes.

00:09:31.200 --> 00:09:38.289
Look at how they end: both with the sentence you just finished, the patient was started on empiric, blank.

00:09:38.289 --> 00:09:39.560
The same six words.

00:09:39.967 --> 00:09:46.847
In the first note, a few earlier words carry the weight: a central line, and mersa on her last admission.

00:09:47.267 --> 00:09:50.427
So vancomycin is far ahead.

00:09:50.833 --> 00:09:57.353
In the second, different words carry the weight: a healthy twenty-five-year-old, a lobar infiltrate, sent home.

00:09:57.767 --> 00:10:01.847
Now the likely next words are outpatient antibiotics for pneumonia.

00:10:02.267 --> 00:10:05.230
Same last six words, different next word.

00:10:05.230 --> 00:10:13.470
At every step, the model weighs every earlier word and decides which ones matter for the word it's about to write.

00:10:13.470 --> 00:10:15.928
That weighing is called attention.

00:10:15.928 --> 00:10:20.915
It's the core of the transformer, a design from 2017, the "T" in GPT.

00:10:20.915 --> 00:10:26.987
It's what lets a model use a whole page, or a whole conversation, as its predictors.

00:10:27.337 --> 00:10:37.633
And here's the practical payoff: whatever you put earlier in the conversation, who you are, what you're trying to do, what you've already ruled out, changes what comes next.

00:10:37.633 --> 00:10:40.906
A bare question gets the answer for an average patient.

00:10:40.906 --> 00:10:44.537
The probabilities on this slide are made up to show the idea.

00:10:44.887 --> 00:10:48.955
In a chat, "the words so far" is much more than your question.

00:10:48.955 --> 00:10:50.727
That's the next two slides.

00:10:51.533 --> 00:10:57.013
This is everything a chatbot does when it writes, and it's worth seeing it slowly once.

00:10:57.013 --> 00:11:01.988
Given the words so far, it produces a probability for every possible next word.

00:11:01.988 --> 00:11:06.271
One word gets picked, at random but weighted by those probabilities.

00:11:06.271 --> 00:11:07.468
It goes on the end.

00:11:07.468 --> 00:11:11.813
Then the whole thing runs again with one more word in the predictors.

00:11:12.163 --> 00:11:26.174
On the slide, the sentence so far is "the patient was started on empiric", and the bars show the made-up probabilities for the next word: vancomycin thirty percent, antibiotics twenty-four, then a tail.

00:11:26.174 --> 00:11:34.705
In the live session, pressing the button picked antibiotics, not the most likely word, and the sentence went on from there.

00:11:34.705 --> 00:11:42.403
If you have the deck open, press "Pick the next word" until the sentence ends, then start over and do it again.

00:11:42.753 --> 00:11:45.259
You get a different sentence each time.

00:11:45.259 --> 00:11:51.749
Every one of them is smooth, plausible clinical prose, and none of them was checked against anything.

00:11:51.749 --> 00:11:58.624
That combination, fluent and unchecked, is the thing I most want you to recognise when you use these tools.

00:11:58.624 --> 00:12:00.873
The probabilities here are made up.

00:12:01.223 --> 00:12:03.210
The slider is called temperature.

00:12:03.210 --> 00:12:06.883
Turn it down and the most likely word wins almost every time.

00:12:06.883 --> 00:12:09.712
Turn it up and the tail gets picked more often.

00:12:09.712 --> 00:12:16.395
Higher is what you'd want for creative writing, lower for answers you want to come out the same way every time.

00:12:16.395 --> 00:12:18.623
ChatGPT doesn't give you this slider.

00:12:18.623 --> 00:12:24.222
Developers can set it for some models, and the newest reasoning models don't allow it at all.

00:12:24.222 --> 00:12:31.446
Either way the pick is still partly random, which is why the same question can get a different answer each time you ask.

00:12:31.446 --> 00:12:39.815
That's also a cheap check you can run yourself: ask twice, and if the answers disagree on something that matters, you've learned something.

00:12:39.815 --> 00:12:48.183
A real model does this with about two hundred thousand tokens to choose from, looking back over thousands of words, with billions of dials.

00:12:49.000 --> 00:12:57.080
A student asked a great question in the live session: if a sentence starts with just "the", how does the model know to stay on track?

00:12:57.080 --> 00:13:01.880
The answer changes how you should think about every chat, so I want to show it.

00:13:02.230 --> 00:13:06.071
Here's what you think the model reads: your message.

00:13:06.071 --> 00:13:09.469
"Draft my entry." On its own, that's hopeless.

00:13:09.469 --> 00:13:10.725
Draft what entry?

00:13:10.725 --> 00:13:11.390
For whom?

00:13:11.800 --> 00:13:14.445
But the app doesn't send just your message.

00:13:14.445 --> 00:13:22.320
It sends the whole conversation so far, what you said and what it said, laid out as one long document with a label on each turn.

00:13:22.733 --> 00:13:29.733
In a Project, it also adds your project instructions, and pieces of your files that look relevant to what you just asked.

00:13:30.133 --> 00:13:33.961
With memory on, it adds notes about you from earlier chats.

00:13:33.961 --> 00:13:37.464
That's why ChatGPT seems to get to know you over time.

00:13:37.464 --> 00:13:40.253
It isn't learning; it's being handed notes.

00:13:40.667 --> 00:13:49.907
And at the very top, instructions from the company that you never see: who it is, today's date, what tools it has, what rules to follow.

00:13:50.333 --> 00:13:53.807
Then the model does the only thing it knows how to do.

00:13:53.807 --> 00:13:59.596
It predicts the next word of this entire document, which happens to end with "Assistant:".

00:13:59.596 --> 00:14:02.619
It's still the loop from the last three slides.

00:14:02.619 --> 00:14:06.929
What changed is the predictors: not your question, but all of this.

00:14:06.929 --> 00:14:14.133
That's why "draft my entry" works in a project set up as a journal coach, and would be nonsense in a fresh chat.

00:14:14.483 --> 00:14:16.267
The examples are illustrative.

00:14:16.267 --> 00:14:21.083
The company's actual hidden instructions are longer and aren't published in full.

00:14:21.900 --> 00:14:24.620
Now watch what happens over a conversation.

00:14:25.033 --> 00:14:31.113
Turn one: the hidden instructions, your project and memory, and your first message.

00:14:31.533 --> 00:14:32.168
Turn two.

00:14:32.168 --> 00:14:35.344
You might think the model remembers turn one.

00:14:35.344 --> 00:14:36.120
It doesn't.

00:14:36.120 --> 00:14:41.413
The app sends everything again: turn one, its answer, and your new message.

00:14:41.833 --> 00:14:45.035
Turn three: the whole thing again, a little longer.

00:14:45.035 --> 00:14:50.433
Every time you press Enter, the entire transcript goes back to the model from the top.

00:14:50.783 --> 00:14:53.126
Here's the part that surprises people.

00:14:53.126 --> 00:14:56.086
The model itself never changes during your chat.

00:14:56.086 --> 00:15:00.587
Nothing you type turns its dials; those were set in training, months ago.

00:15:00.587 --> 00:15:04.903
All the "memory" in a conversation is the transcript being sent again.

00:15:05.333 --> 00:15:08.482
And that has a limit, called the context window.

00:15:08.482 --> 00:15:15.434
It's large these days, but a chat that runs for four weeks can outgrow it, and then something has to give.

00:15:15.434 --> 00:15:21.599
The oldest parts get dropped or squeezed down, and the details from week one quietly drop out.

00:15:21.599 --> 00:15:23.173
You won't get a warning.

00:15:23.600 --> 00:15:25.866
One distinction worth getting right.

00:15:25.866 --> 00:15:28.447
Your chat doesn't change the model today.

00:15:28.447 --> 00:15:36.883
Whether it gets used to train next year's model is a separate question, and the answer is in the terms of service, not the technology.

00:15:36.883 --> 00:15:46.956
On a free or personal ChatGPT account, OpenAI may use your conversations for training unless you turn off "Improve the model for everyone" in the data controls.

00:15:46.956 --> 00:15:51.048
C U's agreement for ChatGPT Edu rules that out for our workspace.

00:15:51.048 --> 00:15:56.840
Which is a good reason to actually read the terms of the tools you use; the deck links them.

00:15:57.190 --> 00:15:58.850
Two practical things follow.

00:15:58.850 --> 00:16:03.950
Start a new chat when you start a new task, so old material doesn't steer the new one.

00:16:03.950 --> 00:16:11.243
And if something early in a long chat matters, say it again, or put it in the project instructions, which go in every time.

00:16:11.243 --> 00:16:17.350
It's also why, for a course journal, one chat per week works better than one chat for the whole course.

00:16:18.167 --> 00:16:20.922
So that's what the model does when you use it.

00:16:20.922 --> 00:16:22.480
Now, how does it get made?

00:16:22.480 --> 00:16:29.908
I think this part matters more than it sounds, because each stage of the recipe leaves fingerprints on how the tool behaves.

00:16:29.908 --> 00:16:30.687
Three stages.

00:16:31.500 --> 00:16:36.460
The whole recipe on one slide first, then we'll take the stages one at a time.

00:16:36.867 --> 00:16:38.478
Stage one is pretraining.

00:16:38.478 --> 00:16:45.633
The model reads trillions of words, from web pages, books, articles, and code, and learns to continue any text.

00:16:45.633 --> 00:16:50.854
What comes out is a document completer, and this stage is almost all of the cost.

00:16:50.854 --> 00:16:55.947
It's where the knowledge comes from, and also the gaps and the old information.

00:16:56.367 --> 00:16:58.344
Stage two is instruction tuning.

00:16:58.344 --> 00:17:07.363
People write thousands of example conversations, a request and then a good answer, and the model is trained on those with the same next-word loop.

00:17:07.363 --> 00:17:09.958
It learns what a helpful reply looks like.

00:17:09.958 --> 00:17:13.047
This is where the shape of the answers comes from.

00:17:13.467 --> 00:17:15.473
Stage three is preference tuning.

00:17:15.473 --> 00:17:23.012
People are shown two answers to the same request and pick the better one, and the model is nudged toward the kind that wins.

00:17:23.012 --> 00:17:29.700
If ChatGPT has ever shown you two answers and asked which you prefer, that's the kind of data this stage uses.

00:17:29.700 --> 00:17:33.348
This is where the tone comes from, including the confidence.

00:17:33.348 --> 00:17:36.267
Now you have the assistant you actually talk to.

00:17:36.667 --> 00:17:40.149
All three are the fitting loop from the previous session.

00:17:40.149 --> 00:17:41.554
Only the table changes.

00:17:41.554 --> 00:17:45.587
Keep that in mind and the rest of the talk is mostly consequences.

00:17:46.400 --> 00:17:48.511
This is one lap of pretraining.

00:17:48.511 --> 00:17:52.120
In the deck it's an animation; here is what it shows.

00:17:52.470 --> 00:17:56.205
A training case: the words so far, with the next word hidden.

00:17:56.205 --> 00:18:02.513
They go into the model with its billions of dials, and out comes a probability for every word it knows.

00:18:02.513 --> 00:18:04.227
Then the answer is revealed.

00:18:04.227 --> 00:18:08.636
The next word was vancomycin, and the model only gave it twelve percent.

00:18:08.636 --> 00:18:10.657
The loss is how surprised it was.

00:18:10.657 --> 00:18:19.046
That's the loss from the previous session, for words: the less probability it gave the word that actually came next, the bigger the loss.

00:18:19.046 --> 00:18:25.108
Then every dial gets turned a little, in the direction that would have made vancomycin more likely.

00:18:25.108 --> 00:18:29.150
Next time it meets words like these, it's a little less surprised.

00:18:29.500 --> 00:18:39.078
Then the next word, and the next, through clinical notes, prescriptions, history, computer code, other languages.

00:18:39.078 --> 00:18:43.740
For one model from 2024, about fifteen trillion tokens.

00:18:44.090 --> 00:18:49.055
Notice what the loop rewards: predicting the next word well, and nothing else.

00:18:49.055 --> 00:18:55.293
To predict the next word of a pharmacology textbook, it helps to have picked up some pharmacology.

00:18:55.293 --> 00:19:01.786
That's where the knowledge comes from, and honestly I still find it a little remarkable that it works.

00:19:01.786 --> 00:19:05.286
But nothing in the loop asks whether the text was true.

00:19:05.286 --> 00:19:11.970
A wrong forum post and a correct guideline are both just text to predict, and the model learns from both.

00:19:12.800 --> 00:19:17.835
A sense of scale, because "trillions" stops meaning anything after a while.

00:19:17.835 --> 00:19:23.274
The E G F R has fewer than ten numbers in it, fit to about eight thousand people.

00:19:23.274 --> 00:19:32.405
G P T 3, an ancestor of ChatGPT from 2020, had a hundred and seventy-five billion dials and was trained on three hundred billion tokens.

00:19:32.405 --> 00:19:44.960
Llama 3, an open model from Meta in 2024, has four hundred and five billion dials and was trained on about fifteen trillion tokens, using up to sixteen thousand specialised chips at once.

00:19:45.367 --> 00:19:54.399
If you read fifteen trillion tokens at two hundred fifty words a minute, eight hours a day, it would take you about a quarter of a million years.

00:19:54.399 --> 00:19:56.767
That's my arithmetic, not the paper's.

00:19:57.117 --> 00:20:04.049
It's also why building these is so expensive and uses so much energy, and why data centers keep coming up in the news.

00:20:04.049 --> 00:20:06.517
Good dinner conversation, if nothing else.

00:20:06.867 --> 00:20:08.871
Why does the scale matter to you?

00:20:08.871 --> 00:20:09.600
Two reasons.

00:20:09.600 --> 00:20:16.767
Only a handful of companies can afford to build these, so a few organisations decide what goes into the training text.

00:20:16.767 --> 00:20:25.514
And the companies behind ChatGPT, Claude, and Gemini don't publish these numbers, or the details of the training data, for their current models.

00:20:25.514 --> 00:20:32.621
So for the tools you use, the first appraisal question, what was it trained on, often doesn't have a detailed answer.

00:20:32.621 --> 00:20:34.686
That's not a reason to avoid them.

00:20:34.686 --> 00:20:36.387
It's a reason to check them.

00:20:37.200 --> 00:20:41.879
Here's the same prompt typed into one model at two points in its training.

00:20:41.879 --> 00:20:47.760
Both outputs are made up to show the difference, but each is typical of what that stage does.

00:20:48.110 --> 00:20:55.870
The prompt is an ordinary clinical question: first-line treatment for community-acquired pneumonia in a healthy adult outpatient.

00:20:56.300 --> 00:20:59.516
On the left, the model after pretraining only.

00:20:59.516 --> 00:21:00.775
It doesn't answer.

00:21:00.775 --> 00:21:05.180
It writes three more questions and then a line from a textbook.

00:21:05.600 --> 00:21:09.774
On the right, the same model after the two later stages.

00:21:09.774 --> 00:21:17.600
It answers: amoxicillin, with doxycycline or a macrolide as alternatives, which matches the US guideline.

00:21:18.000 --> 00:21:19.372
Neither one is broken.

00:21:19.372 --> 00:21:25.357
The pretrained model is doing exactly what it was trained to do, which is continue the document.

00:21:25.357 --> 00:21:38.949
Online, a list of questions is often followed by more questions, like the review sheet at the end of a chapter, or the Step 1 and Step 2 question banks you know well, so it guesses it's in one of those and keeps going.

00:21:38.949 --> 00:21:41.006
It has no idea anyone wants help.

00:21:41.006 --> 00:21:46.680
The next two stages close that gap by teaching it that a question is followed by an answer.

00:21:47.030 --> 00:21:52.979
I show you this because it's easy to assume the helpful, conversational voice is the model's nature.

00:21:52.979 --> 00:21:53.515
It isn't.

00:21:53.515 --> 00:21:55.181
It's a layer trained on top.

00:21:55.181 --> 00:22:00.357
This also isn't a hallucination: nothing on the left is false, it just isn't an answer.

00:22:00.357 --> 00:22:06.960
And you'll never meet the left-hand model in ChatGPT; every chat app you use has been through all three stages.

00:22:06.960 --> 00:22:15.230
Part of why chatbots have become so much better as assistants is bigger models, and part is that these later stages have gotten better too.

00:22:16.033 --> 00:22:18.004
Stage two, instruction tuning.

00:22:18.004 --> 00:22:27.791
People write example conversations, a request and then the answer they'd want to get, and the model is trained on those with the same next-word loop.

00:22:27.791 --> 00:22:33.309
The table is tiny compared with the internet, and it's written by people on purpose.

00:22:33.309 --> 00:22:37.513
Afterwards, a question gets an answer instead of more questions.

00:22:37.863 --> 00:22:39.750
Stage three, preference tuning.

00:22:39.750 --> 00:22:44.862
The model writes two answers to the same request, and a person picks the better one.

00:22:44.862 --> 00:22:47.904
The model gets adjusted toward the kind that wins.

00:22:47.904 --> 00:22:52.103
The literature calls this reinforcement learning from human feedback.

00:22:52.533 --> 00:22:55.319
These two stages punch well above their size.

00:22:55.319 --> 00:23:06.587
In the 2022 paper that described this recipe, people preferred answers from a model a hundred times smaller that had been through these stages over the full-size G P T 3 that hadn't.

00:23:06.587 --> 00:23:15.131
Keep that in mind when the course turns to responsibility: the biggest model isn't always the best choice, for you or for the environment.

00:23:15.131 --> 00:23:19.093
A model a hundred times smaller costs far less to build and run.

00:23:19.500 --> 00:23:23.341
And here's the catch, and it's the reason I spend time on this stage.

00:23:23.341 --> 00:23:29.075
The model is trained toward answers people rate well, and that isn't the same as answers that are true.

00:23:29.075 --> 00:23:35.978
A confident, complete-sounding answer tends to beat a cautious, partial one in those comparisons, whether or not it's right.

00:23:35.978 --> 00:23:38.371
People also tend to like being agreed with.

00:23:38.371 --> 00:23:44.940
So when a chatbot sounds sure, or goes along with the diagnosis you suggested, some of that is training, not evidence.

00:23:45.367 --> 00:23:50.559
The usual name for the going-along part is sycophancy: telling us what we want to hear.

00:23:50.559 --> 00:23:52.767
Push back on it and see what happens.

00:23:53.567 --> 00:24:02.241
This slide is the bridge in one place, and it's here so you can carry the appraisal questions from the previous session straight over to chatbots.

00:24:02.241 --> 00:24:03.727
Read it down the columns.

00:24:04.077 --> 00:24:10.054
The E G F R takes creatinine, age, and sex; the chatbot takes all the tokens so far.

00:24:10.054 --> 00:24:15.249
The E G F R predicts measured G F R; the chatbot predicts the next token.

00:24:15.249 --> 00:24:18.665
One is a regression, the other a classification.

00:24:18.665 --> 00:24:27.845
The E G F R was fit to about eight thousand people; the chatbot to trillions of tokens, then to examples and ratings from people.

00:24:27.845 --> 00:24:31.260
A handful of dials against hundreds of billions.

00:24:31.260 --> 00:24:35.317
The loss is a miss in one case and surprise in the other.

00:24:35.667 --> 00:24:38.272
The row I'd point you to is the last one.

00:24:38.272 --> 00:24:43.293
The E G F R was tested on about four thousand people from twelve other studies.

00:24:43.293 --> 00:24:48.187
A chatbot gets tested on benchmark questions, often licensing-exam questions.

00:24:48.187 --> 00:24:54.478
But if those questions and their answers were posted online, they may well be in the training text.

00:24:54.478 --> 00:25:00.707
Then the impressive score is the old mistake all over again: a score on cases it has already seen.

00:25:01.533 --> 00:25:05.675
Put the recipe together and it predicts, pretty well, how these tools behave.

00:25:05.675 --> 00:25:09.493
I find that reassuring, because it means the behavior isn't mysterious.

00:25:09.900 --> 00:25:12.501
First, it sounds the same when it's wrong.

00:25:12.501 --> 00:25:19.498
Nothing in any of the three stages checks whether a claim is true, and the model itself doesn't look anything up.

00:25:19.498 --> 00:25:25.380
A made-up citation and a real one are both plausible ways to continue "the original paper was".

00:25:25.800 --> 00:25:32.017
Second, it can answer differently each time, because the next word is picked partly at random.

00:25:32.017 --> 00:25:35.720
Ask twice and compare; it's the cheapest check you have.

00:25:36.133 --> 00:25:39.279
Third, it knows its training text, up to a date.

00:25:39.279 --> 00:25:43.932
The training population is part of the model, just as with the E G F R.

00:25:43.932 --> 00:25:46.291
What's common online, it knows well.

00:25:46.291 --> 00:25:54.679
What's rare, recent, or local, like your hospital's antibiogram, it may not know at all, and it won't necessarily tell you that.

00:25:54.679 --> 00:25:59.594
Ask it about yesterday's news with search turned off and it can't help you.

00:25:59.594 --> 00:26:02.543
That was everyday life with chatbots in 2023.

00:26:02.543 --> 00:26:12.373
Now the app can search the web and paste what it finds into the context, the words so far, which helps, but the search results then need checking too.

00:26:12.800 --> 00:26:18.377
Fourth, when you read that a model passed a licensing exam, ask the appraisal question.

00:26:18.377 --> 00:26:22.800
What was it tested on, and could it have seen those questions before?

00:26:23.200 --> 00:26:25.939
So: useful, often right, and never checked.

00:26:25.939 --> 00:26:29.951
I don't want you leaving with the idea that it's usually wrong.

00:26:29.951 --> 00:26:35.556
On common, well-documented questions, the most plausible continuation is often the fact.

00:26:35.556 --> 00:26:40.333
But the error rate isn't zero, and the tone doesn't change when it's wrong.

00:26:40.333 --> 00:26:42.116
So the checking is your job.

00:26:42.116 --> 00:26:49.250
You can ask the chatbot to check its own answer, and that helps up to a point, but the final check is a human's.

00:26:49.250 --> 00:26:52.880
The rest of this course is largely about doing that well.

00:26:53.700 --> 00:26:59.900
One study puts all of that together, and it happens to be about the E G F R from the previous session.

00:27:00.300 --> 00:27:09.620
In 2023, researchers asked four chatbots "How do I calculate E G F R?", and asked each question five times.

00:27:10.033 --> 00:27:17.918
Both ChatGPT 3.5 and G P T 4 had runs that promoted the race-based equation, the one the 2021 refit removed.

00:27:17.918 --> 00:27:23.393
Some runs justified it with false claims about muscle mass in Black people.

00:27:23.800 --> 00:27:27.018
The problem answers didn't show up in every run.

00:27:27.018 --> 00:27:30.840
And in some answers, the models simply made up equations.

00:27:31.267 --> 00:27:33.837
That's all three predictions at once.

00:27:33.837 --> 00:27:40.785
The training population: years of older text describing the race term outweighed one change in 2021.

00:27:40.785 --> 00:27:47.315
The random pick: whether you got the harmful answer depended on which run you happened to get.

00:27:47.315 --> 00:27:52.387
And no truth check: an invented equation reads exactly like the real one.

00:27:52.737 --> 00:27:56.907
Today's models may well do better on this question, and I'd expect them to.

00:27:56.907 --> 00:28:04.137
But the only way to know is the way we talked about in the previous session: test it, on cases that matter to you, more than once.

00:28:04.967 --> 00:28:06.700
That's the end of the talk.

00:28:06.700 --> 00:28:19.668
In the live session, the rest of the hour was time to get started with ChatGPT: opening the university's ChatGPT Edu, setting up a project as a learning journal, and having a first conversation with it.

00:28:19.668 --> 00:28:30.967
The steps are on the remaining slides of the deck, on talks dot seandavis dot net, and they're meant to be worked through at your own pace, with ChatGPT open in another window.

00:28:31.317 --> 00:28:34.484
As you work, watch for what the recipe predicts.

00:28:34.484 --> 00:28:37.123
Ask the same question twice and compare.

00:28:37.123 --> 00:28:42.467
When it gives you a source, open it and see whether it says what the answer says.

00:28:42.467 --> 00:28:46.557
And notice the tone, both when it's right and when it's wrong.

00:28:46.557 --> 00:28:47.877
Thanks for watching.
