Bayes' Theorem: Prior, Likelihood and Posterior

~13 min read

Bayes' theorem is a formula for updating a belief once you see new evidence — turning 'how likely is the evidence given my belief' into 'how likely is my belief given the evidence.'

Bayes' Theorem: Prior, Likelihood and Posterior is a Pro topic

Sign in, then upgrade to Pro or Power to unlock this topic and the full AI Engineering curriculum.

Key points

  • Bayes' theorem updates a belief (prior) into a new belief (posterior) once evidence (likelihood) arrives: P(A|evidence) = P(evidence|A) x P(A) / P(evidence)
  • Prior = what you believed before evidence; likelihood = how probable the evidence is if the belief were true; posterior = your updated belief
  • It flips the question you're often GIVEN (evidence given belief) into the question you actually WANT (belief given evidence) — these differ, often hugely
  • Even a highly accurate test can yield a low posterior probability when the underlying event is rare — false positives from the large 'unlikely' group can dominate
  • LLMs implicitly do this: a 'prior' over the next token gets updated into a 'posterior' by the evidence of the prompt/context so far