Abstract
Structured Factored Inference (SFI) is a framework that automatically decomposes complex probabilistic programs into a hierarchy of submodels. By adaptively applying the most suitable inference algorithm—whether exact or approximate—to each sub-component and "rolling up" the results, SFI achieves the accuracy of exact inference with the scalability of approximate methods.
Introduction
Probabilistic programming (PP) allows researchers to write rich, complex models as code, but performing inference—calculating probabilities from those models—remains a massive computational bottleneck. The core challenge is that no single inference algorithm is a "silver bullet." Exact algorithms like Variable Elimination (VE) provide perfect answers but explode in complexity as models grow. Approximate algorithms like Belief Propagation (BP) or Gibbs Sampling (GS) scale better but can be inaccurate.
Currently, AI engineers must manually "hand-engineer" inference by picking and tuning algorithms for specific parts of a model—a process that is often more time-consuming than building the model itself. SFI seeks to automate this decomposition and algorithm selection process.
Methods
Implemented within the SimPPL (Simple Probabilistic Programming Language) framework, SFI uses the program's structure—specifically Chain variables—to identify natural "decomposition points." This creates a hierarchy of submodels where the system evaluates each component and chooses the best tool for the job. For example, it might use exact VE for a small discrete sub-component and MCMC for a large continuous one.
Once a submodel is solved, its result is represented as a "factor" (a joint distribution over relevant variables) and passed up to the parent model. This "factor roll-up" effectively hides the internal complexity of the submodel from the rest of the system. A major technical contribution of SFI is the mathematical refinement of these factors, reducing their interface size from exponential to linear or quadratic, preventing the roll-up process itself from becoming a bottleneck.
Evaluation and Key Results
The researchers evaluated SFI on three distinct model types: a modified QMR medical diagnosis network, a mixed directed-undirected Ising model, and a real-world Desktop Activity Recognition model from the DARPA PAL program.
Key findings include:
- Scaling where others fail: On the Desktop Activity Recognition model, all standard (non-SFI) factored algorithms failed due to computational complexity. SFI solved the full 162-event model.
- Efficiency and Accuracy: On an 88-event activity model, SFI-VE achieved a 94% accuracy rate and was more than eight times faster than Belief Propagation (233 seconds vs. 2,007 seconds).
- Hierarchical Superiority: Even when using the same algorithm, running it hierarchically often outperforms running it on a "flat" version of the model. This is because the hierarchy imposes a better "elimination order," a known NP-hard problem in graphical models.
Discussion and Insights
SFI treats the probabilistic program not just as a mathematical expression, but as a structured piece of software. The "hierarchy of submodels" is already present in how programmers write functions and chains; SFI simply leverages that existing structure for mathematical optimization. Just as encapsulation in standard programming hides implementation details, SFI's factor representation encapsulates probabilistic complexity. The top-level model doesn't need to know how a submodel calculated its result, only what the resulting distribution is.
Limitations and Future Work
While SFI works well in practice, formal error bounds for cases where multiple approximate algorithms are nested within each other have yet to be proven. The current system uses relatively simple heuristics to choose between algorithms; future iterations may use machine-learning-based selection. Additionally, the authors are developing "Lazy SFI" (LSFI) to handle non-terminating models, which are common in complex, open-ended simulations.
Summary updated