Guess the next word
Hi, I'm your agent. Well, I will be! Right now I'm just an LLM. Let's see what that means.
An LLM is an AI that has read a huge amount of text. It does one thing: guess the next word.
Which word comes next? Guess first.
The cat sat on the
The LLM's chances for the next word:
Every word gets a chance. Together they make 100%:
52 + 21 + 15 + 9 + 3 = 100
One guess gives one word. How does it write a whole answer?
One word at a time
The LLM guesses a word, adds it to the text, then guesses again. Here it picks the word with the biggest chance.
🤔 Does it always pick the biggest chance?
Ours does, to keep things simple. Real chatbots sometimes pick a less likely word on purpose. That's why the same question can get different answers.
Watch it write its answer, one guess at a time.
One guess, one word. A 7-word answer takes 7 guesses.
words written = guesses made
Try it on new numbers.
✏️ Practice 0.1
New numbers, same ideas.
Remember: all the chances = 100%
Our LLM picks the word with the biggest chance.
words written = guesses made
Work each one out. Type the answer, press Check.
“I walked my ___”: dog 40%, cat 35%. What is the chance of all the other words together, in %?
“Tomorrow there will be ___”: rain 30%, sun 45%, snow 25%. What is the chance of the word our LLM writes, in %?
An answer is 12 words long. How many guesses did the LLM make?
One guess takes 0.05 seconds. How many seconds does a 40-word answer take?
An LLM writes very well. But what can't it do?
Only words
An LLM reads text and writes text. Nothing else.
Ask the LLM. Then check its answer.
It writes words that sound right. But on its own it can't be sure its math is right, can't look up anything new, and can't do anything.
🤔 But ChatGPT can search the web!
Yes, because it isn't just an LLM. It's an LLM plus tools, like a search. That's an agent, and it's what you'll build in this course.
Quick check: did it all make sense?
Lesson 0 test
5 questions, one for each idea in this lesson. Answer them all right to pass. A wrong answer tells you why, and which page to look at again.
1. Chances“The sky is ___”: blue 70%, grey 20%. What's the chance of all the other words together?
2. PredictAn LLM writes a 20-word answer. How many guesses does it make?
3. ApplyNext-word chances: rain 30%, sun 45%, snow 25%. What does our LLM write?
4. Spot the mistakeA friend says: “The LLM read today's news to answer me.” What's wrong?
5. ThinkYou ask an LLM “What is 97 × 86?” It answers 8,342. Should you trust it?
What your LLM still can't do.
Words aren't actions
Your LLM writes very well. But writing “I'll remind you” doesn't set a reminder.
I can write anything… but I can't do anything. Yet.
This leaves a question
An LLM can only write text. How can writing text make something happen?