Why probability in AI?
Machine learning is fundamentally about uncertainty. When a model predicts that an image contains a cat with 92% confidence, it's expressing a probability. When a language model generates the next word, it chooses from a probability distribution over the entire vocabulary. Without probabilities, no classification, no generation, no learning.
Probabilities provide the mathematical language for reasoning about uncertainty. And in AI, uncertainty is everywhere: in noisy data, in model parameters, in predictions.
Two views of probability
The frequentist approach
Probability is the frequency of an event over a large number of repetitions. Roll a die 10,000 times and observe that 6 appears roughly 1/6 of the time. It's concrete, measurable, but limited: how do you talk about the probability of rain tomorrow? You can't "repeat" tomorrow.
The Bayesian approach
Probability is a degree of belief. You can say "I believe there's a 70% chance it will rain tomorrow" based on available information. This view is more flexible and better matches what ML models do: they update their beliefs as they see data.
In deep learning, both approaches coexist. Training by maximum likelihood is frequentist. Adding priors on weights (regularization) is Bayesian. Understanding both is essential.
Kolmogorov axioms
All of probability theory rests on three axioms, laid down by Andrey Kolmogorov in 1933. They are simple but fundamental.
Axiom 1: non-negativity
For any event , the probability is positive or zero:
A negative probability makes no sense. A model that predicts a probability of for a class has a problem.
Axiom 2: normalization
The probability of the entire sample space equals 1:
Something must happen. In classification, the sum of probabilities across all classes must equal 1. That's exactly what the softmax function does at the output of a network.
Axiom 3: additivity
For two mutually exclusive events (that cannot occur at the same time):
If = "the model predicts cat" and = "the model predicts dog", and the model can only predict one class, then .
All rules of probability calculation follow from these three axioms.
Conditional probability
The intuition: "given that..."
Conditional probability answers the question: "What is the probability of , knowing that has occurred?"
Think of it as a filter. Among all cases where is true, what fraction also satisfies ?

Concrete example
Imagine a spam classifier. We have:
- (30% of emails are spam)
Then . Knowing that an email contains the word "free", the probability that it's spam jumps to 80%.
In ML: everywhere
All autoregressive modeling of language models relies on conditioning:
Each token is predicted conditionally on all previous tokens. It's a chain of conditional probabilities.
Bayes' theorem
The central formula
Bayes' theorem is the mathematical tool that lets you invert the conditioning:
This may be the most important formula in machine learning. It says: to know , you just need to know , , and .

Why it's powerful
Often, we know the likelihood (relatively easy to compute or model) but we want the posterior (what we actually care about for decision-making). Bayes bridges the two.
Example: we want . We know (the test sensitivity, given by the manufacturer). Bayes lets us go from one to the other.
Bayesian vocabulary
Bayes' theorem breaks down into four terms, each with a specific name:
Prior:
The prior belief, before observing data. In ML, it's what we believe about the parameters before training. A Gaussian prior centered at 0 says: "I believe the weights are probably small."
Likelihood:
The probability of observing the data if hypothesis is true. This is what the model maximizes during training (maximum likelihood).
Evidence (marginal likelihood):
The total probability of observing the data, averaged over all possible hypotheses. Often impossible to compute exactly in practice (intractable), which is why we use approximations like variational inference or MCMC (Markov Chain Monte Carlo) methods.
Posterior:
The updated belief after observing the data. This is what we want: the distribution over parameters given the observed data.
Applications in machine learning
Naive Bayes classification
The naive Bayes classifier applies Bayes directly. To classify an email as spam or not-spam:
The "naive" assumption supposes that features (words) are conditionally independent given the class. It's wrong, but it works surprisingly well in practice.
Bayesian deep learning
In Bayesian deep learning, instead of learning a single set of weights , we learn a distribution over the weights. This allows quantifying prediction uncertainty: if the posterior distribution over weights is wide, the model is uncertain.
Variational inference
Since the exact posterior is often impossible to compute (the evidence requires an integral over the entire parameter space), we approximate it with a simpler distribution . This is the principle of variational inference, at the heart of VAEs (Variational Autoencoders).
Key takeaways
- Probabilities are the language of uncertainty, and ML is steeped in uncertainty
- Kolmogorov axioms guarantee the consistency of probabilities
- Conditional probability is everywhere: autoregressive models, classification, attention
- Bayes' theorem connects prior, likelihood, and posterior
- Bayesian vocabulary (prior, likelihood, posterior) comes up constantly in modern ML
- Bayesian inference is the theoretical foundation of regularization and uncertainty quantification
Where this is used. A language model is a conditional probability: see the LLM overview.