Simulation-Based Inference, or SBI, solves a very modern statistical problem: what do we do when we can simulate data from a scientific model, but we cannot easily write down or evaluate the likelihood? This happens more often than it sounds, especially in cognitive science, neuroscience, ecology, physics, epidemiology, and other fields where the model is a dynamic process rather than a simple formula.
Classical Bayesian inference usually needs a likelihood: a function that tells us how probable the observed data is under a given set of parameters. But many realistic models are too complex for that. They may contain stochastic simulations, time-dependent decisions, hidden states, individual-level variation, or long chains of interacting mechanisms. The model can generate data, but the probability density of that data is analytically unavailable or computationally painful.
SBI turns this weakness into a workflow. Instead of asking for the likelihood directly, we repeatedly sample parameters from a prior, simulate data from the model, and train a neural inference system to learn the inverse mapping: from observed data back to plausible parameters. In other words, if the simulator can produce examples, SBI can learn how parameter values leave fingerprints in those examples.
This is where the BayesFlow and amortized Bayesian inference ecosystem becomes interesting. The framing is not just 'use a neural network'; it is about understanding when neural inference is a serious scientific tool for models whose likelihood is unavailable or too expensive.
BayesFlow is useful here because it gives a practical structure for amortized Bayesian inference: simulators, priors, adapters, summary networks, inference networks, posterior sampling, and diagnostics. That structure matters. Without it, SBI can easily become a pile of code fragments. With it, the workflow becomes inspectable: what is simulated, what is summarized, what is inferred, and how well the model recovers known parameters.
My example project applies this idea to the simplified SWIFT model of eye movements during reading. Reading behavior is dynamic: fixation durations, saccades, skipped words, refixations, and landing errors all interact over time. The full SWIFT model is computationally intensive and has an intractable likelihood, which makes it a natural candidate for SBI.
In my BayesFlow project, I built a simplified SWIFT-style simulator and used it to infer parameters such as nu, r, mu_T, and eta from simulated fixation sequences. The workflow included prior sampling, sequence simulation, adapter transformations, neural summary variables, FlowMatching-based inference, posterior sampling, and diagnostic plots such as loss trajectories, parameter recovery, and z-score contraction.
The diagnostics are important because SBI should not be treated like magic. In the SWIFT example, recovery was strong for parameters such as nu, r, and mu_T, while eta was harder to identify in the simplified setup. That is actually a useful result: it tells us which parts of the simulator are informative and which parts may need richer data, better summaries, or a refined model.
So SBI solves more than a technical likelihood problem. It gives us a way to keep complex generative models scientifically usable. The SWIFT project is my concrete example of that idea in action: a reading model with intractable likelihood, turned into an inspectable Bayesian inference pipeline.