Papers
Topics
Authors
Recent
Search
2000 character limit reached

Probabilistic Program Graphs (PPGs)

Updated 12 July 2026
  • Probabilistic Program Graphs are graph-based abstractions that represent probabilistic computations by encoding program points, sample sites, and various dependency types.
  • They encompass diverse semantics—including control-flow, automata-theoretic, static, and reactive models—to support tasks like inference, slicing, and fault localization.
  • Their flexible structure enables localized computation and optimization techniques, such as incremental MCMC, variational inference, and efficient dependency analysis.

Probabilistic Program Graphs (PPGs) are graph-based representations of probabilistic computation in which nodes encode program points, checkpoints, sample sites, graph-interface terms, or dependence locations, and edges encode control flow, stochastic transitions, data/control dependence, or explicit reactive dependencies. The term is not used uniformly across the literature. In one line of work, PPGs are probabilistic control-flow graphs for imperative programs with random assignment and observe statements (Amtoft et al., 2017). In another, they are automata-theoretic checkpoint graphs for universal probabilistic programs with arbitrary measures, score functions, and unbounded loops (Boreale et al., 23 Mar 2026). Other usages include static dependency graphs over user-labelled sample sites (Böck et al., 28 Aug 2025), dynamic reactive graphs for incremental MCMC (Palmkvist et al., 29 Jun 2026), equationally specified interfaces for random graph models (Ackerman et al., 2023), and probabilistic program dependence graphs for fault localization (Askarunisa et al., 2012). The common denominator is a graph-structured semantic or analytic abstraction that exposes probabilistic dependencies more explicitly than the source program alone.

1. Terminological scope and main variants

The label “PPG” denotes several non-identical formalisms. The following usage classes are explicitly documented.

Variant Core graph objects Primary role
Probabilistic control-flow graph Program points, control-flow edges, assignments, observe, branches Operational semantics for probabilistic imperative programs
Automata-theoretic PPG Checkpoints, guarded transitions, parametric measures, node scores Infinite-trace semantics, Feynman–Kac framing, SMC
Static sample-site PPG Sample statements and conservative dependency edges Static factorization and slicing
Reactive PPG DAG nodes for assume, deterministic computation, weight, subgraphs Incremental MCMC recomputation
Graph-interface PPG Typed terms over new and edge Random graph semantics via graphons
Probabilistic program dependence graph PDG nodes with CPTs Fault localization

In the 2017 semantics paper, probabilistic program graphs are control-flow graphs for probabilistic imperative programs, with node labels such as deterministic assignment, random assignment, Observe B, Skip, and branching conditions (Amtoft et al., 2017). In the 2026 universal-probabilistic-programming formulation, a PPG on Rˉm\bar{\mathbb{R}}^m is a tuple G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma), where transitions carry predicates and parametric measures, and checkpoints carry score functions (Boreale et al., 23 Mar 2026). In the static-factorisation setting, the graph is built over user-labelled sample statements and conservative dependencies computed from a CFG (Böck et al., 28 Aug 2025). In the reactive-graph setting, a single run yields a finite DAG whose nodes represent random variables, deterministic computations, factor nodes, and subgraphs (Palmkvist et al., 29 Jun 2026).

This multiplicity is substantive rather than merely terminological. Some PPGs are semantic objects for entire programs, some are per-trace dynamic structures, and some are static approximations used to derive factorizations or support inference transformations. A plausible implication is that “Probabilistic Program Graph” functions as an umbrella term for graph-based intermediate representations of probabilistic programs rather than a single standardized formalism.

2. Control-flow semantics and adequacy for structured programs

In the control-flow interpretation, a pCFG is a directed graph with nodes VV, special Start and End nodes, and labels for deterministic assignment x:=Ex := E, random assignment xψx \sim \psi, Observe B, Skip, and branching on a boolean BB (Amtoft et al., 2017). Stores are functions s:VarZs:\mathrm{Var}\to\mathbb{Z} over a finite variable set, and distributions are sub-probability distributions D:F[0,)D:F\to[0,\infty) with total mass at most $1$.

The semantics is given as a distribution transformer. For deterministic assignment,

x:=e(D)(s)  =  sF:s=s[x[e]s]D(s).\llbracket x := e \rrbracket(D)(s') \;=\; \sum_{s \in F:\, s' = s[x \mapsto [e]s]} D(s).

For state-independent random assignment,

G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)0

For observe,

G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)1

Selection, deterministic assignment, and random assignment are continuous, additive, multiplicative, and non-increasing; the selection operator additionally satisfies G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)2 (Amtoft et al., 2017).

Loops are handled through postdomination and a least fixed point over modification functions. If G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)3 postdominates G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)4, and G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)5 is the first proper postdominator, semantic equations are defined by a continuous functional G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)6 whose least fixed point G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)7 gives the graph semantics. Intuitively, G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)8 allows at most G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)9 back-edges (Amtoft et al., 2017). For a pCFG VV0 with Start node VV1 and End node VV2, the graph transformer is

VV3

The same paper relates this operational semantics to a standard expectation-transformer semantics for structured statements skip, assignment, random assignment, observe, sequencing, conditionals, and while (Amtoft et al., 2017). Program-level normalization for VV4 is defined by

VV5

The adequacy theorem states that if VV6 and VV7, then

VV8

establishing that the pCFG semantics preserves denotationally computed expectations without loss of information (Amtoft et al., 2017).

A worked example in the same development uses VV9 uniform on x:=Ex := E0 and the program

x:=Ex := E1

After the two random assignments, the joint distribution on x:=Ex := E2 is uniform on x:=Ex := E3; after observe, only x:=Ex := E4, x:=Ex := E5, and x:=Ex := E6 remain, each with mass x:=Ex := E7, so the total surviving mass is x:=Ex := E8 and the normalized return value is x:=Ex := E9 (Amtoft et al., 2017).

3. Infinite-trace weighted semantics and the Feynman–Kac interpretation

The automata-theoretic formulation generalizes PPGs from discrete imperative pCFGs to universal probabilistic programs with arbitrary measures, score functions, and unbounded loops (Boreale et al., 23 Mar 2026). For fixed xψx \sim \psi0, a PPG on xψx \sim \psi1 is a tuple xψx \sim \psi2 in which xψx \sim \psi3 is a finite set of checkpoints, xψx \sim \psi4 is a finite set of transitions xψx \sim \psi5 with guard xψx \sim \psi6 and parametric measure xψx \sim \psi7, xψx \sim \psi8 is the distinguished terminated checkpoint with only outgoing transition xψx \sim \psi9, and BB0 assigns a score function to each checkpoint (Boreale et al., 23 Mar 2026). Outgoing predicates at each checkpoint sum to BB1.

The operational kernel on global states BB2 is

BB3

where BB4 (Boreale et al., 23 Mar 2026). This induces finite-trace measures BB5 and, by Ionescu–Tulcea, an infinite-trace law BB6 on the cylindrical BB7-field of BB8 (Boreale et al., 23 Mar 2026).

Weights are checkpoint-local. Defining

BB9

the semantics of a nonnegative measurable s:VarZs:\mathrm{Var}\to\mathbb{Z}0 is

s:VarZs:\mathrm{Var}\to\mathbb{Z}1

provided s:VarZs:\mathrm{Var}\to\mathbb{Z}2 (Boreale et al., 23 Mar 2026). Here conditioning and soft evidence are handled by multiplicative checkpoint scores rather than statement-level pruning.

The finite approximation theorem introduces prefix-closed functionals and proves explicit lower and upper bounds in terms of fixed-length traces. If s:VarZs:\mathrm{Var}\to\mathbb{Z}3 and s:VarZs:\mathrm{Var}\to\mathbb{Z}4, with

s:VarZs:\mathrm{Var}\to\mathbb{Z}5

then

s:VarZs:\mathrm{Var}\to\mathbb{Z}6

If termination is almost sure, both bounds converge to s:VarZs:\mathrm{Var}\to\mathbb{Z}7 as s:VarZs:\mathrm{Var}\to\mathbb{Z}8 (Boreale et al., 23 Mar 2026).

The same work frames the semantics as a Feynman–Kac model with state space s:VarZs:\mathrm{Var}\to\mathbb{Z}9, initial law D:F[0,)D:F\to[0,\infty)0, transition kernels D:F[0,)D:F\to[0,\infty)1, and potentials D:F[0,)D:F\to[0,\infty)2 (Boreale et al., 23 Mar 2026). The global potential is then D:F[0,)D:F\to[0,\infty)3, and the normalized path measure is

D:F[0,)D:F\to[0,\infty)4

This reframing yields a direct consistency path for bootstrap particle filtering. Under bounded potentials and multinomial resampling,

D:F[0,)D:F\to[0,\infty)5

for measurable nonnegative D:F[0,)D:F\to[0,\infty)6 (Boreale et al., 23 Mar 2026).

The vectorized Particle Filtering algorithm (VPF) stores particle values, node indices, and weights in arrays, computes masks D:F[0,)D:F\to[0,\infty)7 per transition, and advances all particles in lock-step through the PPG (Boreale et al., 23 Mar 2026). The experiments summarized in the paper report accuracy comparable to state-of-the-art systems and significant speedups, especially at D:F[0,)D:F\to[0,\infty)8, with runtime largely insensitive to conditioning frequency (Boreale et al., 23 Mar 2026).

4. Static factorisation, dependency approximation, and slicing

A distinct PPG line treats the graph as a static approximation of dependency structure in programs with user-labelled sample statements and while loops (Böck et al., 28 Aug 2025). A program state is a finite map D:F[0,)D:F\to[0,\infty)9 from variables to values, including a distinguished variable $1$0 that accumulates density. Random variables are introduced only at sample statements

$1$1

where $1$2 is a user-provided address and the trace $1$3 maps addresses to values (Böck et al., 28 Aug 2025). Observations are realized by fixing $1$4 at addresses, so likelihood contributions are attached to the corresponding sample sites rather than expressed with a separate observe syntax.

The big-step sample rule is

$1$5

Programs are translated to CFGs with node types START, END, Assign, Branch(E), and Join; CFG semantics are proved equivalent to operational semantics (Böck et al., 28 Aug 2025).

The PPG is then constructed by a static provenance analysis. Each source-level sample statement becomes a graph node. For a sample node $1$6, the conservative dependency set is

$1$7

Here $1$8 over-approximates addresses needed to determine the value of variable $1$9 before executing x:=e(D)(s)  =  sF:s=s[x[e]s]D(s).\llbracket x := e \rrbracket(D)(s') \;=\; \sum_{s \in F:\, s' = s[x \mapsto [e]s]} D(s).0, using reaching definitions x:=e(D)(s)  =  sF:s=s[x[e]s]D(s).\llbracket x := e \rrbracket(D)(s') \;=\; \sum_{s \in F:\, s' = s[x \mapsto [e]s]} D(s).1 and branch parents x:=e(D)(s)  =  sF:s=s[x[e]s]D(s).\llbracket x := e \rrbracket(D)(s') \;=\; \sum_{s \in F:\, s' = s[x \mapsto [e]s]} D(s).2 (Böck et al., 28 Aug 2025). Directed edges of the PPG go from x:=e(D)(s)  =  sF:s=s[x[e]s]D(s).\llbracket x := e \rrbracket(D)(s') \;=\; \sum_{s \in F:\, s' = s[x \mapsto [e]s]} D(s).3 to x:=e(D)(s)  =  sF:s=s[x[e]s]D(s).\llbracket x := e \rrbracket(D)(s') \;=\; \sum_{s \in F:\, s' = s[x \mapsto [e]s]} D(s).4.

For loop-free programs with unique constant labels, this recovers the standard Bayesian-network factorization

x:=e(D)(s)  =  sF:s=s[x[e]s]D(s).\llbracket x := e \rrbracket(D)(s') \;=\; \sum_{s \in F:\, s' = s[x \mapsto [e]s]} D(s).5

More generally, the program density factors as

x:=e(D)(s)  =  sF:s=s[x[e]s]D(s).\llbracket x := e \rrbracket(D)(s') \;=\; \sum_{s \in F:\, s' = s[x \mapsto [e]s]} D(s).6

one factor per sample site, even when loops or dynamic labels induce an unbounded family of runtime random variables (Böck et al., 28 Aug 2025). In the loop-free unique-address case, Theorem 2 gives

x:=e(D)(s)  =  sF:s=s[x[e]s]D(s).\llbracket x := e \rrbracket(D)(s') \;=\; \sum_{s \in F:\, s' = s[x \mapsto [e]s]} D(s).7

where x:=e(D)(s)  =  sF:s=s[x[e]s]D(s).\llbracket x := e \rrbracket(D)(s') \;=\; \sum_{s \in F:\, s' = s[x \mapsto [e]s]} D(s).8 gates the factor by branch conditions (Böck et al., 28 Aug 2025). With dynamic labels or non-unique labels, the factorization corresponds instead to a Markov network whose clique potentials are the per-site factors (Böck et al., 28 Aug 2025).

The paper further defines a slicing technique driven by the PPG. For a site of interest x:=e(D)(s)  =  sF:s=s[x[e]s]D(s).\llbracket x := e \rrbracket(D)(s') \;=\; \sum_{s \in F:\, s' = s[x \mapsto [e]s]} D(s).9, the slice retains only nodes on paths from G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)00 to dependent sites and converts unrelated intervening sample nodes into read statements (Böck et al., 28 Aug 2025). The key correctness theorem states that, for traces differing only at address G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)01, the full-program log-density difference equals the sliced-program log-density difference under appropriate matching conditions (Böck et al., 28 Aug 2025). This locality enables three optimizations.

For variational inference, a localized score estimator is proved: G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)02 For single-site Metropolis–Hastings, only the neighborhood G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)03 contributes to the acceptance ratio: G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)04 For SMC, slicing yields local incremental weights

G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)05

on the sliced CFG (Böck et al., 28 Aug 2025).

The empirical summary reports single-site MH speedups of G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)06–G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)07, VI gradient-variance reductions up to four orders of magnitude, and SMC per-step speedups of G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)08–G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)09 on the considered benchmarks (Böck et al., 28 Aug 2025).

5. Dynamic reactive graphs and execution-local PPGs

Reactive graphs recast a probabilistic program run as a finite directed acyclic graph G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)10 built in topological order during execution (Palmkvist et al., 29 Jun 2026). The graph records a particular execution trace. Recursion and probabilistic branching therefore do not appear as graph cycles in a run-level PPG; they are represented by nested subgraphs (Palmkvist et al., 29 Jun 2026).

Node types are partitioned into random-variable nodes G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)11, deterministic computation nodes G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)12, factor or observation nodes G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)13, and subgraph nodes G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)14 (Palmkvist et al., 29 Jun 2026). Random-variable nodes are created by assume; each stores the current sample, a change-id, and an update function capable of redrawing the variable, reweighting it under changed distribution parents, and recording rollback actions. Deterministic nodes are created by pure, map, and apply; factor nodes are created by weight; and subgraph nodes are created by sub and composed with join to handle dynamic control flow and recursion (Palmkvist et al., 29 Jun 2026).

A compiler translates a high-level universal probabilistic program into a graph-building program over an interface with operations pure, map, apply, assume, weight, join, and sub (Palmkvist et al., 29 Jun 2026). The applicative fragment G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)15 expresses Bayesian networks with fixed topology, whereas join and sub extend expressiveness to universal probabilistic programming with dynamic topology (Palmkvist et al., 29 Jun 2026).

During an MCMC proposal, the system selects a subset G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)16 of random-variable nodes for redraw, sets a new proposal id, and runs node update functions in topological order (Palmkvist et al., 29 Jun 2026). Deterministic nodes recompute only if a parent changed. Weight nodes recompute their local contribution to the log joint. An assume node has three cases: direct redraw if selected, prior reweighting if its distribution parent changed but the stored sample remains in support, or redraw under support invalidation (Palmkvist et al., 29 Jun 2026). For subgraph nodes, changed inputs may trigger subgraph reconstruction. Acceptance uses

G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)17

with transactional rollback by replaying a reset stack on rejection (Palmkvist et al., 29 Jun 2026).

The log joint is treated as a local factorization

G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)18

and only changed factors contribute

G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)19

This is the formal basis for localized recomputation (Palmkvist et al., 29 Jun 2026).

The paper explicitly connects the construction to functional reactive programming. Random-variable nodes act both as sources of samples and as sinks for their input distributions; change propagation follows edge-local data dependencies; and topological update order realizes a reactive dataflow machine (Palmkvist et al., 29 Jun 2026). The stated advantages are localized recomputation, a clean separation of deterministic and probabilistic computation, and support for universal PPLs via subgraphs, while stated limitations include node overhead, theoretically unsatisfying aspects of the automatic translation, and the absence of quantitative performance benchmarks in the present report (Palmkvist et al., 29 Jun 2026).

One extension uses the phrase PPG for typed graph-generating program interfaces rather than control-flow or dependency graphs (Ackerman et al., 2023). The language has a type of vertices and two operations,

G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)20

and programs such as

G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)21

denote distributions over finite adjacency matrices (Ackerman et al., 2023). In this setting, PPGs are equationally specified program interfaces interpreted in distributive Markov categories. The central theorem states that every Bernoulli-based equational theory with deterministic symmetric edge yields an exchangeable, consistent, and local random graph model and therefore a unique graphon up to cut-distance equivalence, and conversely every graphon arises from such a theory (Ackerman et al., 2023). This use of “PPG” is semantically orthogonal to the control-flow and inference-oriented usages.

Another extension is the Probabilistic Program Dependence Graph (PPDG), a PDG augmented with learned statistical dependences between node states (Askarunisa et al., 2012). A PPDG has structure G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)22, discrete node-state variables G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)23, and CPTs G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)24 learned from instrumented traces (Askarunisa et al., 2012). Count-based estimates are

G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)25

Fault localization is then performed by RankCP, which assigns suspiciousness by the minimum conditional probability seen for each node along a failing trace (Askarunisa et al., 2012). The reported comparison includes the example that, for the Hill Cipher program, SBI identified G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)26 faults while PPDG identified G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)27 faults (Askarunisa et al., 2012). This is a diagnostic rather than semantic use of a probabilistic program graph.

A third neighboring line models recursive probabilistic programs by probabilistic regular graphs generated from deterministic graph grammars with probabilistic terminal labels (Bertrand et al., 2010). These graphs induce infinite-state Markov chains, support qualitative PCTL model checking, and admit approximate quantitative verification via finite polynomial fixed-point systems over summary variables G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)28 and G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)29 (Bertrand et al., 2010). Exact quantitative PCTL model checking is undecidable, while qualitative thresholds G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)30 and G=(P,E,nil,Γ)G=(P,E,\mathrm{nil},\Gamma)31 remain decidable (Bertrand et al., 2010). This is not presented under the PPG label in the paper itself, but the supplied account explicitly relates probabilistic regular graphs to PPGs for recursive probabilistic programs.

Taken together, these variants establish that PPGs are not a single formal object but a family of graph-centric semantic, inferential, and analytic representations. The persistent technical themes are explicit factorization, control/dependence exposure, and the use of graph structure to obtain compositional semantics, correctness theorems, or local computation. This suggests that future unification, if pursued, would have to distinguish at least four axes already present in the literature: static versus dynamic graphs, whole-program versus per-trace representations, operational versus denotational roles, and exact versus conservative dependency structure.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Probabilistic Program Graphs (PPGs).