Skip to main content
QUICK REVIEW

[Paper Review] Improvements to Inference Compilation for Probabilistic Programming in Large-Scale Scientific Simulators

Mario Lezcano Casado, Atılım Güneş Baydin|arXiv (Cornell University)|Dec 21, 2017
Particle physics theoretical and experimental studiesPhysics and Astronomy16 references7 citations
TL;DR

This paper introduces CPProb, a C++14 probabilistic programming library that enables efficient inference compilation for large-scale scientific simulators like SHERPA in high-energy physics. By instrumenting C++ code with minimal modifications, CPProb supports importance sampling with learned proposal networks, reducing average execution trace length from unbounded to 8.37 and enabling accurate posterior inference for Higgs boson properties with 60–90% accuracy on common decay channels.

ABSTRACT

We consider the problem of Bayesian inference in the family of probabilistic models implicitly defined by stochastic generative models of data. In scientific fields ranging from population biology to cosmology, low-level mechanistic components are composed to create complex generative models. These models lead to intractable likelihoods and are typically non-differentiable, which poses challenges for traditional approaches to inference. We extend previous work in "inference compilation", which combines universal probabilistic programming and deep learning methods, to large-scale scientific simulators, and introduce a C++ based probabilistic programming library called CPProb. We successfully use CPProb to interface with SHERPA, a large code-base used in particle physics. Here we describe the technical innovations realized and planned for this library.

Motivation & Objective

  • To enable Bayesian inference in large-scale scientific simulators with intractable likelihoods and non-differentiable components.
  • To extend inference compilation to complex, production-grade C++ simulators such as SHERPA and GEANT used in high-energy physics.
  • To develop a minimal-intrusion interface for integrating probabilistic programming into existing C++ simulation codebases.
  • To address the challenge of unbounded execution traces in algorithms like rejection sampling common in particle physics.
  • To support interpretable, high-fidelity posterior sampling through trace inspection and debugging tools.

Proposed method

  • CPProb uses a universal probabilistic programming approach, allowing inference in existing C++ simulators without rewriting, by redirecting random number generation and adding annotations.
  • The library introduces three core functions: sample (for stochastic choices), observe (for conditioning on data), and predict (for reporting latent variables).
  • Execution traces are tracked via statically typed addresses that encode structural positions in the computation, enabling trace reconstruction and debugging.
  • Inference is performed using sequential importance sampling (SIS) with a deep neural network that learns proposal distributions to improve sampling efficiency.
  • A novel code annotation scheme was developed to handle unbounded-length traces in rejection sampling, enabling training and inference in previously intractable cases.
  • A probabilistic model debugging tool visualizes execution traces as address succession graphs, identifying sources of long traces in the simulator code.

Experimental results

Research questions

  • RQ1Can inference compilation be effectively scaled to large, production-grade C++ simulators used in high-energy physics?
  • RQ2How can probabilistic programming be integrated into existing, complex simulators with minimal code modifications?
  • RQ3What techniques can mitigate the challenge of unbounded execution traces in likelihood-free inference for particle physics?
  • RQ4How effective is the learned proposal network in improving sampling efficiency for posterior inference in high-dimensional, non-differentiable models?
  • RQ5Can trace inspection and debugging tools improve the reliability and interpretability of inference in complex simulators?

Key findings

  • The average execution trace length in the SHERPA τ decay simulator was reduced from unbounded to 8.37 after applying the new rejection sampling annotation scheme.
  • The longest recorded execution trace was reduced to 42 steps, making training of the inference network feasible.
  • Initial posterior inference achieved 60–90% accuracy for the most frequent τ decay channels using a basic similarity kernel in ABC.
  • The probabilistic model debugging tool successfully identified the source of long traces, pinpointing specific random number generation calls in the SHERPA codebase.
  • The address succession graph representation enabled clear visualization of probabilistic execution flow, supporting model inspection and validation.
  • The work demonstrates the feasibility of applying inference compilation to real-world, high-performance scientific simulators with over 1 million lines of code.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.