Probability

18 min read

Probability tells you how likely something is. A language model does not know the next word. It gives a probability to every word, then picks one. In this lesson you learn the few ideas of probability that AI uses, and you run them in NumPy.

New words

Probability
A number from 0 to 1 that shows how likely something is.
Outcome
One possible result, such as heads on a coin or a 4 on a dice.
Independent events
Two events where the first result does not change the second.
Conditional probability
The chance of one event when you already know another happened.
Distribution
A list that gives the probability of every possible outcome.
Softmax
A function that turns any list of scores into probabilities that add to 1.
Temperature
A setting that makes a model play safe or take more risks.

What you will learn

  1. Where does probability show up in AI?
  2. How do you find a probability?
  3. Why is a probability between 0 and 1?
  4. What happens when you repeat it many times?
  5. What if two things happen together?
  6. What is conditional probability?
  7. What is a distribution?
  8. How do temperature and softmax work?
  9. Try it: spin the next-word wheel
  10. Common mistakes
  11. Explain it to a friend
  12. Key takeaways

10 quiz questions at the end.

Start this lesson

The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.

All lessons · Back to the roadmap