By the end of this station, you can:
- Explain what tokens are and why models use them
- Describe text generation as repeated next-token prediction
- Explain why a fluent, confident answer can still be wrong
From recognizing to creating
Most of the AI we've covered makes predictions about existing things: Is this spam? Is this a cat? Generative AI uses what it learned to produce new content — essays, images, music, code.
A large language model (LLM) is a generative AI model trained on an enormous amount of text. Chatbots and writing assistants are built on top of LLMs.
Key terms
- Large language model (LLM)
- A very large neural network trained on huge amounts of text to predict likely next tokens, which lets it generate language.
- Token
- A chunk of text — a whole word, part of a word, or punctuation — that a language model reads and writes.
- Next-token prediction
- The core task of an LLM: given the text so far, estimate which token is most likely to come next.
- Prompt
- The input text you give a generative AI model to tell it what you want.
Step 1: Chop text into tokens
LLMs don't read letters the way you do. They split text into tokens. Common words are often a single token, while rare or long words get broken into pieces.
Each token is turned into numbers, since neural networks can only work with numbers.
Interactive lab
Token Vision
Type anything in the box. Each colored chip is one token — the chunk a language model actually reads. A “·” marks a space that belongs to the token.
- Characters
- 66
- Words
- 7
- Tokens
- 16
Tokens
- Token
- ization
- ·is
- ·un
- believ
- ably
- ·important
- ·for
- ·un
- ders
- tand
- ing
- ·chat
- bot
- s
- !
Real models use tokenizers learned from huge amounts of text; this is a simplified imitation. The token IDs here are made up too, but the idea is real: to a model, your sentence is a list of numbers.
Step 2: Predict the next token — again and again
Given “The team scored in the final,” a model estimates how likely every possible next token is: maybe “minute” is very likely, “seconds” is fairly likely, and “banana” is not.
It picks a token, adds it to the text, and repeats — one token at a time — until the response is done. A full paragraph is built from many small predictions.
Interactive lab
Next-Word Predictor
The model sees the prompt and scores possible next words. Click a word to add it, or let the model auto-pick. Try “high temperature” to see less likely choices.
Text so far
The best way to study for a test is to
Next-word candidates (illustrative probabilities)
Low temperature: the model always takes its top-scoring word — predictable, sometimes bland.
Knowledge check 1
+10 XP on first tryLearn moreWhat is “the model,” really?
After training, a model is essentially a giant file of numbers — the learned weights. It isn't a database of saved web pages that it looks things up in.
Most modern LLMs are based on the transformer, a neural network design introduced in a 2017 research paper. Transformers are good at tracking how words in a long passage relate to each other.
Knowledge check 2
+10 XP on first tryKey takeaways
- Generative AI creates new content; LLMs are generative models for text.
- LLMs split text into tokens and predict the next token, one at a time.
- The trained model is a huge set of learned numbers, not a fact database.
- Smooth writing can still contain errors — always verify important facts.
Sources for this lesson
- Ashish Vaswani et al.. Attention Is All You Need, 2017. Full citation
- University of Helsinki and MinnaLearn. Elements of AI. Full citation
Finish this station
Answer every knowledge check (right or wrong) to unlock completion.
- Knowledge check 1 — not answered yet
- Knowledge check 2 — not answered yet
0/2 checks answered