Module 5 · Where the weights come from

How a number inside the model gets changed

In this lesson

  • 9 min read
  • 5 reading sections
  • Knowledge check
  • Lesson 4 of 10 in this chapter

This chapter’s goalExplain what each training stage optimises and what it cannot fix, estimate the compute cost of a training run from parameter and token counts, and choose between prompting, retrieval and fine-tuning by what each one actually changes.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 6Free · no account needed
Lesson steps

The loop

Everything in training is this, several hundred thousand times:

  1. Take a batch of text.
  2. Run it forward; compute the loss.
  3. Compute the gradient: for every one of the 8 billion parameters, how much would the loss change if this parameter changed slightly.
  4. Move every parameter a small step in the direction that reduces the loss.
  5. Repeat.

Step 3 is backpropagation, and it is not magic. It is the chain rule from calculus applied systematically backwards through the network, reusing intermediate results so that computing all 8 billion partial derivatives costs about twice a forward pass rather than 8 billion times.

That efficiency is the reason deep learning is possible at all. Without it, the derivative for each parameter would need its own forward pass and training would be unthinkable.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the AI, Actually Explained exam.

Stuck on something?Ask Anjali, your AI tutor

How to cite: Addaly (2026) ‘How a number inside the model gets changed’, in How a Language Model Actually Works. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/how-llms-work/how-weights-get-updated (Accessed: 29 November 2026).