8.2 Bayes’ theorem for perception

The most natural formalism for inference under uncertainty is Bayes’ theorem (refresher: Foundations 11.5). Let MM be a hypothesis about what is happening in the world (a particular meaning, percept, or sound source) and SS be the sensory input. The brain wants to compute P(MS)P(M | S) — the probability of each hypothesis given the data. Bayes’ theorem gives this as

P(MS)=P(SM)P(M)P(S).P(M | S) = \frac{P(S | M)\, P(M)}{P(S)}.
Derivation: Bayes' theorem from the definition of conditional probability

The conditional probability of AA given BB is defined as

P(AB)=P(AB)P(B),P(BA)=P(AB)P(A).P(A | B) = \frac{P(A \cap B)}{P(B)}, \qquad P(B | A) = \frac{P(A \cap B)}{P(A)}.

Solving each for the joint probability P(AB)P(A \cap B):

P(AB)=P(AB)P(B)=P(BA)P(A).P(A \cap B) = P(A|B)\, P(B) = P(B|A)\, P(A).

Equating and solving for P(AB)P(A|B):

P(AB)=P(BA)P(A)P(B).P(A | B) = \frac{P(B | A)\, P(A)}{P(B)}.

In the perception context, A=MA = M (the hypothesis about the world’s state) and B=SB = S (the sensory input):

P(MS)=P(SM)P(M)P(S).P(M | S) = \frac{P(S | M)\, P(M)}{P(S)}.

The denominator P(S)P(S) is the marginal probability of the data — it can be computed as MP(SM)P(M)\sum_M P(S|M) P(M) (summing over all hypotheses). For perceptual purposes the denominator is just a normalizing constant. ∎

The denominator P(S)P(S) is just a normalizing constant; the interesting content is in the numerator. The brain combines:

The posterior P(MS)P(M | S) is what the brain perceives. When the likelihood is sharp (the sensory data is unambiguous), the posterior follows the data. When the likelihood is vague (the data is noisy or incomplete), the posterior follows the prior. This is exactly why ambiguous stimuli are perceived in a way that depends on context, while clear stimuli are not.

priorP(meaning)A: 50%B: 50%likelihoodP(sound|meaning)A: 50%B: 50%posteriorP(meaning|sound)A: 50.0%B: 50.0%P(M|S) ∝ P(S|M) · P(M)
50%
50%

Sharp likelihood + clear stimulus: the posterior follows the data, the prior matters little. Vague likelihood + uninformative stimulus: the posterior follows the prior. This is what "fills in" missing phonemes or completes interrupted speech.

This is more than a clean formalism. It is a specific prediction: the brain’s percept of an ambiguous stimulus should depend on prior expectations in a way described by Bayes’ theorem. Many decades of psychophysics — across vision, audition, and touch — have shown that this prediction holds, at least approximately, for a wide range of perceptual tasks. The brain is, behaviorally, an approximate Bayesian inference engine.