- Introduced by
- Opper, M.; Sato, M. (among key contributors)
- Year
- 1990s–2000s
- Type
- Probabilistic sequential learning
- Family
- Machine learning
What does it do?
Bayesian online learning applies Bayesian inference sequentially: each new observation updates the current posterior over model parameters, and that posterior then serves as the prior for the next update.
This keeps a full probabilistic description of parameter uncertainty without re-processing earlier data, which suits streaming settings. Predictive uncertainty is only as reliable as the likelihood and any approximations used, so calibration has to be checked rather than assumed.
The intuition behind the method
Think of a weather forecaster who holds a probability distribution over possible weather models, not a single fixed model. Each day's new data nudges that distribution: some models become more plausible, others less so. Bayesian online learning works the same way. Instead of re-fitting from scratch when new data arrive, the model updates its beliefs incrementally. Because each prediction is derived from the full posterior, the method expresses how uncertain it is about future observations, which a point-estimate learner does not report directly.
History
Sequential Bayesian updating, in which the posterior after one observation becomes the prior for the next, is the basis of this method and is considerably older than the on-line learning literature. Recursive Bayesian estimation was already studied by 1988 (Kramer and Sorenson, 1988), and the same recursion underlies the Kalman filter. A Bayesian treatment of on-line learning is given by Opper (1998). Sato (2001) addressed online model selection: it derived an online version of the variational Bayes algorithm and proved its convergence by showing that it is a stochastic approximation for maximising the free energy. Its preliminary experiments on synthetic data reported that the method could adapt model structure to dynamic environments.
When to use it
Use Bayesian online learning when data arrive as a stream and re-training from scratch is infeasible or too slow, and when a full predictive distribution is needed alongside each prediction, for example in safety-critical or financial settings. It also fits problems where the data-generating process may change gradually and the parameter beliefs must be revised continuously. It is most natural for classification and regression with conjugate or approximately conjugate likelihoods. Avoid it when all data are available up front and exact batch Bayesian inference is tractable, since batch methods will be more accurate. Avoid it too when the likelihood is strongly non-conjugate and the computation budget is tight, because approximation errors can accumulate over many updates.
Limitations and considerations
- Choosing a well-specified prior requires domain expertise; a poor prior can bias the posterior for many steps before enough data correct it.
- Non-conjugate likelihoods force approximations (variational Bayes, expectation propagation, Laplace) that introduce their own errors.
- Approximate methods can accumulate errors over long data streams, so the sequential posterior can drift away from the exact posterior.
- Calibration of the predictive intervals holds only conditionally on the likelihood and the approximation being adequate for the data.
- Per-update cost grows with the dimension of the parameter space, so it is more demanding than simple stochastic gradient methods for large models.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Yields a full predictive distribution at each step, so forecasts come with intervals whose width reflects the current posterior uncertainty.
- Past observations enter only through the current posterior, so the stream does not need to be stored to perform the update.
- Parameter beliefs are revised as each observation arrives, which lets the model track gradual change; abrupt change needs an explicit forgetting or transition mechanism (see the FAQ).
- Matched conjugate prior-likelihood pairs, such as Gaussian with known variance, Beta with Bernoulli or Binomial, and Gamma with Poisson, give closed-form posterior updates, so each step avoids numerical optimisation.
- The prior acts as a regulariser that shrinks estimates when data are scarce, which matters most early in the stream.
- Predictions follow from probability theory, so the modelling assumptions behind them can be stated explicitly and examined.
Applications
- Streaming prediction problems such as click-through-rate estimation in online advertising, where user data arrive continuously.
- Adaptive filtering and tracking in robotics and navigation, where the Kalman filter is a special case.
- Personalisation systems that update user models incrementally without batch retraining.
- Financial time-series forecasting, where model parameters are expected to drift.
- Sensor-based monitoring in which a latent state is estimated from sequentially arriving readings, for example patient state in medical monitoring.
- Multi-armed bandit and reinforcement learning problems that require calibrated uncertainty for exploration.
How it works
How it works
Before any data are seen, a prior distribution over the model parameters is specified. For conjugate models this is often a Gaussian prior, as in the formula for this step; that pairing is conjugate for a Gaussian likelihood with known variance. A Beta prior paired with a Binomial likelihood is another common case. Where prior knowledge is absent, a diffuse distribution spreads probability over a wide range of parameter values.
Formula
p(\theta) \sim \mathcal{N}(\mu_0, \Sigma_0)Data arrive one sample (or one mini-batch) at a time rather than all at once. This streaming structure is what distinguishes online learning from batch learning. Each incoming observation triggers one update cycle without requiring access to previous observations.
For each new observation, the likelihood of that observation under the current parameter distribution is evaluated. Closed-form updates are available for matched prior-likelihood pairs, such as a Gaussian prior with a Gaussian likelihood (known variance), a Beta prior with a Bernoulli or Binomial likelihood, or a Gamma prior with a Poisson likelihood. Non-matched pairs, for example a Gaussian prior with a Bernoulli likelihood, require approximations such as the Laplace approximation, variational Bayes, or assumed density filtering.
Formula
p(y_t \mid x_t, \theta)
The posterior is obtained by multiplying the prior by the likelihood and normalising. The key online property is that the updated posterior immediately becomes the new prior, so historical data need not be stored. In approximate methods this step projects the true posterior back onto a tractable family, and that projection is where approximation error enters.
Formula
p(\theta \mid x_{1:t}, y_{1:t}) \propto p(y_t \mid x_t, \theta)\, p(\theta \mid x_{1:t-1}, y_{1:t-1})Predictions for future observations are made by integrating over the current posterior rather than plugging in a single point estimate. The resulting predictive distribution quantifies uncertainty, giving intervals around forecasts and flagging cases where the model lacks confidence.
Formula
p(y_{t+1} \mid x_{t+1}) = \int p(y_{t+1} \mid x_{t+1}, \theta)\, p(\theta \mid \text{data}_{1:t})\, d\thetaCommon pitfalls
- Using a strongly informative prior without justification, which can dominate the posterior even after many observations.
- Assuming a fixed likelihood family when the data-generating process changes abruptly (concept drift); this inflates posterior confidence incorrectly.
- Neglecting to monitor posterior covariance growth; forgetting mechanisms may be needed for persistent drift.
- Treating an approximate scheme (e.g., assumed density filtering) as exact inference and over-claiming the calibration of its predictive intervals.
Frequently asked questions
Is Bayesian online learning the same as the Kalman filter?
The Kalman filter is a special case of Bayesian online learning where the likelihood and transition model are linear-Gaussian, enabling exact closed-form posterior updates. Bayesian online learning is the broader framework that encompasses non-linear and non-Gaussian settings through approximations.
What happens if I use the wrong prior?
A misspecified prior biases the posterior for the early observations. As data accumulate, the likelihood carries more weight and the posterior moves toward the parameter values the data support, provided the model is identifiable and enough data arrive. In high-dimensional settings or under concept drift this correction may be slow or incomplete.
How do I handle non-conjugate likelihoods?
Common strategies include Laplace approximation (Gaussian approximation around the mode), online variational Bayes (optimise a tractable lower bound), expectation propagation (match moments of the posterior), and particle filters (Monte Carlo approximation). Each trades accuracy for computational cost differently.
Can Bayesian online learning handle concept drift?
Standard formulations assume a stationary parameter, so sharp concept drift is poorly handled. Forgetting mechanisms, such as discounting the prior with a leakage factor or using a dynamic Bayesian model with a random-walk transition, extend the framework to non-stationary environments.
How is this different from plain stochastic gradient descent?
SGD finds a single point estimate of the parameters by following noisy gradient steps; it produces no uncertainty estimate. Bayesian online learning maintains a full distribution over parameters, enabling calibrated predictive intervals at the cost of higher computational complexity per update.
Related methods
Sources
Opper, M. (1998). A Bayesian approach to on-line learning. In D. Saad (Ed.), On-Line Learning in Neural Networks (pp. 363–378). Cambridge University Press.
Open publication referenceSato, M. (2001). Online model selection based on the variational Bayes. Neural Computation, 13(7), 1649–1681.
Open DOI reference