A prior distribution is the probability distribution that expresses what is believed about an unknown quantity, such as a model parameter, before the observed data is taken into account. In probabilistic models and Bayesian inference, the prior is combined with the likelihood of the data through Bayes’ theorem to produce the posterior distribution, which is the updated belief after observation.
The term prior probability is often used for the same idea when the unknown is a discrete event or hypothesis. In machine learning and artificial intelligence, priors act as a principled form of regularization: they pull estimates toward plausible values when data is scarce and lose influence as evidence accumulates.
How the prior enters Bayes’ theorem
Bayes’ theorem states that the posterior is proportional to the likelihood times the prior, written p(θ | D) ∝ p(D | θ) p(θ). The prior p(θ) assigns weight to every possible parameter value, the likelihood p(D | θ) measures how well each value explains the data, and the normalizing constant is the marginal likelihood, also called the evidence.
The relative influence of prior and data depends on their information content. With few observations the prior dominates; with many observations the likelihood becomes sharply peaked and the posterior converges toward the same answer regardless of most reasonable priors. This behavior is known as the data overwhelming the prior.
The table below shows how the balance shifts with sample size for a typical well-behaved model.
| Amount of data | Role of the prior | Practical consequence |
|---|---|---|
| None | Fully determines beliefs | Predictions reflect assumptions only |
| Small sample | Strong regularizing effect | Prior choice changes results visibly |
| Moderate sample | Shared influence | Sensitivity analysis is advisable |
| Large sample | Minor influence | Posterior close to likelihood-based estimate |
Types of prior distributions
Priors are classified by how much information they carry and how they were constructed. The choice reflects the modeler’s knowledge, computational needs and the risk of biasing the result.
| Type | Description | Typical use |
|---|---|---|
| Informative prior | Encodes substantial domain knowledge | Clinical trials with historical data |
| Weakly informative prior | Rules out implausible values only | Default in modern applied modeling |
| Noninformative prior | Aims to add minimal information | Objective Bayesian analysis |
| Conjugate prior | Yields a posterior of the same family | Closed-form updating, streaming data |
| Hierarchical prior | Parameters of the prior are themselves uncertain | Pooling information across groups |
| Empirical Bayes prior | Estimated from the data itself | Large-scale testing, shrinkage |
A flat or uniform prior is often assumed to be noninformative, but this is a common misconception: a flat prior on one scale becomes non-flat after reparameterization. The Jeffreys prior was designed to be invariant under such transformations. Priors that do not integrate to one are called improper priors; they can be acceptable only when the resulting posterior is proper.
Common priors in machine learning
Many familiar machine learning techniques correspond to specific priors placed on model weights. Maximum a posteriori estimation makes this link explicit, because maximizing the posterior equals minimizing a loss plus a penalty derived from the negative log prior.
| Prior on parameters | Equivalent technique | Effect on estimates |
|---|---|---|
| Gaussian prior | L2 regularization (ridge, weight decay) | Shrinks weights smoothly toward zero |
| Laplace prior | L1 regularization (lasso) | Encourages sparse weights |
| Beta prior | Smoothed rates, Thompson sampling | Stabilizes probability estimates |
| Dirichlet prior | Additive smoothing, topic models | Prevents zero probabilities |
| Spike-and-slab prior | Bayesian variable selection | Separates relevant and irrelevant features |
In Bayesian neural networks, a prior is placed over millions of weights, usually an independent Gaussian. Such priors are chosen mostly for convenience, and research shows that they can induce poorly calibrated function-space behavior, which is one reason why deep ensembles and Monte Carlo dropout remain popular approximations for uncertainty quantification.
Choosing and checking a prior
A good prior is defensible, documented and tested. Practitioners elicit knowledge from experts or past studies, express it on an interpretable scale and then verify that the prior produces sensible outcomes before any data is fitted.
- Prior predictive checks: simulate data from the prior alone and confirm that the simulated values are plausible in magnitude and sign.
- Sensitivity analysis: refit the model under alternative priors and report whether conclusions change.
- Scale awareness: standardize predictors so that a single weakly informative prior is meaningful across all coefficients.
- Avoid overly vague priors: extremely wide priors can place most mass on absurd values and destabilize samplers such as Hamiltonian Monte Carlo.
Computation also shapes the choice. Conjugate priors allow exact posteriors, whereas nonconjugate priors require approximate methods such as Markov chain Monte Carlo or variational inference. Probabilistic programming languages make nonconjugate priors routine, so conjugacy is now a convenience rather than a requirement.
Limitations and criticism
The main criticism of priors is subjectivity: two analysts with different priors can reach different conclusions from the same small dataset. Bayesian practice answers this by making assumptions explicit and testable, whereas many classical methods embed comparable assumptions implicitly.
Further risks include prior-data conflict, where the data strongly contradicts the prior and the posterior becomes a misleading compromise, and identifiability problems, where the prior silently determines parameters that the data cannot inform. Both are detected through posterior diagnostics and comparisons between prior and posterior marginals.
Priors also interact with model comparison more strongly than with estimation. The marginal likelihood integrates the likelihood over the prior, so an unnecessarily wide prior spreads probability over implausible values and penalizes the model, an effect known as the Jeffreys-Lindley paradox. As a result, Bayes factors can be highly sensitive to prior width even when posterior estimates are not, and improper priors make Bayes factors undefined.
Finally, a prior is only as good as the knowledge behind it. Historical data may come from a different population, expert opinion may be overconfident, and defaults copied from software documentation may not suit the scale of the problem. Robust practice treats the prior as a modeling assumption to be reported and challenged, in the same way as the choice of likelihood or the selection of features.
Stripped to the essentials
A prior distribution is what you believe before you look at the evidence. It is written as probabilities, so it shows which answers seem likely and which seem unlikely.
Imagine guessing how long a new restaurant takes to serve a meal. Before your first visit, you expect about twenty minutes, based on other restaurants. That expectation is your prior. After several visits, your own experience matters more than the first guess. The prior simply gives you a sensible starting point when you have little information.
Where it is applied
An online retailer tests a new checkout page. After the first day, the new version shows 12 purchases from 100 visitors, while the old version shows 10 from 100. A naive comparison suggests a large improvement, but the sample is tiny.
The analytics team uses a Beta prior centered near the historical conversion rate of about 10 percent, with a weight equivalent to roughly 200 earlier visitors. Combined with the new data, the posterior for the new page centers near 10.7 percent rather than 12 percent, and the probability that it truly outperforms the old page is modest.
The prior prevents an early, overconfident launch decision. After two weeks and several thousand visitors, the data dominates the prior, the posterior narrows and the team makes the final decision on evidence rather than on a lucky first day.