Notes on intelligence, learning & machines 01

A brief
primer on AI

Reading note

A compact map of the ideas behind artificial intelligence: what sits inside what, how machines learn, and what a neural network is actually doing when it trains.

Yellow humanoid robot looking toward the viewer
Personal reference Draft · 2026
02

Before we begin

A map of what we'll cover

AI gets vague quickly. I wanted one reference that follows the thread from “what counts as AI?” to the much less mysterious mechanics of how a neural network learns.

01 / covers

First, untangle the terms

AI, machine learning, neural networks and deep learning are related. They are not interchangeable. We start by putting them in the right order, then compare the three learning setups people usually mean.

02 / follows

Then, follow one training loop

A model makes a prediction. The loss tells us how wrong it was. Backpropagation works out which parameters pushed the answer in that direction, and the optimiser nudges them.

03 / how to read

Use the clicks

The controls are part of the explanation. Click through the comparisons, use the arrows to move between ideas, and open the notes when you want the caveats or sources. The calculus can wait until the appendix.

Personal reading reference AI primer / scope
03

Foundations

So, what actually counts as AI?

Artificial intelligence is a field. The technology inside it keeps changing.

The recurring question is how a machine can do things we associate with intelligence: perceive, plan, decide, communicate, create. Sometimes that means hand-written rules. Sometimes search. Increasingly, it means learning statistical patterns from data. Same umbrella, very different machinery underneath.

The imitation game

Turing asks a practical version of a slippery question: could a machine convince us through conversation?

Black-and-white portrait of Alan Turing in 1951
1950 Alan Turing
What happened

Turing proposed the “imitation game”: judge the machine by its conversational behaviour, rather than getting stuck arguing about what was happening inside it.

Why it mattered

It turned a beautifully vague philosophical question into something people could test, criticise and try to build toward.

Select a milestone to read more AI primer / foundations
04

The map

The levels of artificial intelligence

Selected / 01

Artificial intelligence

The broad field: machines doing things we associate with intelligence.

Planning · language · robotics

A sensor-equipped robot demonstrator at an aerospace exhibition
Typical use case Robotic perception and task execution
Select a layer to isolate it AI primer / categories
05

Machine learning

Three ways a system can learn

Rows of labelled handwritten digits from the MNIST dataset
Visual example Labelled digits → known classes

Supervised learning

Give it examples with the answers.

The model makes a prediction, checks it against the labelled answer, then adjusts its parameters so the average error gets smaller. Real systems often mix more than one of these setups.

Input labelled examples
Signal prediction error
Result mapping to a target
Typical uses

Image classification · spam detection · forecasting

Select a method to see where its feedback comes from AI primer / machine learning
06

Learning with targets

Supervised learning

You show the model the question and the answer.

The input is x. The answer we wanted is y. The model produces ŷ, measures how far off it was, then changes its parameters a little. Repeat this across enough examples and useful patterns begin to stick.

labelled pair
(x, y)
model
ŷ = f(x)
loss
ℓ(y, ŷ)

Training objectiveL = (1/n) Σi=1n ℓ(yi, ŷi)Minimise average loss across the training set.

Classification

Which category?

The answer is a category: spam / not spam, one diagnosis among several, cat / definitely not cat.

Binary cross-entropy ℓ = -[y log(ŷ) + (1-y) log(1-ŷ)]
Regression

What continuous value?

The answer is a number: battery life, blood glucose, tomorrow's demand or the price of an asset.

Squared error ℓ = (y - ŷ)2
The answer key defines what “wrong” means; the next slide decides how to count itAI primer / supervised learning
07

What counts as wrong

Choosing the right loss function

The model cannot optimise “be more correct”. It needs a number.

A loss function turns each mistake into a penalty. The right choice follows the kind of answer we expect and which mistakes should matter most.

01What shape is the answer?A category, a probability or a continuous value?

02Which mistakes cost more?Should one large miss outweigh several small ones?

03How noisy is the data?Should unusual examples dominate the update?

Yes / no target

Binary cross-entropy

−[y log(ŷ) + (1−y) log(1−ŷ)]

Use it when the target is one of two classes and the model outputs a probability. It gives a small penalty to a confident correct answer and a steep penalty to a confident wrong one.

Target: spamŷ = 0.90Small loss
Target: spamŷ = 0.10Large loss
Choose the loss by the answer shape and the consequence of being wrongAI primer / loss functions
08

Learning without targets

Unsupervised learning

There are examples, but no answer key.

That does not mean the system just wanders around. It still needs an objective: make the groups tighter, reconstruct the input more accurately, or find a representation that keeps the useful structure and drops some of the noise.

01 / group

Clustering

Puts similar things near each other.

Market segments · document groups · image regions
02 / relate

Association

Finds things that tend to show up together.

Basket analysis · listening habits · recommendations
03 / compress

Dimensionality reduction

Uses fewer dimensions without throwing away the useful part.

Visualisation · preprocessing · compact representations
No labels does not mean no objectiveAI primer / unsupervised learning
09

Learning through action

Reinforcement learning

LEARNER Agent THE WORLD Environment action aₜ state sₜ₊₁ + reward rₜ₊₁

ObjectiveChoose actions that maximise expected cumulative return.

The feedback comes after an action. Sometimes much later.

The agent learns a policy: a strategy for what to do in a given situation. The awkward bit is that one action changes what happens next. So the useful question is not “Was that move correct?” but “Did this chain of choices lead somewhere better?”

A short trajectory

Try, observe, keep going

A warehouse robot chooses a route, hits congestion and arrives late. That final delay is feedback about the earlier choices too—not just the last turn.

What changes

A strategy, not a lookup table

Across many attempts, actions that tend to produce better long-term outcomes become more likely in similar situations.

State → action → reward → new stateAI primer / reinforcement learning
10

Optimisation

Training answers two questions: which way, and how far?

The gradient gives us a direction. The learning rate decides how bold to be.

A forward pass produces a prediction and a loss. Backpropagation asks how a tiny change in each parameter would change that loss. Gradient descent then moves the parameters a short distance downhill. Short enough to learn; not so large that we jump straight past the useful bit.

θt+1 = θt - α ∇L(θt)
θ
model parameters
∇L
gradient of average loss
α
learning rate / step size

Important caveat: the gradient only knows the local slope. It is not a map to the best possible solution. Step too far and you overshoot; step too carefully and training takes forever.

Small interactive model · L(w) = w²α = 0.15
average loss L weight w
Adjust the learning rate to see how the optimiser changes its pathAI primer / optimisation
11

Layered models

Simple behaviour from each neuron gives rise to complex behaviour with many

A deep network is a lot of small calculations, connected and repeated.

One neuron combines its inputs, adds a bias and passes the result through an activation. A layer does many of these calculations at once. Stack the layers and each one gets to work with the patterns found by the one before it.

Start with the small calculation. Then zoom out and see how quickly it becomes a system.

View 01 / one artificial neuron

x₁x₂x₃ × w₁× w₂× w₃ Σ+ bias b ACTIVATIONσ(z)

combine the inputsz = Σ wixi + b

produce an activationa = σ(z)

Select a view to change scaleAI primer / deep learning
12

Expressive power

Why activation functions matter

Without them, depth is mostly an illusion.

A layer that only multiplies and adds is an affine transformation. Stack several of them and the algebra still collapses into one affine transformation. The network may be deeper, but it cannot learn a more complicated kind of boundary.

Linear after linear after linear W₃(W₂(W₁x + b₁) + b₂) + b₃ = Ax + c More layers. Still one affine map.
Without an activation

Depth collapses

x W₁x+b₁ W₂a+b₂ Ax+c

However many layers we add, the final boundary is still straight.

With a nonlinear activation

Depth compounds

x W₁x+b₁ σ W₂a+b₂ σ

Each activation adds a bend. Stack enough of them and the model can carve out much richer shapes.

Depth needs nonlinearity to become expressiveAI primer / activations
13

Expressive power

The small function that stops the whole network being linear

An activation sits between one weighted sum and whatever happens next.

Without a nonlinear activation, stacking layers buys us very little: the whole network still collapses into one linear map. At the final layer, the function also tells us what the output means—a number, a binary probability, or a spread of probabilities across classes.

Hidden-state examples
Output-layer choices

Click the functions. The shape is the point: it determines what gets through and what gets flattened.

Common hidden-layer choice

ReLU

max(0, x)
xf(x)

ReLU turns negative inputs into zero and leaves positive ones alone. That one kink is enough to make the network nonlinear, and it is cheap to compute. The trade-off: a unit can go quiet if it gets stuck on the negative side.

Select a function to compare its role and trade-offsAI primer / activations
14

Architecture catalogue

Different shapes of data call for different kinds of network

An architecture is a bet about which relationships matter.

Images have neighbourhoods. Sequences have order. Generative models need a way to build rather than only classify. Click a family to see the assumption built into it.

Foundation / fixed-size features

Dense network

Every unit in one layer can contribute to every unit in the next. It is the plainest version of the layered calculation we have already seen.

input featureshidden layersoutput
Input structure
A fixed-length vector of features.
Core move
Learn a weighted connection between every neighbouring pair of layers.
Good for
Structured data, regression and small classifiers.
Current caveat
It ignores space and order unless we encode them into the inputs.
Select a family to inspect the assumption built into itAI primer / architectures
15 / 18
Before the notation

The whole training loop, before the calculus

The model makes a prediction. The loss judges it. Backpropagation works out the gradients. The optimiser changes the parameters. The next three slides say the same thing again, just with the notation left in.

  1. 01Forward pass
  2. 02Loss
  3. 03Gradients
  4. 04Parameter update
16

Appendix / derivation I

Backpropagation starts at the answer

Before we move backward, keep the useful bits from the journey forward.

  1. 01 / keep the weighted input

    The weights and bias combine the previous activations into z. Save it. Later we need to know exactly where each neuron sat on its activation curve.

  2. 02 / keep the activation

    The activation function turns z into a. At the output layer, aK is the prediction the loss is about to judge.

  3. 03 / follow what depends on what

    The loss does not see zK directly. It sees aK, which depends on zK. The chain rule says: follow that path and multiply the sensitivities along it.

  4. 04 / give the result a name

    That sensitivity is δK. In plain language: if the output layer's weighted input moved a tiny amount, how much would the loss move?

Click the path to connect prose and notation

Forward / weighted inputzK = WKaK−1 + bK
Forward / activationaK = σ(zK)
Chain rule / split the path∂L / ∂zK = ∂L / ∂aK ⊙ ∂aK / ∂zK
Substitute the activation derivativeδK = ∇aL ⊙ σ′(zK)

Once we have this signal, the output-layer parameter gradients fall out directly.

Bias gradient∂L / ∂bK = δK

Weight gradient∂L / ∂WK = δK(aK−1)T

aL all loss sensitivities at a · σ′ local activation slope · element-wise multiplication

The chain rule turns output loss into a local gradient signalAI primer / appendix
17

Appendix / derivation II

Then reuse the signal, one layer at a time

A hidden layer affects the loss through everything that comes after it.

  1. 01 / begin with the next signal

    Assume we already know δℓ+1: how sensitive the loss is to the next layer. Reuse it. Starting again from the loss every time would be wasteful.

  2. 02 / move backward through the weights

    The next layer used Wℓ+1 to send activations forward. The transpose sends sensitivity the other way, spreading the next layer's signal back across this one.

  3. 03 / account for the local slope

    The activation may strengthen, weaken or completely block a small change. Multiplying by σ′(z) accounts for what each neuron was doing locally.

  4. 04 / now we have this layer's signal

    The result is δ. Then the exact same reasoning repeats for layer ℓ−1, and keeps going until we reach the front.

Click each factor in the backward path

δ = (Wℓ+1)Tδℓ+1 ⊙ σ′(z)

Take the next layer's signal, map it backward through the transposed weights, then apply this layer's local activation slope. That is the recursion.

Output layer starts the recursionδK = ∇aL ⊙ σ′(zK)
Why transpose appears

W sends activations forward. WT sends sensitivity back into the previous layer's shape.

Why the derivative appears

σ′ tells us how strongly this activation responds to a tiny change in z.

Turn the signal into an update∂L / ∂b = δWL = δ(aℓ−1)TWnew = W − α∇WL

The outer product gives one gradient for every weight. The optimiser then takes the step.

  1. 1Forward: store every z and a.
  2. 2Start δ at the output.
  3. 3Propagate δ backward.
  4. 4Give gradients to the optimiser.
Backprop computes gradients; the optimiser applies the updateAI primer / appendix
18

Appendix / derivation III

Backpropagation through time is the same chain rule, unrolled

A recurrent network reuses one calculation. To train it, draw every use.

  1. 01 / unroll the recurrence

    Write the hidden state once for every timestep. The repeated boxes are not separate layers: they are the same calculation reusing the same weights.

  2. 02 / collect the losses

    Each output may contribute a loss Lt. The training objective combines them across the sequence.

  3. 03 / send the signal backward

    A shared weight affects many timesteps, so its gradient is the sum of the contributions from every place it was used.

  4. 04 / choose how far to look

    Repeated derivatives can shrink or explode. Truncated BPTT stops after a chosen window, trading longer memory for cheaper, steadier training.

One recurrent cell, shown at four timesteps

x₁h₁o₁ x₂h₂o₂ x₃h₃o₃ x₄h₄o₄ same Wₕₕ at every step gradient signal travels backward through the unrolled graph

Recurrent stateht = φ(Wxhxt + Whhht−1 + b)

Sequence lossL = ΣtLt

Shared weightWhhL = Σtδtht−1T

Edit mode · changes saved locally