A Unified Framework for Bayesian Thinking and Machine Learning

From understanding the world to acting on it: a cohesive framework for learning, modeling, and continuous refinement through Bayesian principles and ML tools.

As someone passionate about first principles, I am deeply interested in understanding concepts at their most fundamental and atomic layers. Although Bayesian reasoning and machine learning are conceptually distinct, they are closely related and often intertwined, especially with the rapid advancements in machine learning techniques in the past two decades. At a glance, they are definitely areas that are hard to delineate, which concept is being leveraged, and how they synergize. Or since they just work, we don’t need to put them into boxes?

For me, it is irritating if I cannot approach these two domains cohesively with an intuitive and easy-to-navigate mental model - and articulate it well. So, I dedicated a few quality hours to creating brain maps and diagrams to organize and distill these concepts, which I share in this blog. There is certainly convergence as both fields develop, especially with the latest rapid advances in AI.

The Unified Mental Model: Four Layers and Two Loops

After much deliberation, I came up with a primitive framework that consists of four interconnected layers and two feedback loops: Understanding → Intention → Tool & Usage → Outcome. I am convinced it can evolve to accommodate both and help us think of the two domains cohesively. Think of it as the operating system for intelligent systems that need to learn, adapt, and explain themselves. It’s difficult to fully describe it with words, so the interactive graph below does the explaining. Be sure to click on the elements to explore and stay awhile.

At this point, you may wonder - okay, fancy - so what? It’s totally fair - I never mentioned my original motivation of pursuing this unified mental model. It all started when I encountered a problem that I could not clearly think through which method to use, or how to leverage both. With it, it helps me better problem solve by maximizing both as a system and not as individual parts.

The big takeaway for me: the boundary between Bayesian reasoning and ML isn’t fixed - it’s a membrane that flows both ways.

Bayesian principles provide the normative framework for belief updating and decision-making under uncertainty1. They live in the Understanding layer - the “should” that defines what rational inference looks like. ML provides the computational engines that make these principles tractable at scale - variational inference2, stochastic gradient descent as approximate posterior sampling3, deep ensembles as marginalization4, and calibration methods that turn raw scores into trustworthy probabilities5. It’s the “can” that makes theory practical.

They’re not competing paradigms. Bayesian reasoning tells you what good inference looks like. ML tells you how to get there when you have millions of parameters. One without the other leaves you with either beautiful theory you can’t compute, or powerful algorithms with no principled foundation.

But here’s what makes this framework come alive: the flow isn’t just downward from theory to implementation.

The Upward Flow: When Computation Discovers Theory

ML doesn’t just implement existing theory. It discovers structure that reshapes our understanding. When computational discoveries prove robust across contexts, they graduate from tricks to truths. Consider convolutional networks. They discovered translation equivariance empirically through millions of gradient updates, revealing that nearby pixels matter more than distant ones. This discovery now exists as a foundational constraint in every vision architecture. Graph neural networks found permutation invariance for molecular structures. Physics-informed neural networks encode known laws directly into learning. These aren’t just clever implementations. They’re discoveries that reshape how we model the world.

This is the bidirectional flow that makes the framework work. Theory informs computation. Computation discovers theory. ML doesn’t just implement Bayesian models. It discovers the structure that future Bayesian models should encode.

Diagnosis: Knowing Which Loop to Pull

The framework’s real power emerges when things go wrong. As a seasoned AI debugger, I’ve learned to ask three diagnostic questions:

1) Is the error local or systemic? A cardiac model misclassifying athletes is local - stay in the fast loop, collect more athlete data, recalibrate for that segment. But persistent failure across all patient types despite tuning? That’s systemic. You need the slow loop - maybe you’re missing a fundamental variable or your measurement model is broken.

2) Did the world change or did your values? Your drift detector fires. New ECG machines? That’s a Tool & Usage fix - update preprocessing. New regulations requiring patient-facing explanations? That’s an Intention shift cascading new demands through your entire system.

3) Can you patch or must you rebuild? Temperature scaling for calibration is a patch. Discovering your Gaussian noise assumption fails due to quantization artifacts in ICU monitors requires rebuilding your likelihood model. The framework helps resist patching fundamental problems or overthinking tactical fixes.

The Living System

We’re not building static systems that pretend to have perfect knowledge. We’re building living systems that start uncertain, learn from evidence, discover structure, and know when to doubt themselves. The framework isn’t theoretical abstraction. It’s a daily decision tool. When calibration drifts, I stay in the fast loop. When errors persist across contexts despite good tuning, I examine Understanding. When regulations change, I revisit Intention. When ML discovers robust patterns that hold across diverse settings, I promote them upward into foundational assumptions.

This unifies “Bayesians” and “ML practitioners” - the real boundary isn’t between paradigms but between exact computation (beautiful but often impossible) and scalable approximations (practical and often sufficient). They need each other. Understanding sets what can be learned. Intention defines what “good” means. Tool & Usage provides the computational muscle. Outcome tells you whether to tune fast or revise slow. The interactive graph above contains the technical depth. Model classes, priors, likelihoods, utilities, calibration methods, drift detection. This post gives you the decision framework for knowing which lever to pull when reality disagrees with your predictions.

Have you checked your priors lately? More importantly, do you know which loop you’re in?


For more perspectives on this framework in action: The Paradox of Perfect Control in Medical Software - How this framework helps navigate regulatory requirements in medical AI. Life Lessons from Machine Learning - The human side of building learning systems.

Footnotes

  1. Bayesian Deep Learning is Needed in the Age of Large-Scale AI - Andrew Gordon Wilson et al., 2024

  2. Advances in Variational Inference - Cheng Zhang et al., 2017

  3. Bayesian Learning via Stochastic Gradient Langevin Dynamics - Max Welling and Yee Whye Teh, 2011

  4. Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles - Balaji Lakshminarayanan et al., 2017

  5. Calibration in Deep Learning: A Survey of the State-of-the-Art - Cheng Wang et al., 2023