Lesson overview | Lesson overview | Next part
Bayesian Inference: Part 1: Intuition to 3. Core Theory I: Conjugacy and Closed-Form Updating
1. Intuition
1.1 From Data to Belief
Frequentist estimation begins with a fixed but unknown parameter and asks how a data-dependent procedure behaves over repeated samples. Bayesian inference begins one step earlier. Before seeing data, we already have a state of uncertainty about the parameter. That uncertainty may come from previous experiments, physical constraints, domain expertise, symmetry assumptions, or deliberately weak prior information. The parameter is not "random" because nature rolls a die after the data arrive; it is random because uncertainty is being modeled explicitly.
Suppose a startup deploys a new ranking model and wants to know the probability that the click-through rate exceeds the old model's rate by at least 1 percentage point. A point estimate does not answer that question. A p-value does not answer that question either. A posterior distribution does. Once we have , we can compute probabilities of events such as , expected utilities, posterior predictive risk, and the distribution of future outcomes.
This makes Bayesian inference especially natural for sequential decision-making. Every posterior after one round of data becomes the prior for the next round. The algebra says
which means learning is literally iterative belief revision. Online advertising, scientific experimentation, preference learning, and Bayesian optimization all exploit this recursive structure.
There is also a structural reason Bayesian thinking feels natural in AI. Machine learning systems are rarely used only for retrospective explanation. They are used to act: rank, classify, recommend, optimize, allocate compute, or trigger alarms. To act sensibly, a system needs not just a best guess but a measure of confidence. Bayesian inference provides one principled route from data to uncertainty-aware action.
ASCII VIEW OF BAYESIAN UPDATING
======================================================================
prior belief about parameter theta
+
likelihood of observed data under theta
|
v
posterior belief after seeing the data
|
v
predictions, decisions, uncertainty intervals, model comparison
======================================================================
Three examples clarify the basic idea.
Example 1: coin bias. We observe heads in flips. Before seeing any flips, we place a prior on the bias . After the flips, the posterior sharpens around values consistent with the data. If is small, the prior still matters. If is large, the likelihood dominates.
Example 2: sparse model weights. In linear prediction or logistic regression, a Laplace prior on coefficients expresses a belief that many coefficients should be near zero. The resulting MAP estimate becomes L1-regularized optimization. The full posterior adds uncertainty quantification around that sparse tendency.
Example 3: exploration in recommender systems. If we have high posterior uncertainty about a new recommendation policy, the Bayesian decision is not simply "ignore it until enough data accumulate." The posterior can justify exploration because uncertainty itself has value when it can be reduced.
Non-examples matter too, because Bayesian language is easy to misuse.
- A posterior is not just "the likelihood curve, relabeled." The prior changes the shape unless it is flat or asymptotically negligible.
- A prior is not necessarily subjective whim. Symmetry arguments, weakly informative constraints, hierarchical structure, and invariance principles often determine reasonable choices.
For AI: Frontier model evaluation increasingly cares about calibration, abstention, uncertainty-triggered fallback, and sample efficiency. Those are posterior questions. They ask what the model still does not know after training, not merely which point estimate optimizes a loss.
1.2 Frequentist vs Bayesian Uncertainty
The sharpest distinction between frequentist and Bayesian inference is not computational. It is semantic.
In frequentist statistics, the parameter is fixed. Randomness lives in the sample. Therefore a 95% confidence interval means: if we repeated the whole data-generating and interval-building procedure many times, 95% of those intervals would contain the true . The probability statement attaches to the procedure.
In Bayesian statistics, the observed data are fixed once collected, and uncertainty lives in the posterior over . Therefore a 95% credible interval means: under the posterior distribution, the probability that lies in the interval is 0.95. The probability statement attaches directly to the parameter because the parameter is being modeled as uncertain.
This distinction is not cosmetic. It changes what questions are meaningful.
- Frequentist question: "How often would this method cover the truth over repeated samples?"
- Bayesian question: "Given the data actually observed, how much posterior mass lies in this region?"
Neither framework dominates all others in every context. Frequentist guarantees are valuable when procedures must perform well across repeated deployment. Bayesian posterior statements are valuable when a single realized dataset must support a concrete decision right now. In practice, ML engineers often want both: calibrated uncertainty on the realized dataset plus reliable behavior under repeated use.
The previous section on Estimation Theory already developed confidence intervals and asymptotic normality. We will not duplicate that material here. Instead, we build the Bayesian parallel and emphasize where the two frameworks coincide and where they do not.
There are important overlap points:
- Under regularity conditions and large sample size, the posterior is often approximately Gaussian around the MLE.
- Under the same conditions, a Bayesian credible interval can numerically resemble a frequentist confidence interval.
- MAP estimation with a flat prior reduces to MLE.
But there are equally important divergences:
- Bayesians can assign probabilities to hypotheses and parameters directly; frequentists do not.
- Bayesian model comparison integrates over parameters; frequentist model comparison usually plugs in estimates or uses long-run testing logic.
- Priors matter in finite data, and sometimes matter a lot.
FREQUENTIST vs BAYESIAN UNCERTAINTY
======================================================================
Framework Parameter Randomness lives in
--------------------------------------------------------------------
Frequentist fixed repeated samples
Bayesian uncertain posterior over parameters
Interval type Meaning
--------------------------------------------------------------------
Confidence long-run coverage of the method
Credible posterior probability for this dataset
Canonical output
--------------------------------------------------------------------
Frequentist estimator, standard error, CI, p-value
Bayesian posterior, posterior mean/mode, credible interval
======================================================================
Examples help prevent confusion.
Example A: same numbers, different meaning. Suppose both methods output the interval for a Bernoulli success probability. The frequentist meaning is about repeated procedures. The Bayesian meaning is about posterior mass on this particular problem. Identical endpoints do not imply identical interpretation.
Example B: no exact frequentist analog. A product team asks, "what is the probability that model A is better than model B by at least 0.5%?" A posterior over effect size answers directly. A p-value does not.
Example C: no exact Bayesian analog without choices. A regulator asks for a decision rule with guaranteed 5% Type I error across repeated trials. Bayesian posterior thresholds can be tuned to behave this way, but the guarantee is not automatic; it depends on the prior and the loss function.
Common non-examples:
- "A 95% confidence interval means there is 95% probability the parameter lies in it." False.
- "A 95% credible interval is automatically better because it is easier to interpret." Not always. It can be more decision-relevant, but only relative to a prior and model that deserve trust.
For AI: Model deployment often needs statements such as "the posterior probability this policy violates the safety threshold is below 1%." That is a Bayesian statement. Benchmark reporting often needs statements such as "this evaluation protocol has 95% coverage under repeated re-sampling." That is a frequentist statement. Mature systems increasingly use both.
1.3 Historical Timeline
| Year | Contributor | Contribution |
|---|---|---|
| 1763 | Thomas Bayes | Posthumous essay introduces inverse probability in a simple setting |
| 1774-1812 | Pierre-Simon Laplace | Generalizes Bayesian updating, develops posterior approximation ideas, and applies inverse probability broadly |
| 1810s-1900s | Gauss, Poisson, others | Use probabilistic inversion ideas in astronomy and measurement, often without modern Bayesian terminology |
| 1939 | Harold Jeffreys | Formalizes objective Bayes and Jeffreys priors; emphasizes invariance |
| 1954 | Leonard J. Savage | Modern subjective Bayesian decision theory |
| 1970s | Lindley, Bernardo, Berger | Develop reference prior theory, decision-theoretic Bayes, and formal objective-Bayes programs |
| 1990s | Gelfand, Smith, Neal, Gelman | MCMC makes Bayesian computation practical for complex models |
| 2000s | Bishop, Murphy | Bayesian ML becomes standard in machine learning curricula |
| 2014 | Kingma and Welling | Variational autoencoder turns approximate posterior inference into a scalable deep-learning primitive |
| 2015 | Blundell et al. | Bayes by Backprop popularizes variational Bayesian neural networks |
| 2016 | Gal and Ghahramani | MC dropout interpreted as approximate Bayesian inference |
| 2019 | Maddox et al. | SWAG provides a scalable uncertainty baseline from SGD iterates |
| 2020s | Wide ecosystem | Bayesian calibration, active learning, approximate posterior methods, and probabilistic decision systems become mainstream in AI practice |
Two themes run through this history.
First, Bayesian inference was conceptually elegant long before it was computationally convenient. For simple conjugate models, the algebra is beautiful. For realistic hierarchical or nonconjugate models, the posterior often contains high-dimensional integrals that were historically intractable.
Second, modern ML revived Bayesian thinking not because the philosophy changed, but because the computational landscape changed. Gradient methods, automatic differentiation, stochastic optimization, and scalable approximate inference let practitioners revisit posterior reasoning at scales that were once impossible.
1.4 Why Bayesian Inference Matters for AI
Bayesian inference matters in AI because uncertainty is operational. A frontier model can have excellent average loss and still be dangerously overconfident off-distribution. A medical triage model can have strong AUROC and still be unsafe if it cannot say "I am unsure." A hyperparameter search can waste thousands of GPU-hours if it treats every unexplored configuration as equally promising. Posterior reasoning gives tools for all three.
Calibration and reliability. Posterior predictive distributions provide a route to uncertainty-aware prediction. Exact Bayesian posterior predictive inference is often unavailable in deep learning, but approximate methods such as ensembles, Laplace approximations, MC dropout, SGLD, and SWAG are all motivated by the same goal: uncertainty that reacts to data scarcity, ambiguity, or shift.
Small-data learning and shrinkage. In low-data regimes, pure MLE is brittle. Priors stabilize estimation. The posterior mean in Gaussian-Gaussian updating is a precision-weighted average of prior knowledge and observed data. Hierarchical models let many related tasks share strength, which is especially important in personalization, recommendation, multilingual NLP, and scientific ML.
Decision-making under uncertainty. Thompson sampling, Bayesian optimization, and Bayesian active learning all choose actions by integrating over posterior uncertainty. This turns "exploration vs exploitation" from a heuristic tuning problem into a probabilistic decision problem.
Interpretation of regularization. Weight decay is naturally read as a Gaussian prior. L1 penalties reflect Laplace priors. Sparsity-inducing Bayesian models, low-rank priors, and hierarchical shrinkage priors all offer a language for understanding what optimization penalties are trying to express.
Latent-variable deep learning. Variational autoencoders, deep latent Gaussian models, and many probabilistic representation-learning methods are built around the problem of approximating posteriors that are unavailable in closed form. The ELBO is a Bayesian object before it is an optimization objective.
Three concrete AI examples show the range.
- Calibration for abstention: a classifier used in content moderation can route high-uncertainty examples to human review instead of issuing brittle hard labels.
- Bayesian optimization for expensive training: when fine-tuning a large model costs hours or days, posterior uncertainty over the response surface makes hyperparameter search far more sample-efficient than blind sweeps.
- Posterior predictive anomaly detection: if the posterior predictive distribution says a new observation is extremely implausible under the learned model, that can trigger an alert for distribution shift or system misuse.
Backward reference: Bayes' theorem itself was developed in Chapter 6, Joint Distributions. Here we use it as the organizing principle for a full inferential framework.
2. Formal Definitions
2.1 Prior, Likelihood, Posterior, Evidence
Bayesian inference starts from four objects:
Each term has a distinct mathematical role.
- The prior encodes uncertainty about the parameter before observing the current dataset.
- The likelihood measures how compatible the observed data are with a candidate parameter value.
- The posterior is the updated distribution after combining prior information with data.
- The evidence or marginal likelihood normalizes the posterior and is obtained by integrating out the parameter.
Because the evidence does not depend on , the posterior is often written in proportional form:
This compact formula hides two deep facts.
First, Bayesian inference is a fusion rule. It multiplies two sources of information: what we believed before and what the data say now. Second, the evidence is not a nuisance constant in every context. It is also the quantity that makes Bayesian model comparison possible, because it scores how well an entire model, not just one fitted parameter value, explains the data.
Three examples:
Example 1: Bernoulli likelihood. If are coin flips and is the success probability, then
Multiplying by a Beta prior gives a Beta posterior.
Example 2: Gaussian mean with known variance. If and the prior is , then the posterior is also Gaussian. The posterior mean is a precision-weighted blend of and .
Example 3: Bayesian classifier. If is the class label and the features, then a posterior class probability
forms the basis of Naive Bayes and many other generative classifiers.
Non-examples clarify what these terms are not.
- The likelihood is not a probability distribution over . It is a function of indexed by the observed data.
- The prior is not always a belief about observed data. It is a distribution on parameters, hypotheses, or latent variables.
For AI: In modern ML notation, the negative log-likelihood is the training loss for many probabilistic models. Bayesian inference adds and then, if done fully rather than at the MAP level, integrates over rather than stopping at a single optimizer.
2.2 Continuous Bayes and Normalisation
For discrete parameter spaces, Bayes' rule involves finite sums. For continuous parameters, the denominator becomes an integral:
This denominator is essential. Without it, the right-hand side is only an unnormalized density. The posterior must integrate to 1:
The integral is often easy in conjugate models and painfully hard elsewhere. That computational gap is one reason Bayesian statistics splits naturally into exact inference and approximate inference.
Consider the Gaussian-Gaussian example from Chapter 6, Joint Distributions. Suppose
Then
Completing the square shows the posterior is Gaussian. The normalization constant exists in closed form because the product of two Gaussian kernels is another Gaussian kernel up to scale.
This example teaches a general lesson: Bayesian computation becomes manageable when multiplication by the prior preserves the family of the likelihood kernel.
There are several standard failure modes around normalization:
- The integral may be analytically unavailable.
- The prior may be improper, so one must verify the posterior is still proper.
- The parameter space may be high-dimensional, making numerical integration exponentially hard.
Examples:
- Proper posterior from improper prior: for some Gaussian-location problems, a flat improper prior still yields a normalizable posterior.
- Improper posterior from careless prior: certain hierarchical models with diffuse priors can fail to normalize, so the posterior is not a valid probability distribution.
- High-dimensional deep net: a Bayesian neural network with millions of weights has a posterior integral far beyond exact quadrature.
Non-examples:
- Replacing the evidence with the likelihood at the MLE is not Bayesian inference; that turns the posterior into an unnormalized surrogate.
- Dropping the evidence is okay for MAP optimization, but not for posterior probabilities, marginal likelihoods, Bayes factors, or predictive integration.
For AI: The entire machinery of variational inference and MCMC exists because the denominator is usually the computational bottleneck. In deep latent-variable models, the hard part is rarely writing down the posterior proportionality. The hard part is normalizing or integrating with respect to it.
2.3 Posterior Summaries and Bayes Estimators
The posterior is a full distribution, but many tasks require a point summary. Bayesian decision theory says the "best" posterior summary depends on the loss function.
Let be an action or estimate. Under posterior loss
the Bayes estimator is
Important special cases:
- Under squared loss , the Bayes estimator is the posterior mean .
- Under absolute loss , the Bayes estimator is a posterior median.
- Under 0-1 style mode-seeking loss on a discrete space, the Bayes estimator is the posterior mode, or MAP.
This already explains why MAP is not the unique Bayesian point estimator. It is one summary among several, and it is optimal only under a specific decision criterion.
Three examples:
Example 1: asymmetric costs. In content moderation, a false negative may cost more than a false positive. The optimal Bayesian decision threshold is then not 0.5 posterior probability. It depends on the posterior odds and the loss asymmetry.
Example 2: posterior mean for forecast demand. If overprediction and underprediction are penalized quadratically, the posterior mean is the optimal point forecast.
Example 3: posterior median for robust estimation. Under absolute loss, the posterior median is less sensitive to heavy tails than the posterior mean.
Non-examples:
- Choosing MAP because it "looks most probable" is not automatically justified if the downstream loss is not mode-seeking.
- Treating posterior mean and MAP as interchangeable is wrong in skewed, multimodal, or heavy-tailed posteriors.
For AI: Ranking, retrieval, moderation, and safe control all involve asymmetric losses. Bayesian inference becomes most useful when it is connected to the decision loss explicitly instead of being reduced immediately to one generic point estimate.
2.4 Credible Intervals vs Confidence Intervals
A Bayesian credible interval satisfies
under the posterior.
This should be contrasted with the frequentist confidence-interval statement from Estimation Theory, where probability refers to the long-run behavior of the method, not to the realized interval.
Two common types of credible intervals are:
- Equal-tail interval: cut posterior mass from each tail.
- Highest posterior density (HPD) interval: choose the smallest region containing posterior mass .
Examples:
- For a symmetric unimodal posterior, equal-tail and HPD intervals may be nearly identical.
- For a skewed posterior, the equal-tail interval can be noticeably wider on one side than the HPD set.
- For a multimodal posterior, the HPD region may be disconnected, which reminds us that "interval" language can hide complicated posterior geometry.
Non-examples:
- A credible interval is not guaranteed to have nominal frequentist coverage.
- A confidence interval does not permit the statement "there is 95% probability that lies here" after observing the data.
For AI: If a product owner asks for the probability that a model metric exceeds a launch threshold given observed test data, that is a posterior probability statement. Credible intervals and posterior tail probabilities answer it naturally.
2.5 Prior Families and Elicitation
Priors come in several broad families.
- Informative priors: encode strong domain knowledge.
- Weakly informative priors: rule out implausible extremes while leaving substantial room for the data.
- Conjugate priors: chosen for analytical convenience.
- Improper priors: not normalizable as distributions by themselves, but sometimes still produce proper posteriors.
- Hierarchical priors: place priors on hyperparameters so the strength of regularization is itself uncertain.
Prior elicitation is the process of translating domain knowledge into a distribution. In scientific problems, priors may come from physical limits, historical studies, or expert judgments. In ML, priors often come from structural beliefs: sparsity, smoothness, low rank, parameter sharing, or scale constraints.
Examples:
- A Beta prior on a click-through probability encodes plausible conversion rates.
- A Gaussian prior on linear coefficients encodes shrinkage toward zero.
- A hierarchical prior on task-specific parameters says related tasks should be similar but not identical.
Non-examples:
- "Use a completely flat prior because that is objective." Flatness depends on parameterization and is not invariant.
- "Use a conjugate prior because it must be correct." Conjugacy buys tractability, not truth.
Jeffreys priors attempt to address reparameterization by using the Fisher information:
This is a principled preview of objective Bayes, but not a universal solution. In modern practice, weakly informative priors are often preferred because they keep inference numerically stable and encode realistic scales.
For AI: Prior design is often regularizer design in disguise. If we believe weights should stay small, that is a Gaussian prior. If we believe only a few features matter, that is a sparsity prior. If we believe several tasks share structure, that is a hierarchical prior. Bayesian language makes those assumptions explicit rather than hiding them in penalties and initialization choices.
3. Core Theory I: Conjugacy and Closed-Form Updating
3.1 Conjugate Priors and Exponential Families
A prior family is conjugate to a likelihood family if the posterior belongs to the same family as the prior. Conjugacy matters because it converts posterior updating from a numerical integration problem into algebra.
The cleanest setting is the exponential family. If the likelihood can be written as
then a conjugate prior often has the form
After observing data , the posterior updates by simple addition:
This is one of the most revealing formulas in Bayesian statistics. It says prior information and data information often combine by adding sufficient statistics. The prior acts as pseudo-observations or prior counts. The posterior simply aggregates.
Three examples:
- Bernoulli likelihood + Beta prior: prior successes and failures become pseudo-counts.
- Poisson likelihood + Gamma prior: prior count rate and prior exposure update additively.
- Categorical likelihood + Dirichlet prior: prior class counts combine with observed class counts.
Why conjugacy is useful:
- closed-form posterior updates
- closed-form posterior predictive distributions
- clear interpretation of shrinkage and pseudo-counts
- efficient online updating
- clean pedagogical bridge from abstract Bayes to practical inference
Why conjugacy is limited:
- the prior may be chosen for algebra rather than realism
- many modern ML models are nonconjugate
- convenient families can underrepresent heavy tails, multimodality, or structural dependence
Examples and non-examples:
- Example: Beta prior for Bernoulli probability is conjugate because the powers of and remain Beta-shaped after multiplication by the likelihood.
- Example: Dirichlet prior for categorical class probabilities is conjugate because the multinomial likelihood simply increments component exponents.
- Non-example: a Gaussian prior on a Bernoulli probability constrained to is not even a valid prior on the parameter space.
- Non-example: a mixture prior may be valid and expressive, but it may no longer give a same-family posterior.
For AI: Conjugate models are not relics. Beta-Binomial click models, Dirichlet-Categorical smoothing, Gamma-Poisson count models, and Gaussian-Gaussian shrinkage all remain active tools in online experimentation, recommendation, Bayesian bandits, probabilistic monitoring, and NLP smoothing.
3.2 Beta-Binomial Model
The Beta-Binomial model is the canonical Bayesian update.
Let , and let . The likelihood is
Take the prior
Then the posterior is
so
This single formula teaches most of the basic Bayesian intuitions.
Pseudo-count interpretation. The prior behaves as if we had already seen successes and failures in a soft sense. More operationally, and set the prior mass and strength.
Shrinkage. The posterior mean is
It lies between the sample proportion and the prior mean . Small means stronger shrinkage to the prior; large lets the data dominate.
MAP. When and ,
This differs from both the posterior mean and the MLE unless special parameter choices collapse them together.
Examples:
- Uniform prior: gives posterior .
- Jeffreys prior: is invariant and avoids overcommitting near the boundaries.
- Strong prior around 0.5: choosing makes the posterior resistant to small-sample fluctuations.
Non-examples:
- Interpreting and as literal historical counts in every application. They are analogous to counts, not always actual counts.
- Forgetting that the Beta family lives on . It cannot be used directly for unconstrained parameters.
The posterior predictive for a new Bernoulli trial is
This is already a glimpse of a general principle: Bayesian prediction integrates out parameter uncertainty instead of plugging in a single estimate.
Why this matters conceptually:
- The posterior is a distribution over the click rate, conversion rate, toxicity rate, or failure probability.
- The posterior predictive gives the next-event probability directly.
- Sequential updating is trivial: every new success increments one shape parameter; every new failure increments the other.
ASCII POSTERIOR UPDATE FOR BERNOULLI DATA
======================================================================
prior: Beta(alpha, beta)
data: k successes, n-k failures
posterior: Beta(alpha + k, beta + n - k)
intuition:
successes push mass to the right
failures push mass to the left
larger alpha + beta means stronger prior pull
======================================================================
For AI: This model appears in A/B testing, Thompson sampling, spam filtering, quality-control monitoring, and online safety pipelines where outcomes are binary and decisions must update in real time.
It is worth seeing the algebra once in slow motion. Starting from
we gather exponents:
That kernel is exactly Beta. There is no approximation, no asymptotic step, and no optimization. Exact Bayes is simply pattern recognition in the algebra.
The posterior variance is
This formula gives the second major Bayesian intuition after shrinkage: uncertainty contracts as evidence accumulates. The posterior does not only move. It tightens.
Consider three standard examples.
Example 1: cold-start recommender system. A new item has 2 clicks from 3 impressions. The MLE click rate is , which is wildly unstable. A prior such as reflects an ecosystem in which most items receive around 10% CTR. The posterior becomes far more conservative, which is usually what a ranking system wants under scarce data.
Example 2: safety monitoring. If a moderation pipeline sees 0 failures in 20 inspected examples, the MLE failure rate is 0. A Bayesian posterior with a weak prior never collapses to exactly 0, which is much more realistic for risk management.
Example 3: adaptive experimentation. Thompson sampling draws from the posterior and chooses the arm with the highest sampled reward rate. Beta-Binomial conjugacy makes that update-and-sample loop extremely cheap.
Two non-examples are just as important.
Non-example 1: prior pretending to be data. Saying "my prior is equivalent to exactly 100 historical observations" can be useful pedagogically, but in serious applications the prior may encode structure, soft beliefs, or constraints that are not literally reducible to old samples.
Non-example 2: posterior mean as universal choice. In severe asymmetric-loss settings, the posterior mean of a probability can be the wrong decision summary. If false negatives are much more costly, the Bayes-optimal action may require a threshold on posterior tail probability rather than the mean.
There is also a useful boundary case. If formally, the prior becomes highly concentrated near the edges and can induce unstable or aggressive boundary behavior. This is a reminder that "uninformative" does not mean "harmless." Prior geometry matters.
3.3 Gamma-Poisson and Dirichlet-Categorical Models
The same additive logic extends beyond Bernoulli data.
Gamma-Poisson
Suppose . The likelihood is
With prior
the posterior becomes
Interpretation:
- acts like prior event mass
- acts like prior exposure
- posterior mean: , which blends prior rate and observed average count
Applications include event-frequency modeling, request-rate monitoring, failure counts, and token-count processes in simplified probabilistic language settings.
Dirichlet-Categorical
Suppose a categorical variable takes one of values with parameter vector satisfying and . A Dirichlet prior is
If the observed counts are , then
Again the update is just count addition.
Examples:
- Language-model smoothing preview: a Dirichlet prior prevents zero-probability estimates for rarely observed categories.
- Class-probability inference: posterior class probabilities remain defined even when some classes are absent in a small sample.
- Mixture-model component weights: Dirichlet priors regularize simplex-valued parameters.
Non-examples:
- Using independent Beta priors for a multinomial probability vector without enforcing the simplex constraint.
- Treating Dirichlet concentration as only a technical parameter. It governs both mean and certainty.
The Dirichlet concentration sum
controls prior strength. Small yields spiky priors; large yields concentrated priors around the prior mean .
For AI: Dirichlet and Gamma conjugacy remain useful in topic models, count data, categorical smoothing, bandit algorithms, and probabilistic routing systems.
3.4 Gaussian-Gaussian Updating
Gaussian updating is the continuous conjugate model that most clearly illustrates Bayesian shrinkage.
Assume
with known observation variance and prior variance .
The likelihood contribution from the sample mean is
Combining prior and likelihood gives
where
Writing precision as inverse variance makes the structure even clearer:
The posterior mean is a precision-weighted average:
This formula deserves to be internalized. Bayesian learning is not "prior versus data." It is weighted evidence combination. More reliable information gets more weight.
Examples:
- If is large, the prior is weak and .
- If is large, data are noisy and the posterior remains close to .
- If grows, the data precision overwhelms the prior precision, so the posterior concentrates near the MLE.
Non-examples:
- Saying the prior "biases" the estimate in a pathological sense. In small samples it often stabilizes estimation rather than distorting it.
- Assuming the posterior variance is the same as the sampling variance of . It is smaller whenever the prior carries information.
This model also gives an immediate bridge to ridge-style regularization and Kalman-style updating, though the latter belongs in the time-series section.
Forward reference: The Kalman filter is repeated Gaussian Bayesian updating in a linear dynamical system. Its full treatment belongs in Time Series, not here.
For AI: Gaussian shrinkage appears in Bayesian linear regression, Laplace approximations, Gaussian process intuition, and uncertainty-aware fine-tuning methods that treat parameter updates as noisy evidence.
The derivation also reveals something geometric. Starting from
expand the quadratic terms in and collect coefficients:
Completing the square gives the Gaussian posterior. The coefficient in front of is the posterior precision, and the linear coefficient determines the posterior center.
This derivation suggests a useful general heuristic:
- the likelihood contributes curvature proportional to data precision
- the prior contributes curvature proportional to prior precision
- the posterior combines them additively
That same heuristic reappears in Laplace approximations, natural-gradient intuition, Gaussian processes, Kalman filtering, and second-order uncertainty approximations in deep learning.
Three extended examples:
Example 1: prior as trusted baseline. Suppose a system has historical evidence that latency is near 80 ms, but the current rollout has only a few noisy measurements. The posterior mean stays near the historical value unless the new sample mean is both different and precise enough to overcome the prior.
Example 2: prior-data conflict. If the prior mean is far from the observed sample mean and the sample size is large, the posterior resolves the conflict decisively in favor of the data. Bayesian inference does not "force" prior belief forever. It merely weighs evidence.
Example 3: one noisy observation. With and large , the posterior mean barely moves. This is not stubbornness. It is rational resistance to noisy evidence.
Two non-examples:
Non-example 1: calling the posterior mean "biased toward the prior" as if any departure from were automatically a flaw. In finite samples, this bias can lower total posterior risk dramatically.
Non-example 2: thinking that a diffuse prior means no modeling choice was made. Choosing to be diffuse is still a choice, and in weakly identified problems it can change the posterior materially.
3.5 What Conjugacy Buys and What It Misses
Conjugacy gives at least five major benefits:
- exact posterior formulas
- exact posterior predictive formulas
- transparent prior-strength interpretation
- fast sequential updates
- easy pedagogical access to Bayesian logic
Those benefits make conjugate models indispensable for intuition, prototyping, online systems, and settings where the likelihood family already matches the application well.
But conjugacy also has limits:
- it encourages priors chosen for convenience rather than domain realism
- it can hide model mismatch
- it does not scale automatically to rich neural architectures
- it often excludes multimodal or structured posteriors
Three examples of what conjugacy misses:
- Deep neural posteriors: distributions over millions of weights are generally nonconjugate.
- Complex latent-variable models: exact integration is usually impossible.
- Structured priors: low-rank, graph-based, or combinatorial priors often leave the conjugate world.
The right lesson is not "conjugate Bayes is simplistic." The right lesson is that exact Bayesian updating is easy only for certain model families, and those families provide the foundation from which approximation methods are built.