The AI World · Article 1

Welcome to the awesome world of Artificial Intelligence

From “what even is AI?” to attention heads, gradients and agents, in one sitting.

By Mrinal Singh Raja22 min read

How to read this

Every section is tagged with how deep it goes. New to AI? Read the green ones and skim the rest; the diagrams carry the story. Already technical? Jump straight to the red ones.

BeginnerIntermediateAdvanced

You have already used artificial intelligence a dozen times today. It unlocked your phone, sorted your inbox, guessed your commute, picked the next song and quietly checked that your last card payment was really you. You probably did not notice any of it — and that is the best sign of how deeply AI is now woven into ordinary life.

Then, in late 2022, AI stopped being invisible. Suddenly anyone could type a question in plain English and get back an essay, a poem, a working program or a patient explanation of quantum physics. The world noticed. Since then the pace has only picked up.

This is the first article in The AI World, a series on MSRX about how this technology works and what it means. We will start with no assumptions at all, and by the end we will be inside a transformer, reading its equations. Take it one section at a time.

  1. 07:00

    Face unlock

    A vision model checks your face against a stored template.

  2. 08:15

    Maps ETA

    Traffic models predict how long each road will take.

  3. 10:30

    Spam filter

    A classifier decides which mail you never see.

  4. 13:00

    Recommendations

    The next song or video is picked from what people like you played.

  5. 16:45

    Fraud check

    Your card payment is scored for risk in milliseconds.

  6. 21:00

    Chat assistant

    A large language model writes, explains and codes with you.

Fig. 1A normal day, full of AI you never see. Each of these is a trained model making a prediction.
01Beginner

What is AI, really?

Artificial intelligence is the craft of getting computers to do things that, if a person did them, we would say needed intelligence: recognising a face, understanding a sentence, planning a route, spotting a tumour on a scan, writing a reply.

For most of computing history, we made computers useful by writing out every rule by hand. To calculate tax, a programmer writes the tax rules. That works brilliantly when the rules are clear. But try writing the rules for “is this a photo of a cat?” Pointy ears? Some dogs have them. Whiskers? So do seals. Four legs? Not if the cat is curled up. You would never finish.

Modern AI flips the approach. Instead of giving the computer the rules, we give it examples — thousands of cat photos and thousands of not-cat photos — and let it work out the rules itself. That idea is called machine learning, and it is the engine behind almost everything called AI today.

Traditional programming

Rules (your code)
Data
Computer
Answers

Machine learning

Data
Answers (labels)
Learning algorithm
Rules (a model)
Fig. 2The big flip. Classic software turns rules into answers; machine learning turns answers into rules.
02Beginner

AI, ML, deep learning, GenAI: the family tree

These words get used interchangeably in the news, but they are actually nested inside each other, like Russian dolls.

  • Artificial Intelligence is the whole field — including old-school programs built from hand-written rules, like early chess engines and “expert systems”.
  • Machine Learning (ML) is the part of AI that learns from data rather than following rules someone typed in.
  • Deep Learning is the part of ML that uses neural networks with many layers. It took over around 2012, and it is what made speech recognition, face ID and modern translation work well.
  • Generative AI is deep learning that creates new content — text, images, music, code, video — instead of only labelling things. Large language models (LLMs) such as ChatGPT, Claude and Gemini live here.
Nested circles: Artificial Intelligence contains Machine Learning, which contains Deep Learning, which contains Generative AI and large language models.Artificial IntelligenceAny way of making machines act smart, even fixed rulesMachine LearningLearns patterns from data instead of rulesDeep LearningMany-layered neural networksGenerative AILLMs, image & videogeneratorschess engines,expert systemsspam filters,decision trees
Fig. 3Each circle is a subset of the one around it. All generative AI is deep learning, but plenty of AI is not.
03Beginner

A 75-year story in two minutes

AI feels brand new, but the dream is older than the personal computer. The history is a rollercoaster of big promises, crushing disappointments (the “AI winters”) and, recently, breakthroughs that arrived faster than even researchers expected.

  1. 1950

    Turing asks “Can machines think?”

    Alan Turing’s paper proposes the imitation game, later called the Turing test.

  2. 1956

    The field gets its name

    The Dartmouth workshop, organised by John McCarthy and colleagues, launches “artificial intelligence” as a discipline.

  3. 1958

    The Perceptron

    Frank Rosenblatt builds a machine that learns to classify simple images: the first trainable neural network.

  4. 1966

    ELIZA chats

    Joseph Weizenbaum’s pattern-matching chatbot convinces some users it understands them.

  5. 1970s–90s ❄️

    AI winters

    Promises outrun results twice; funding and interest collapse, then slowly return.

  6. 1986

    Backpropagation spreads

    Rumelhart, Hinton and Williams show how to train multi-layer networks efficiently.

  7. 1997

    Deep Blue beats Kasparov

    IBM’s chess machine defeats the world champion in a six-game match.

  8. 2012

    AlexNet and the deep learning boom

    A GPU-trained neural network wins the ImageNet challenge by a wide margin.

  9. 2016

    AlphaGo beats Lee Sedol

    DeepMind’s system wins 4–1 at Go, a game long thought decades out of reach.

  10. 2017

    “Attention Is All You Need”

    Google researchers introduce the Transformer, the architecture behind today’s language models.

  11. 2020

    GPT-3 and AlphaFold 2

    A 175-billion-parameter language model writes fluent text; AlphaFold predicts protein structures with near-experimental accuracy.

  12. 2022

    ChatGPT goes public

    A chat interface puts a large language model in front of the general public, and adoption is explosive.

  13. 2024

    Nobel Prizes for AI

    Physics: Hopfield and Hinton for neural-network foundations. Chemistry: Hassabis and Jumper for AlphaFold, shared with David Baker.

  14. 2024 →

    Reasoning models and agents

    Models trained to think step by step, use tools and carry out multi-step tasks on their own.

Fig. 4Key moments in AI. Hollow markers show the two “AI winters”, when funding and interest collapsed.

Notice the pattern after 2012. Three ingredients arrived at once: huge datasets (the internet), cheap parallel computing (graphics cards, GPUs, originally built for video games) and better algorithms. Neural network ideas from the 1980s suddenly worked, because we finally had enough data and compute to feed them.

04Beginner

Narrow, general and super AI

You will hear people argue about “AGI”. It helps to picture three rungs on a ladder.

Here today

Narrow AI (ANI)

Superhuman at one job — chess, face ID, translation — and useless outside it. Today’s chat models are far broader than any before, yet still stumble in ways a person would not.

Hotly debated

General AI (AGI)

Matches a capable person across most thinking tasks, learning new ones as fast. Nobody agrees on the exact test, or on the date.

Hypothetical

Superintelligence (ASI)

Beyond the best humans at nearly everything. The main subject of long-term safety research.

Fig. 5The capability ladder. Where exactly today’s systems sit — and when the next rung arrives — is one of the most debated questions in technology.

A chess engine that beats every human alive cannot tell you what a chair is. That is narrow AI. Today’s large language models are strange in that they are wide — they can write, code, tutor and translate — yet they still make mistakes no careful person would, and they do not learn from experience the way you do. Whether scaling up the current approach reaches artificial general intelligence, or whether new ideas are needed, is genuinely open.

05Intermediate

How machines learn

Machine learning comes in three main flavours, depending on what kind of feedback the machine gets while it learns.

Supervised

Learning with an answer key

🐱🐱🐱🐱🐱🐶🐶🐶🐶🐶

Shown thousands of photos labelled “cat” or “dog”, it learns the line between them. Used for: spam filters, price prediction, medical scans.

Unsupervised

Finding groups on its own

No labels at all. It notices which things resemble each other. Used for: customer segments, anomaly detection, topic discovery.

Reinforcement

Learning by trial and reward

🤖 Agent🌍 World(game, robot)actionreward +1 / −1

Like training a puppy with treats: good moves are rewarded and repeated. Used for: AlphaGo, robotics, tuning chatbots.

Fig. 6Supervised learning uses labelled answers; unsupervised finds structure on its own; reinforcement learns from rewards.

There is also an important fourth idea: self-supervised learning. Here the data labels itself. Hide the next word in a sentence and ask the model to guess it; the real next word is the answer key. Since every sentence on the internet can be turned into practice questions this way, self-supervision unlocked training on truly vast amounts of text. It is exactly how large language models are pre-trained.

The machine-learning workflow

Whatever the flavour, real projects follow roughly the same loop. Beginners are usually surprised by how much of the work is data rather than clever algorithms.

  1. Collect data

    photos, logs, text

  2. Clean & label

    fix errors, add answers

  3. Split

    train / validation / test

  4. Train

    fit the parameters

  5. Evaluate

    on data it never saw

  6. Deploy & monitor

    serve predictions

models drift as the world changes — monitor, collect new data, retrain

Fig. 7A typical ML project. Most of the time goes into the first two boxes — and into the loop back from monitoring.
06Intermediate

Neural networks: brains made of maths

Neural networks are loosely inspired by the brain, but do not take the metaphor too far. An artificial neuron is a tiny calculator. It takes some numbers in, multiplies each by a weight (how much it trusts that input), adds them up with a bias, and squashes the result through an activation function.

An artificial neuron: three inputs are multiplied by weights, summed with a bias, passed through an activation function, and produce one output.x₁×w₁x₂×w₂x₃×w₃inputsΣ+ bias bweighted sum zactivation σ(z)youtput
Fig. 8One artificial neuron. Every weight w and the bias b are learned during training.

y = σ( w₁x₁ + w₂x₂ + … + wₙxₙ + b ) = σ( w·x + b )

output = activation( weighted sum of inputs + bias )

On its own, one neuron is not very smart. Try it yourself: here is a single neuron deciding whether to take an umbrella.

Playground

One neuron: “Should I take an umbrella?”

Inputs (the world)

0.7

0 = clear sky, 1 = dark clouds

0.4

0 = 0 %, 1 = 100 %

Parameters (what training learns)

3.0
4.0
-3.0

z = 3.0·0.7 + 4.0·0.4 + (-3.0) = 0.70  →  σ(z) = 0.668

☂️ Take the umbrella — the neuron is 67 % sure it will rain.

Drag w₂ below zero and the neuron starts distrusting the forecast. Training is nothing more than nudging these three knobs, millions of times, until the answers stop being wrong.

The magic happens when you connect thousands or billions of them in layers. The first layer of an image network might learn to detect edges; the next combines edges into corners and curves; the next into eyes, wheels and letters; the last decides “cat” or “dog”. Nobody programs those features — they emerge from training.

A feed-forward neural network with an input layer of four neurons, two hidden layers of five, and an output layer of two. Every neuron connects to every neuron in the next layer.Input layerpixels, words, numbersHidden layer 1edges, simple shapesHidden layer 2eyes, ears, wheelsOutputcat? dog?0.94 cat0.06 dogsignals flow left → right (forward pass)
Fig. 9A small feed-forward network. “Deep” learning simply means many hidden layers — modern models have dozens to over a hundred.
07Advanced

How a network learns: loss, gradients and backprop

A freshly created network has random weights, so its answers are garbage. Training fixes that in a loop that repeats millions of times:

  1. Forward pass. Feed in an example and get a prediction.
  2. Measure the loss. A loss function turns “how wrong was that?” into one number. For classification the usual choice is cross-entropy: L = −log p(correct class). Confidently wrong answers are punished hard.
  3. Backward pass (backpropagation). Using the chain rule from calculus, work out for every single weight how much the loss would change if that weight were nudged. That list of sensitivities is the gradient.
  4. Update. Move every weight a tiny step in the direction that reduces the loss.

θ ← θ − η · ∇θ L(θ)

new weights = old weights − learning rate × gradient of the loss

A U-shaped loss curve. A ball starts high on the left slope and takes smaller and smaller steps downhill until it settles at the minimum, where the error is lowest.a model weight w →error (loss) ↑start: random weightsminimum ✓the slope (gradient) says which way is downhill;the learning rate η sets how big each step is
Fig. 10Gradient descent. Imagine standing on a foggy hillside: you cannot see the valley, but you can feel which way the ground slopes, so you keep stepping downhill.

In practice nobody computes the gradient over the whole dataset at once. We use mini-batches of, say, 32 to a few thousand examples (stochastic gradient descent), and smarter update rules such as Adam, which gives each parameter its own adaptive step size. One full pass through the data is an epoch.

train.py — Python
import torch
import torch.nn as nn

model = nn.Sequential(                 # a tiny neural network
    nn.Linear(784, 128), nn.ReLU(),    # 28×28 pixels in → 128 hidden neurons
    nn.Linear(128, 10),                # → 10 scores, one per digit 0–9
)
loss_fn = nn.CrossEntropyLoss()
opt = torch.optim.Adam(model.parameters(), lr=1e-3)

for epoch in range(5):
    for images, labels in train_loader:
        logits = model(images.view(-1, 784))   # 1. forward pass
        loss = loss_fn(logits, labels)         # 2. how wrong?
        opt.zero_grad()
        loss.backward()                        # 3. backprop → gradients
        opt.step()                             # 4. gradient-descent step
    print(f"epoch {epoch}: loss {loss.item():.3f}")
$ python train.py
epoch 0: loss 0.312
epoch 1: loss 0.184
epoch 2: loss 0.097
epoch 3: loss 0.121
epoch 4: loss 0.064
Fig. 11Illustration: a complete training loop for a handwritten-digit classifier in PyTorch, with sample output.

Overfitting: the student who memorised the answers

A model with enough parameters can simply memorise its training data, noise and all. It then looks brilliant in training and fails on anything new. The opposite problem, underfitting, happens when the model is too simple to capture the pattern at all.

Underfit

too simple — misses the trend

Good fit

captures the pattern

Overfit

memorises the noise

Fig. 12The same data, three models. The goal is the middle one: a model that generalises.

The defences are more (and more varied) data, regularisation (penalising extreme weights, or dropout, which randomly switches neurons off during training so none can be relied on too heavily), and early stopping when validation loss starts rising. Curiously, very large modern networks often generalise well even with enough capacity to memorise everything — a phenomenon researchers are still working to fully explain.

08Intermediate

Architectures: the shapes of networks

How the neurons are wired matters as much as how many there are. Each architecture builds in an assumption about the data it will see.

CNN

Convolutional Neural Network

Slides small filters across an image, detecting edges, then textures, then objects.

Best at: Photos, X-rays, self-driving cameras

RNN / LSTM

Recurrent Neural Network

Reads a sequence one step at a time, carrying a memory forward. Slow to train; forgets long contexts.

Best at: Older speech and translation systems

Transformer

Attention-based network

Looks at every token at once and learns which ones matter to each other. Parallel, scales beautifully.

Best at: ChatGPT, Claude, Gemini, modern vision

Diffusion

Denoising generative model

Learns to remove noise step by step, so it can turn pure static into a picture.

Best at: Image, video and audio generation

Fig. 13The four architectures you will hear about most.

Convolutional networks assume that a pattern is the same wherever it appears in an image, so they reuse one small filter everywhere. Recurrent networks assume data arrives in order, reading it one step at a time — which makes them slow and forgetful over long passages. The Transformer, introduced in 2017, dropped recurrence altogether: it looks at a whole sequence at once and lets every element decide which others to pay attention to. Because that work runs in parallel on GPUs, Transformers could be scaled to sizes nobody had tried, and they now dominate language, and increasingly vision, audio and biology.

09Advanced

Inside a large language model

Here is the most surprising fact in modern AI: a chatbot like ChatGPT or Claude is, at its core, a machine that predicts the next word. Just that. It reads your text and outputs a probability for every possible next token. One is chosen, stuck on the end, and the whole thing repeats. The fluency, the reasoning, the code — all of it emerges from getting extraordinarily good at that one game.

  1. Your prompt

    “The cat sat on the”

  2. Tokenise

    text → token IDs

  3. Embed

    each ID → a vector of thousands of numbers + position

  4. Transformer ×N

    attention + feed-forward, dozens of layers deep

  5. Probabilities

    a score for every word in the vocabulary

  6. Sample

    pick “mat” (temperature decides how boldly)

append the new token and repeat until done — that is how the reply streams in word by word

Fig. 14The journey of a prompt. The model produces one token at a time; the loop is why replies stream in word by word.

Step 1 — Tokens

Models do not read letters or whole words. Text is cut into tokens: common words are one token, rarer words are split into pieces. As a rule of thumb, one token is about three-quarters of an English word. A model’s context window — how much it can read at once — is measured in tokens, and today’s leading models handle hundreds of thousands of them, some a million or more.

Text in:

Unbelievable! AI is awesome 🤖

Tokens (sub-word pieces) and their IDs:

  • Un2208
  • believ20185
  • able481
  • !0
  • ␣AI15592
  • ␣is318
  • ␣awesome7427
  • ␣🤖12859

␣ marks a leading space. Token IDs shown are illustrative; every model has its own vocabulary.

Fig. 15Tokenisation splits text into sub-word pieces and maps each to an integer ID.

Step 2 — Embeddings: a map of meaning

Each token ID is converted into an embedding, a long list of numbers (thousands, in large models). Think of it as a coordinate on a map with thousands of dimensions. Training arranges the map so that words used in similar ways end up close together — and, remarkably, so that directions on the map carry meaning.

A two-dimensional map of word embeddings. Similar words cluster together, and the arrow from man to woman runs parallel to the arrow from king to queen, as does the arrow from France to Paris with India to Delhi.manwomankingqueenapplebananamangoParisFranceDelhiIndiasame direction = same relationship(“male → female”)fruits huddle togethercountry → capital
Fig. 16A simplified 2-D view of embedding space. Real embeddings have thousands of dimensions; this sketch only shows the idea.

vec(“king”) − vec(“man”) + vec(“woman”) ≈ vec(“queen”)

the famous word2vec result (2013): vector arithmetic on meanings

Because the Transformer sees all tokens at once, it also needs to know their order, so a positional encoding is mixed into each embedding. Modern models typically use rotary position embeddings (RoPE), which rotate the vectors by an angle that depends on position.

Step 3 — Transformer blocks

The embeddings then flow through a stack of identical Transformer blocks. Each block has two parts: self-attention, where tokens share information with each other, and a feed-forward network, where each token is processed on its own. Residual connections carry the original signal around each part, which is what lets networks be stacked so deep without training falling apart.

One transformer block. Token vectors enter at the bottom, pass through layer normalisation and multi-head self-attention with a residual connection, then layer normalisation and a feed-forward network with another residual connection, and exit at the top. Blocks are stacked many times.× N layerstoken vectors in (embedding + position)Layer normMulti-head self-attentiontokens exchange information+residualLayer normFeed-forward networkeach token “thinks” alone+
Fig. 17One Transformer block (pre-norm variant). Large models stack dozens of them.

Step 4 — Probabilities and sampling

After the last block, the final vector for the last position is turned into a score (a logit) for every token in the vocabulary, and a softmax turns those scores into probabilities. The temperature setting controls how adventurous the choice is. Play with it:

Playground

Turn the temperature knob

Prompt: The cat sat on the ___”. The bars are the model’s probability for each next word.

1.0

Low = safe and repetitive · High = creative and chaotic

  • mat50.2%
  • sofa20.4%
  • floor16.7%
  • keyboard7.5%
  • roof4.1%
  • moon1.0%

Press to let the model “write”.

Math: pi = ezi/T / Σj ezj/T. Dividing the scores by a small T exaggerates the gaps (the top word wins almost always); a large T flattens them (even “moon” gets a turn).

10Advanced

Attention, the maths

Read this sentence: “The animal didn’t cross the street because it was tired.” What does “it” mean? You instantly know it is the animal. Change “tired” to “wide” and “it” becomes the street. Working out which words matter to which other words is exactly what attention does.

Where does the token “it” look when working out its meaning? (one attention head)

The0.02animal0.58didn’t0.03cross0.05the0.01street0.12because0.04it0.06was0.03tired0.06

Weights are illustrative and sum to 1. Change “tired” to “wide” and a well-trained model shifts its attention from “animal” to “street”.

Fig. 18Illustrative attention weights from the token “it” to every other token in the sentence.

Mechanically, every token’s vector is multiplied by three learned matrices to produce three new vectors:

  • Query (Q) — “what am I looking for?”
  • Key (K) — “what do I contain?”
  • Value (V) — “what will I pass on if you pick me?”

Each token compares its query with every token’s key (a dot product: large when they point the same way). Those scores are scaled, turned into weights with softmax, and used to take a weighted average of the values.

Attention(Q, K, V) = softmax( QKᵀ / √dk ) · V

scaled dot-product attention — Vaswani et al., 2017

Scale: why bigger kept winning

Around 2020 researchers found that a language model’s loss falls smoothly and predictably as you increase three things together: the number of parameters, the amount of training data and the compute spent. These scaling laws turned model building into something closer to engineering. DeepMind’s 2022 “Chinchilla” study refined the recipe: for a fixed compute budget, many models had been too big and undertrained, and roughly 20 training tokens per parameter was a better balance. Today’s frontier models are trained on many trillions of tokens.

11Advanced

How a chat assistant is made

A model that has only been pre-trained is a brilliant but unruly autocomplete. Ask it “What is the capital of France?” and it may well continue with “What is the capital of Germany?”, because in its training data, lists of quiz questions are common. Turning it into a helpful assistant takes further stages.

  1. STAGE 1

    Pre-training

    Predict the next token over trillions of tokens of text and code.

    A “base model”: knows a lot, but just autocompletes.

    Weeks–months on thousands of GPUs

  2. STAGE 2

    Supervised fine-tuning

    Train on curated examples of good instructions and answers.

    Follows instructions, speaks like an assistant.

    Tens of thousands of examples

  3. STAGE 3

    Preference tuning (RLHF)

    People rank answers; a reward model learns their taste; RL optimises for it.

    More helpful, honest and harmless.

    Human feedback + RL

  4. STAGE 4

    Reasoning RL

    Reward correct final answers on maths, code and puzzles with checkable results.

    Learns to think step by step before answering.

    Verifiable tasks at scale

Fig. 19From raw next-token predictor to helpful assistant. Stage 4 is how “reasoning” models learn to think before answering.

Reinforcement learning from human feedback (RLHF) deserves a closer look. People compare pairs of model answers and pick the better one. Those preferences train a separate reward model that predicts which answer a person would prefer. The chat model is then optimised to score highly with that reward model, with a penalty for drifting too far from its earlier self so it does not learn to game the scorer. Variants such as DPO skip the separate reward model and learn from the preference pairs directly, and some labs add AI-generated feedback guided by a written set of principles.

The newest step is reinforcement learning on verifiable tasks. Give the model maths problems and coding challenges whose answers can be checked automatically, and reward it only for getting them right. Models trained this way learn to write out a long chain of intermediate thinking before the final answer — trying approaches, catching their own mistakes, backtracking. That is what the “thinking” you see in reasoning models is.

AI assistant — new chat

Explain photosynthesis like I’m 8, in 3 sentences 🌱

Plants are like tiny chefs that make their own food! 🍃 They take in sunlight through their leaves, drink water with their roots, and breathe in a gas from the air called carbon dioxide.

They mix those together to make sugar for energy, and — bonus — they breathe out the oxygen that we need to breathe!

Ask a follow-up…
Fig. 20Illustration of a chat interface. Behind the scenes, every word of the reply is one trip around the loop in Fig. 14.
12Intermediate

Beyond text: images, voice and video

Most image and video generators use a different trick called diffusion. During training, you take real pictures and add a little random noise, then more, then more, until only static is left. The network’s job is to learn to reverse a single step: given a noisy image (and a caption), predict the noise that was added. Once it has learned that, you can start from pure static and denoise step by step, with your text prompt steering each step — and a brand new image appears.

t = 1000 · pure noise

t = 750

t = 450

t = 180

t = 0 · image

← training adds noise step by step  ·  generation learns to remove it, guided by your prompt →

Fig. 21A toy illustration of diffusion on a 12×12 image. Real models work on millions of pixels (or a compressed “latent” version of them).

The frontier is increasingly multimodal: single models that take in text, images, audio and video, and respond in several of them. The same core recipe applies — turn everything into tokens or embeddings, then learn the patterns — which is why progress in one area now spreads quickly to the others.

13Intermediate

Putting AI to work: prompts, RAG and agents

Prompting well

A language model only knows what is in its training data plus what you put in the prompt. The single biggest improvement most people can make is to give it more context. Say who the answer is for, what good looks like, the format you want, and, when you can, an example.

✗ VAGUE

Write about our new app.

✓ SPECIFIC

Write a 120-word announcement of our free Gantt chart app for busy project managers. Friendly, no jargon, end with one call to action. Here is a past announcement we liked: …

RAG: giving the model your documents

A model does not know your company handbook, yesterday’s news or your private notes. Retrieval-augmented generation fixes that without retraining: split your documents into chunks, store their embeddings in a vector database, and at question time fetch the chunks closest in meaning to the question and paste them into the prompt.

  1. Question

    “What is our refund policy?”

  2. Embed the question

    turn it into a vector

  3. Search your documents

    vector DB finds the closest chunks

  4. Stuff into the prompt

    question + top 3–10 chunks

  5. LLM answers

    grounded in your data, with citations

Fig. 22Retrieval-augmented generation. The model answers from your documents, and can cite them.

Agents: models that act

An agent is a language model placed in a loop and given tools: web search, a code runner, a calendar, a company’s internal APIs. It decides on a step, calls a tool, reads the result, and decides the next step, until the goal is done. Coding assistants that read a codebase, run the tests and fix what fails are agents; so are assistants that research a topic across dozens of web pages.

The agent loop. Starting from a goal, the model thinks about the next step, acts by calling a tool, observes the result, and thinks again, repeating until the goal is met.loop until done🎯 Goal“Book the cheapest flight”🧠 Thinkplan the next step🛠️ Actcall a tool: search, code, API👀 Observeread the result
Fig. 23The agent loop. The hard parts in practice are knowing when to stop, recovering from errors, and asking a human before doing anything irreversible.
14Beginner

Limits, risks and responsibility

AI is powerful, and it is also imperfect in ways that matter. A good user knows both.

Hallucinations

Models can state false things fluently and confidently, including made-up citations. Check anything important.

Bias

Models learn from human data, including its prejudices, and can repeat or amplify them in hiring, lending or policing.

Privacy

Be careful what you paste into online tools. Read how your data is stored and whether it trains future models.

Deepfakes & misuse

Realistic fake voices, images and video make scams and misinformation cheaper. Verify surprising media.

Energy & cost

Training and running large models uses a lot of electricity and water for cooling, and concentrates power in a few companies.

Work

AI changes what many jobs involve. The people who learn to use it well tend to benefit most.

Behind these everyday concerns sits a longer-term research field called AI safety and alignment: how do we make sure increasingly capable systems reliably do what we intend, are honest about what they do not know, and cannot be turned to serious harm? Interpretability researchers try to look inside networks and understand what individual neurons and circuits represent, so that we are not relying on a black box. Governments are writing rules too, such as the European Union’s AI Act. None of this is solved, and it is one of the most important open problems of our time.

15Beginner

Glossary

TermMeaning
AlgorithmA precise recipe of steps a computer follows.
ModelThe thing training produces: a function with learned numbers (parameters) inside.
Parameter / weightOne learned number. Large language models have billions of them.
TrainingAdjusting parameters so the model’s outputs get less wrong on example data.
InferenceUsing a trained model to answer something new.
LossA single number measuring how wrong the model currently is.
GradientThe direction (for every parameter) that increases the loss fastest. We step the other way.
OverfittingMemorising the training data instead of learning the pattern; fails on new data.
TokenA chunk of text a language model reads and writes, roughly ¾ of an English word.
EmbeddingA list of numbers that places a token, sentence or image on a map of meaning.
AttentionThe mechanism that lets each token weigh how relevant every other token is.
Context windowHow many tokens a model can consider at once: its working memory.
Fine-tuningFurther training a pre-trained model on a smaller, specific dataset.
RLHFReinforcement learning from human feedback: tuning a model towards answers people prefer.
HallucinationA confident, fluent answer that is false.
RAGRetrieval-augmented generation: fetching relevant documents and giving them to the model.
AgentA model that plans, calls tools and loops until a goal is reached.
MultimodalHandles more than one kind of input or output: text, images, audio, video.

Quick quiz

Tap a question to check your answer.

Q1A spam filter trained on thousands of emails marked “spam” or “not spam” is which kind of learning?

Supervised learning: every training example came with the right answer (a label).

Q2Your model scores 99 % on training data and 61 % on new data. What went wrong?

Overfitting. It memorised the training set. Try more data, a simpler model, regularisation such as dropout, or stopping training earlier.

Q3Why does a chatbot sometimes give a different answer to the same question?

It samples each next token from a probability distribution. With temperature above zero, less likely words sometimes get picked, so the path through the answer changes.

Q4In attention, why divide QKᵀ by √dₖ?

Dot products of long vectors grow large, which pushes softmax into regions with tiny gradients. Scaling keeps the scores in a range where training stays stable.

16Beginner

Where to go from here

You now know more about how AI works than most people who use it every day. The best way to go further is to use it and build with it, a little at a time.

  1. STEP 1

    Week 1 · Curious

    • Use a chat assistant every day for real tasks
    • Learn to write clear prompts with context and examples
    • Read one explainer a week (like this series!)
  2. STEP 2

    Month 1–3 · Builder

    • Python basics, NumPy, pandas
    • Call an LLM API; build a small chatbot or RAG app
    • Try no-code tools and automation
  3. STEP 3

    Month 3–9 · Practitioner

    • Linear algebra, probability, calculus essentials
    • scikit-learn, then PyTorch
    • Train a CNN and fine-tune a small language model
  4. STEP 4

    Year 1+ · Specialist

    • Read papers: start with “Attention Is All You Need”
    • Evaluation, safety and interpretability
    • Ship something real and measure it
Fig. 24A practical learning path, from curious user to specialist. Move at your own pace; each step is useful on its own.

Coming up in The AI World: deeper dives into how large language models are trained, a hands-on guide to building your first RAG app, prompting techniques that actually work, what AI agents can and cannot do yet, and how to judge AI claims in the news.

Welcome aboard. It is an awesome world — and we have only just opened the door. 🚀

Numbers inside illustrations (probabilities, attention weights, token IDs, training output) are made up to show the idea. Spotted a mistake? Tell us.

Next in The AI World

ChatGPT 101: from your first chat to the API

Read next