Three letters
AI stands for artificial intelligence: getting computers to do things that need intelligence when a person does them. Understanding a sentence, recognising a face, translating, writing code, planning the steps of a task.
The name is older than most people think. It was coined in 1955, in a proposal for a summer workshop at Dartmouth College in the United States. Its authors guessed that “every aspect of learning” could in principle be described so precisely that a machine could do it. It took about seventy years, and much faster computers, for that guess to start paying off.
Today, when people say “AI”, they almost always mean one particular kind: machine learning, and inside that, large language models (LLMs), the programs behind ChatGPT, Claude, Gemini, DeepSeek, Qwen, Kimi and many others. This course is mostly about them, because they are where the action is, but it also covers the models that see, draw, listen and move.
Rules written by hand, or rules learned
There are two ways to make a computer do something clever.
The old way: write the rules
- A programmer thinks of every rule and types it in: “if the email contains free money, it is spam”.
- Works well when the rules are clear, like a calculator or a tax form.
- Breaks on messy things. Nobody can write down the rules for recognising a cat or understanding a joke.
The new way: learn from examples
- You show the program many examples: thousands of emails, each marked spam or not spam.
- The program adjusts itself, little by little, until its answers match the examples.
- The “rules” it ends up with are millions or billions of numbers that nobody wrote by hand.
That second way is machine learning. The thing that learns is called a model, and the numbers inside it are called its weights or parameters. Learning means changing those numbers so the model gets better at its task.
Which way would you build each of these?
-
Adding up the prices in a shopping basket
Answer: Write the rules
-
Turning speech into text
Answer: Learn from examples
-
Checking that a password has at least 12 characters
Answer: Write the rules
-
Translating Urdu into English
Answer: Learn from examples
-
Spotting tumours in X-ray images
Answer: Learn from examples
-
Converting kilometres to miles
Answer: Write the rules
What a language model does
A large language model does one thing, over and over: given some text, it works out how likely every possible next piece of text is, then one piece is picked. The pieces are called tokens (often a whole word, sometimes part of a word). The new token is added to the text, and the model goes again.
The model has read “The sky is” and given every possible next token a score. Here are the top six, turned into chances. Press the button to pick one at random, weighted by those chances. Then change the temperature and pick again.
This interactive part needs JavaScript.
That is the whole trick. A reply of 300 words is this loop run about 400 times. A model that predicts the next token really well has to pick up grammar, facts, reasoning patterns and style along the way, because all of those help it predict.
- Your messagePlain text
- TokensThe text cut into pieces, each with a number
- The modelBillions of weights turn the tokens into a score for every possible next token
- Pick oneUsually at random, weighted by the scores
- RepeatAdd it to the text and go again until the answer is done
Quick check
A model is a file of numbers
Strip away the app and the chat window, and a model is a file. Inside are its weights: a long list of numbers. A model called Llama 3.1 8B has about 8 billion of them (the “8B” in the name). Stored at 16 bits each, that is about 16 GB. Squeezed down to about 5 bits each, it is about 4.9 GB, small enough for a normal laptop.
You need two things to use a model: the file of weights, and a program that knows how to run it. On your own computer that program might be llama.cpp or Ollama. In a data centre it might be vLLM or SGLang. You will use some of these yourself later in the course.
| Training | Inference | |
|---|---|---|
| What happens | The weights are adjusted, again and again, so the model predicts its training text better | The weights stay fixed; the model is used to answer |
| How often | Once (plus some later fine-tuning) | Every time anyone uses it, millions of times a day |
| Cost | Huge: thousands of GPUs for weeks or months | Small per answer, but it adds up |
| Who does it | The lab that makes the model | Anyone with the file and a program to run it |
Where this course goes
Everything you will learn builds on this one picture: text goes in, numbers do the work, a next token comes out. The course takes it apart piece by piece.
- The basics and the maths: what vectors, matrices and probabilities are, and how computers store numbers. Gently, and only what is needed.
- How machines learn: neural networks, and the method that adjusts billions of weights at once.
- Inside a language model: tokens, embeddings, attention, the transformer, mixture of experts.
- Training: how a model reads trillions of tokens, becomes an assistant, and learns to reason.
- Inference: what happens when you press Enter, and how to run models on your own machine.
- Agents: models that use tools, and the harnesses that run them.
- Beyond text, and the frontier: images, sound, robots, how models are measured, and how to read the papers.
Remember
- AI means getting computers to do things that need intelligence. Today it mostly means machine learning: programs that learn from examples instead of following hand-written rules.
- A model is a file of numbers called weights. Learning means adjusting them.
- A language model predicts the next token, again and again. That loop is how every reply is written.
- Training makes the weights (rare, very expensive). Inference uses them (every time you ask something).
- The weights do not change while you chat. The conversation so far, the context, is sent again with every message.
Words to know
- Artificial intelligence (AI)
- Computers doing tasks that need intelligence when people do them.
- Machine learning
- Making a program learn its own rules from examples, instead of writing the rules by hand.
- Model
- The thing that learns: a structure plus a large set of numbers.
- Weights (parameters)
- The numbers inside a model. “8B” means about 8 billion of them.
- Large language model (LLM)
- A very large model trained on text to predict the next token.
- Token
- A piece of text, often a word or part of a word. Models read and write tokens.
- Training
- Adjusting the weights so the model gets better at its task.
- Inference
- Using a trained model to produce an answer. The weights stay fixed.
- Context
- All the text a model is given at once: instructions, the conversation so far, documents.
- Open-weight model
- A model whose weight files are published, so anyone can download and run it.
Go to the source
This lesson is built on these papers and documents. Paper links open arxiv.org, a separate site.
-
A Proposal for the Dartmouth Summer Research Project on Artificial Intelligence
Where the words “artificial intelligence” first appeared. The proposal itself is the first few pages, and easy to read.
-
Attention Is All You Need
The transformer, the design behind almost every language model today. You will be able to read it by the end of part 4.
-
The Llama 3 Herd of Models
A full report on how one open-weight family was built, from data to training to inference.
Check yourself
5 questions. Tap the answer you think is right.
0 of 5 answered
Lesson complete
Answer every question above to complete this lesson.
Your progress is saved on this device only.
Next lessonHow we got here: 75 years in 15 minutes