One training step
Compare the probability of the correct word before and after an update to see whether the prediction improved.
During a training step the model predicts a continuation and receives a number measuring how poor its prediction was. This number is the loss. Training adjusts weights so that evidence for the correct answer gradually has more influence.
A small example
The observed next word is “snow”. The model assigned it a probability of 0.2 before an update and 0.4 afterwards. Has this prediction improved? Yes: the model assigns more probability to the word that actually followed. Other sentences need their own check.
The prediction moved. Why is the answer the same?
Suppose the model has only two choices, “snow” and “rain”. When the probability of snow rises from 0.2 to 0.4, rain still gets 0.6. If you always choose the most likely word, the screen shows “rain” both before and after the update. Both choices miss the target.
The second prediction still gives more weight to the observed word. A loss based on the probability of the correct continuation can pick up that change before the winning word changes.
See it happen
Change a weight. Recalculate the prediction.
The input and correct word stay fixed. Each click computes the gradient p(fast) − 1 and updates w. Watch the probability and error change together.
Adjustable weight w
0.2
Starting value 0.2. The other score stays 0.3.
Error for the correct word
0.7444
NLL = −log(p). Smaller means less error on this example.
0 training steps. Correct-word probability 47.50%.
Two-candidate teaching model: logits [w, 0.3], SGD learning rate 0.5. This runs the stated arithmetic, not PyTorch or an LLM. One weight does not store a ready-made answer.
Done reading?
Mark the lesson as read to move your track progress forward.
Lesson marked as done.
Now build your own version
Implement a training step and update real weights. The checker detects lost gradients and missing updates.
What practice includes and how much it costs
MCP includes the full lesson and a local project with starter files. Work through the task with your agent, ask for a hint and run the checks on your computer.
One payment, no auto-renewal · Terms
Progress saved in this browser
Clear your history or open this on your phone, and the marks will be gone. Leave your email and they'll move to your account. No password needed.
Done. moved to your account. You can see your progress on any device. My progress