Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 01 · AI · Neurons to a language model · about 22 min to read

Watch: What deep learning actually is: backprop, and why language was hard
▶ VideoPlay it as a journeyTutor comes with a plan

How It Learns (loss, gradient descent, backprop)

How It Learns
How It Learns · Open board

The How It Learns board, in the How LLMs Work track. The last lesson built a machine out of dials and set nine by hand. This is how a machine came to turn its own, including the middle ones, which took the field seventeen years to work out.

Before you start. You need What a Neural Network Is, which gave you this: a network is rows of small units, each adding up weighted votes and passing the total on, with one rule between the rows that turns negative totals into zero. Everything the machine knows sits in those dials, formally called weights, and that lesson ended by admitting nobody knew how to turn the middle ones.

Lesson 4 of 83 in AI

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • Assigning blame: which middle dial made the answer wrong
  • Nudging one dial at a time: the obvious method, and the six and a half years it costs
  • The loss: wrongness as one number you can watch fall
  • Gradient descent: walking downhill, and the learning rate that sets the step
  • 9 October 1986: backpropagation, the blame flowing backwards
  • Colin has two aunts: learning representations, what the middle rows build on their own
  • Overfitting: the training loss falls while the machine gets worse
  • The first step, by hand
  • The valley, and three step sizes
  • Blame, on one unit
  • The same five points, a few at a time
  • Why the real thing takes weeks
  • What cures overfitting
  • All of it in code

Terms it explains: How It Learns, How LLMs Work, one step, one example, loss, gradient descent, learning rate, backpropagation, overfitting, gradient, mean squared error, Momentum, Adam, chain rule, dead neuron, batch, epoch, token, vocabulary, cross-entropy, More data, Weight decay, Dropout, Early stopping, validation set, automatic differentiation, batch / mini-batch, convergence, generalization, loss / cost function, optimizer (SGD/Adam), parameters/weights, regularization, step, validation set / early stopping.

Lab

Every step of training walks the dials downhill. How far should each step go?

Drag How far each step goes from 0.001 up to 0.5 and watch Steps to a loss under 0.01 fall, then vanish.

Open The learning rate

Related paper

Review AI