Learn · Track 4 of 5

AI, Explained

An AI is not magic, and it is not a person. See how a machine learns from examples, train your own fruit sorter, play the part of a language model and find out how a chatbot really answers you.

7 lessons 6 Try-it toys and steppers 1 quiz
? which one is closest?

An AI learns from examples, then guesses about things it has never seen.

LESSON 1

What is AI?

Your phone unlocks with your face and a video app guesses what you want to watch. Is that thinking?

A normal program follows rules that a person wrote, like a recipe: if this happens, do that. But try writing the rules for "this photo has a dog in it". Pointy ears? Fur? What about a dog in a hat, or a dog far away?

AI (artificial intelligence) takes another road. People show a computer lots of examples, and it finds the patterns by itself. That process is called training, and what comes out of it is a model: the thing that learned.

learned from examples

The next video

An app guesses what you might like from what millions of people watched.

learned from examples

Face unlock

It saw many faces, so it can tell yours from someone else's.

learned from examples

Searching "dog"

Your photo app found dogs without anyone writing rules for dogs.

learned from examples

A chatbot

It read a huge amount of text, and learned how people write.

Not the same thing: game AIThe zombies in a zombie game chase you because a person wrote rules for them, like "walk toward the player" and "attack when close". People call that "game AI", but it doesn't learn from examples. It's a recipe, not a trained model.
Go deeper

The examples an AI learns from are called data. An AI is only as good as its data. If the examples are missing something, or unfair to someone, the AI inherits that. That is called bias, and you'll see it happen in the next lesson.

The part of AI that learns from data is called machine learning. Chatbots are one kind of it.

In one sentence: A normal program follows rules a person wrote, and an AI finds patterns in lots of examples.

LESSON 2

Learning from examples

How can a machine tell an apple from a banana without anyone writing rules?

Imagine a robot that has to sort fruit. We describe each fruit with two numbers: how round it is and what color it is. Each fruit becomes a dot on a map. Apples end up in one area, bananas in another.

You are the teacher. Show it some examples, then give it a new fruit and see what it guesses.

Try it

Train a fruit sorter

Pick a button, then tap the map. In Teach mode each tap adds an example. In Test mode each tap is a new fruit, and the machine guesses by finding the closest example you gave it.

greenyellowred color long round roundness

Did you see it? If you only teach it red apples, a green apple fools it. The AI isn't dumb. It just never saw one. An AI only knows what was in its data. Teach it a green apple, and the mistake goes away.

KnobsThis toy simply remembers every example. Real AIs don't. A real model is full of knobs, which are numbers. Training means testing an example, and if the guess is wrong, nudging the knobs a tiny bit so it would be a little less wrong. Billions of nudges later, the knobs hold the patterns. A big model has billions of knobs.
Go deeper

When the data has gaps or leans one way, the AI does too. That is called bias. A face-unlock system trained mostly on one kind of face works worse on others. The fix is better, more varied data, and people checking the results.

In one sentence: An AI learns patterns from examples, so it only knows what was in its data.

LESSON 3

What is an LLM?

How can a chatbot write a whole story when all it does is guess?

An LLM (large language model) is a model trained on a huge amount of text: books, websites and code, many trillions of words. It was trained to do one single thing: guess the next word. Your phone keyboard suggests the next word too, but an LLM does it with far more skill.

It doesn't read letters or whole words. It cuts text into small pieces called tokens. A token can be a short word, part of a long word, or a punctuation mark. Type something and watch it get cut up.

Try it simplified

Cut text into tokens

This is simplified. A real tokenizer uses a list of tens of thousands of pieces it learned, so its cuts are different.

Try it

Be the language model

An LLM writes by choosing the next word, again and again. For each word, it gives every possible choice a chance. Now you take its place: pick the next word, or let the model pick for you.

Play it safe Surprise me

Pick the next word, or press “Let the model pick”.

Honest note: the numbers in this toy are made up. A real LLM computes them from everything it learned. And it doesn't pick the same way every time, so the same question can get different answers.

Go deeper

The slider is called temperature in real LLMs. A low setting nearly always takes the most likely word, so the text is safe but can be boring. A high setting takes more risks, so the text is more surprising and also more likely to go wrong.

In one sentence: An LLM is trained on huge amounts of text to guess the next token, and a long answer is just that guess repeated.

LESSON 4

How an LLM answers you

What really happens between the moment you press Send and the moment the answer appears?

There are two big parts. Part 1 happens once, long before you arrive. Part 2 happens every time you chat. Click through the steps.

PART 1 · TRAININGhappens once, takes months 📚 Giant librarybooks, websites, code…written by people 🏭 Data centerthousands of GPUstune billions of knobs 🧠 The modela huge file of numbersno copy of the books reads saves PART 2 · CHATTINGhappens every time, takes seconds runs in a data center 📋 hidden instructions 🔎 optional tools 💬 Questionyour message ✂️ Tokenscut into pieces 🧠 The modelguesses the next token ➕ add the word … his sword packets next repeat, word by word 📝 The answershown to you, word by word until “done” PART 1 · TRAININGhappens once, takes months 📚 Giant librarybooks, websites, code…written by people reads 🏭 Data centerthousands of GPUstune billions of knobs saves 🧠 The modela huge file of numbersno copy of the books PART 2 · CHATTINGhappens every time, takes seconds 💬 Questionyour message packets runs in a data center ✂️ Tokenscut into pieces 🧠 The modelguesses the next token 📋 hidden instructions 🔎 optional tools ➕ add the word … his sword repeat, word by word until “done” 📝 The answershown to you, word by word

Three ideas to keep

idea 1

Knowledge has a date

It only knows what was in its data, up to the day training ended. Unless it uses a search tool, it doesn't know about last week.

idea 2

It predicts, it doesn't look up

By default it remembers patterns. That's why it sometimes makes things up with total confidence. That is called a hallucination.

idea 3

It has no feelings

It sounds kind because it learned from kind text written by people. It doesn't care about you, and it doesn't get tired or sad.

Go deeper

The hidden instructions are called the system prompt. A company can use it to tell the model how to behave, for example "be friendly and don't help with cheating". What you type is the prompt.

When a chatbot uses a tool, such as a web search or a calculator, it can bring in fresh facts. That's also where AI agents begin, which is the lesson after next.

In one sentence: An LLM is trained once on a library of text, and then it answers you by guessing the next token over and over.

LESSON 5

The data behind it

Why can a chatbot only talk about what it has read?

Here is the best way to see that an AI depends on its data: build a tiny language model yourself. It reads your sentences, and remembers one thing: which word comes after which. Then it writes new text, one word at a time, using only what it learned.

Try it

Build a tiny language model

Press Train and I'll learn which word follows which.

Nothing you type here is sent anywhere or saved. It all happens on your device.

Try asking for a word that isn't in the data, like spaceship. It can't say it, because it never read it. Now delete all the dragon sentences and train again: it can't talk about dragons anymore. What an AI can say is limited by what it read.

Real LLMs work on the same idea, but they are many millions of times bigger. They read trillions of words, and they look at a long stretch of text before guessing, not just the last word. This toy only looks one word back, so its sentences ramble.

Go deeper

What you just built is called a bigram model: it counts pairs of words. When you train it, it writes down, for each word, the list of words that came after it. To write, it picks one from the list by chance. A word that appears after "the" three times is three times more likely to be picked than a word that appears once.

In one sentence: A language model can only write with what it read, and a bigger library of text makes it much more capable.

LESSON 6

What is an AI agent?

What's the difference between a chatbot that talks and an AI that gets things done?

A chatbot writes an answer. An agent is an LLM that can also use tools, like a weather lookup, a web search or a calendar, and take several steps to reach a goal.

It works in a loop: think about what to do, act by using a tool, look at the result, and repeat until the job is done. Follow this one step by step.

Try it

Follow an agent

Think→Act (use a tool)→Look at the result→Repeat→Done

Good to knowGood agents ask permission before they do something important, like sending a message, buying something or deleting a file. And a person should always check the result.
Go deeper

An agent can also get something wrong in the middle of the loop, for example by reading a tool's answer badly, and then keep going from that mistake. That is one more reason to check the final result and to give agents only the permissions they really need.

In one sentence: An agent is an LLM that thinks, uses tools, looks at the result and repeats, and it should ask permission before important actions.

LESSON 7

Using AI smart and safe

How do you get the best from an AI without getting tricked or hurt?

AI is a powerful tool, and like any tool it works best when you know its limits. Six habits will keep you safe and sharp:

1

Check it

An AI can be wrong with total confidence. Confirm important things with a second source or an adult.

2

Keep private things private

What you type into a chatbot goes to a company's computers. The rules from Stay Safe apply here too: no address, school, phone number or passwords.

3

Fakes exist

AI can make fake photos, voices and videos, called deepfakes. If something is shocking, find out where it came from before you believe or share it.

4

Ask an adult about age rules

Many AI apps have rules about how old you must be. Ask an adult before you use one.

5

Learn, don't skip learning

Ask it to explain, not to do your homework. Your brain needs the exercise, just like a muscle.

6

It's not a friend or a therapist

A chatbot can sound caring, but it doesn't have feelings. If something worries you, talk to a person you trust.

More safetyWant the full set of online safety habits? Visit Stay Safe Online.

In one sentence: Check what AI says, keep private things private, and use it to learn, not to skip learning.

QUIZ

Check what you learned

6 questions about this track. Pick an answer to see if you got it right. Your answers are saved only on this device.

Next track

Stay Safe Online

How the site protects players, and how to spot fake sites, build strong passwords and keep personal info private.

Go to track 5 →