AI Anatomy Class · Part 2 · How machines learn

20. How wrong was it? Loss

Q. We know when an AI is wrong, but how do we measure how wrong it is?

  1. The chapter 16 neuron guessed Truck A would get 3.5 points. But the real rating our friends gave after eating there is 4.5.
  2. How wrong it is = the distance between the dart and the target. Guess minus answer: 3.5 − 4.5 = −1. It fell 1 point short.
  3. Let's grade three trucks: A is −1, B is +1, C is −0.5. Simply adding them gives −0.5, which looks almost right.
  4. To get rid of the signs, we square each error. Absolute values would work too, but squaring punishes big misses much more.
  5. The mean of the squares is 2.25 ÷ 3 = 0.75. This single number is the loss. A loss of 0 means everything was right.
  6. GPT guesses the next word, not a rating, so it's graded on how much probability it gave the right word. That's chapter 65.
  7. Now we have a goal: find the knobs that bring the loss close to 0. Chapter 21 shows how.

Chapter summary