Introduction to Probabilistic ML
Abstract
Section titled “Abstract”Inspired by Kevin P. Murphy’s series of books on probabilisitc machine learning, Marc Peter’s book On Mathematics for Machine Learning and Evarist Gine’s book on Mathematical Foundations of Infinite-Dimensional Statistical Models. With the ever growing field of machines learning, I will Only be able to cover a small portion of what is available, for more detail and up to date Appraoches, please refer to latest reports and publications.
Notes Format
Section titled “Notes Format”These notes will be written with a format consist of mathematics Specification in Lean4 Implementation in python with JAX.
Why Probabilistic Approaches
Section titled “Why Probabilistic Approaches”Traditional machine learning produces point estimates: a single best prediction or parameter value. Probabilistic machine learning models uncertainty explicitly, producing distributions over predictions and parameters. This distinction has several practical consequences:
Calibrated uncertainty: A model that outputs instead of expresses confidence. A classification model that reports “70% cat, 30% dog” is more informative than one that says “cat” with no certainty measure. In medical diagnosis, autonomous driving, and financial risk modeling, knowing how confident a prediction is matters as much as the prediction itself.
Regularization through priors: In Bayesian inference, the prior encodes beliefs about parameters before observing data. This acts as an implicit regularizer: strong priors shrink estimates toward plausible values, reducing overfitting on small datasets. Ridge regression and Lasso can both be derived as MAP estimates under Gaussian and Laplacian priors respectively.
Model comparison: Bayesian model selection uses the marginal likelihood (evidence) to compare models. This automatically penalizes model complexity (Occam’s razor), selecting models that are neither too simple nor too complex.
Active learning: When a model is uncertain about a prediction, it can request labels for the most informative data points. This is the foundation of Bayesian optimization and active learning, which reduce the amount of labeled data needed by orders of magnitude.
Probabilistic vs Deterministic Models
Section titled “Probabilistic vs Deterministic Models”| Aspect | Deterministic | Probabilistic |
|---|---|---|
| Output | Point estimate | Distribution |
| Parameters | Single optimal | Posterior |
| Uncertainty | Not quantified (unless via bootstrap) | Logically quantified via variance, credible intervals |
| Regularization | Explicit (L1/L2 penalties, dropout) | Implicit (through priors) |
| Model selection | Cross-validation, AIC/BIC | Marginal likelihood, Bayes factors |
| Small data | Prone to overfitting | Priors stabilize estimates |
| Computation | Often cheaper | Often more expensive (integration over parameters) |
Real-World Applications
Section titled “Real-World Applications”- Medical imaging: Bayesian U-Nets output uncertainty maps alongside predictions. Radiologists flag regions where the model is uncertain, improving diagnostic safety.
- Autonomous vehicles: Gaussian process outputs for obstacle positions enable planners to account for worst-case scenarios within credible bounds.
- Financial modeling: The Black-Litterman model combines investor priors with market data. Bayesian methods handle fat-tailed distributions and regime changes that frequentist models miss.
- Climate science: Gaussian process emulators surrogate expensive climate simulations, providing uncertainty bounds on temperature predictions while running in milliseconds.
- Natural language processing: Latent Dirichlet Allocation discovers latent themes in document collections. Variational inference makes these models tractable on large corpora.
- Drug discovery: Bayesian optimization balances exploration (uncertain regions) and exploitation (promising regions), reducing expensive wet-lab experiments.
Information Theory Connections
Section titled “Information Theory Connections”Information theory provides the mathematical language for probabilistic ML:
- Entropy measures the minimum average number of bits needed to encode outcomes of . Maximum entropy distributions are the least informative models consistent with given constraints, serving as principled priors.
- Mutual information quantifies the information one random variable provides about another. Used in feature selection, representation learning (INFOGAN), and the ELBO in variational inference.
- Cross-entropy is the standard loss for classification. Minimizing cross-entropy is equivalent to maximizing likelihood when is the model.
- KL divergence measures how one distribution diverges from a reference. Appears in the ELBO, variational objectives, and policy gradient methods (PPO).
Roadmap
Section titled “Roadmap”The subsequent chapters follow a progression from foundational probability through classical models to modern deep generative methods:
- Fundamentals — supervised and unsupervised learning from a probabilistic perspective, loss functions as negative log-likelihoods, Bayesian vs frequentist estimation
- Probability Distributions — exponential family, conjugate priors, Gaussian, categorical, Poisson, and their properties
- Bayesian Inference — exact inference, conjugate analysis, MCMC, variational inference
- Gaussian Processes — kernel functions, GP regression and classification, sparse approximations
- Latent Variable Models — mixture models, factor analysis, PCA as probabilistic model, EM algorithm
- Deep Generative Models — VAEs, normalizing flows, diffusion models, and training objectives
Common Pitfalls
Section titled “Common Pitfalls”Not making connections between different topics within the subject to build a coherent understanding.
Focusing only on content knowledge without developing exam technique and question-answering skills.
Ignoring feedback from marked work and failing to address recurring weaknesses.
Not practising with past papers or exercises under timed conditions.
Scope and Coverage
Section titled “Scope and Coverage”These notes cover the mathematical foundations required for understanding modern probabilistic machine learning:
- Probability Theory. Measure-theoretic foundations, -algebras, random variables, expectation, conditional probability, and Bayes’ theorem
- Statistical Inference. Maximum likelihood estimation (MLE), maximum a posteriori (MAP), Bayesian inference, and conjugate priors
- Linear Models. Bayesian linear regression, Gaussian processes, and kernel methods
- Latent Variable Models. Mixture models, EM algorithm, variational inference
- Deep Generative Models. Variational autoencoders (VAEs), normalising flows, diffusion models
- Graphical Models. Directed and undirected graphical models, message passing, belief propagation
Mathematical Prerequisites
Section titled “Mathematical Prerequisites”- Linear algebra: matrix decompositions (eigendecomposition, SVD), positive definite matrices, trace and determinant properties
- Calculus: multivariate calculus, gradients, Hessians, Jacobians
- Probability: random variables, expectation, variance, conditional distributions, Bayes’ theorem
- Optimization: gradient descent, convexity, Lagrangian duality
Software Stack
Section titled “Software Stack”| Component | Tool | Purpose |
|---|---|---|
| Array compute | JAX | Differentiable NumPy with GPU/TPU support |
| Probabilistic | NumPyro | Probabilistic programming on JAX |
| Visualization | Matplotlib | Plots and figures |
| Formalization | Lean 4 | Proof verification of key theorems |
Notation Conventions
Section titled “Notation Conventions”- Random variables: uppercase (, , ); realised values: lowercase (, , ).
- Vectors: bold lowercase (); matrices: bold uppercase ().
- Distributions: for density, for probability of event .
- Expectation: or .
- KL divergence: .
Key Results Used Throughout
Section titled “Key Results Used Throughout”- Bayes’ theorem: , the foundation of Bayesian inference.
- Law of total probability: , used to compute marginal likelihoods.
- Jensen’s inequality: for a convex function , . This underpins the evidence lower bound (ELBO) used in variational inference.
- Chain rule of probability: , the basis for autoregressive models.
- Central limit theorem: the sample mean as , justifying Gaussian approximations.
- Entropy: measures the uncertainty in a random variable.
- Cross-entropy: is the objective function for classification.
Summary
Section titled “Summary”The key principles covered in this topic are linked in the sub-pages above. Focus on understanding the definitions, applying the formulas or frameworks, and evaluating strengths and limitations of each approach.
Worked Examples
Section titled “Worked Examples”Worked examples demonstrating the application of key concepts are covered in the detailed sub-pages linked above.
Intuition
Section titled “Intuition”Probabilistic machine learning is like being a detective who deals in probabilities instead of certainties. Instead of saying “the suspect is guilty,” you say “there is an 80% chance the suspect is guilty.” Traditional ML gives you a single answer; probabilistic ML gives you a distribution of possible answers with confidence levels. This matters because in the real world, uncertainty is everywhere - medical diagnoses, self-driving cars, financial predictions. The key insight is that knowing how uncertain you are is often more valuable than the prediction itself. A model that says “I am 99% sure this is benign” is very different from one that says “I am 51% sure this is benign” - even though both predict the same thing.
Cross-References
Section titled “Cross-References”- Supervised Learning - The foundation of predictive modeling that probabilistic methods extend
- Definitions - Mathematical foundations for probability and statistics