How LLMs work
Tokens, prediction, temperature and prompts, explained simply.
Time this week: 6–8 hours
By Sunday you can explain how ChatGPT, Claude and Gemini produce text, what a system prompt is, and why models 'hallucinate'.
You can't protect something you don't understand. Almost every AI attack abuses one simple fact: the model just predicts the next word from all the text it is given.
Start here: this week's labs
The model is guessing the next word
"The hacker guessed the ___"
Low temperature: almost always picks "password". High temperature: sometimes picks the less likely words.
Key ideas
LLM
Large Language Model. A program trained on huge amounts of text to predict the next piece of text. ChatGPT, Claude and Gemini are LLM products.
Tokens
Models read text in small chunks called tokens (often part of a word). Prices and limits are counted in tokens.
Next-token prediction
The model looks at all the text so far and guesses the most likely next token, again and again.
Temperature
A setting for randomness. Low = safe and repeatable. High = creative and surprising.
Context window
How much text the model can 'see' at once: system prompt + chat history + documents + your message.
System prompt
Hidden instructions the app gives the model before your message, like 'You are a helpful bank assistant. Never share account data.'
Hallucination
When the model confidently makes things up. It predicts text that sounds right, not text that is checked.
Day-by-day plan
Tick each day when you finish it. Your ticks are saved in this browser.
Mini game: Where does it live in the context?
Practice outside this course (free)
Short, visual video. Search the channel for 'Large Language Models explained briefly'.OpenAI Tokenizer
Paste text and see how it splits into tokens.Anthropic prompt engineering docs
See how system prompts are written. Search for 'prompt engineering'.
These links need the internet. Everything else on this page works offline.
Exercises & worksheet
Weekly quiz
Mark it done to fill your progress bar on the course home.