Source : Probabilistic Graphical Models: Principles and Techniques

Energy-based model

Def. 1

For a set of variables , ranging over a configuration space , we define the energy of a system by a function , and the associated Boltzmann/Gibbs distribution at inverse temperature

up to a normalization constant

could denote a discrete or continuous set, but throughout the series will denote a finite and discrete domain. We obtain

Remarks

  • When algorithms of sampling (MCMC etc..) are used to generate such a distribution, the ground states — the states of lowest energy — are sampled more often than the others, given the shape of the distribution. Raising sharpens that preference; lowering it flattens the distribution toward uniform.
  • Every result proven (so far) in this series is a statement at . Therefore, it doesn’t appear in any result below. It is used in exactly two places, both about hardware considerations: the job emission (Def. 7), and the driver’s register — the temperature after normalisation of the problem.

Def. 1bis — Multilinear expansion, QUBO and HUBO

Let be a real function of binary variables , . For , write for the configuration with if and otherwise; in particular is the all-zero state.

Then admits a unique multilinear expansion — a linear combination of monomials indexed by the subsets

(the monomials are linearly independent and thus a basis of the functions on ).

Grouping the terms by order and writing the coefficients in the hardware sign convention gives, for maximal order , the HUBO formulation (Higher-order Unconstrained Binary Optimization)

Its truncation at order is the QUBO formulation (Quadratic Unconstrained Binary Optimization)

with biases on the diagonal and couplings off it.

The two conventions are linked by , and in general ; the constant offsets the energy without changing the distribution.


Bayesian Networks

Notations

Within a graph structure, denotes the random variable at node ; a realised value of it.

A network depicts a set of these random variables that are connected with each other to give a graph structure.

Throughout, abbreviates : capital is the parent variable set, lowercase is a realised configuration of it. While is a conditional distribution.

For a variable , denotes the index set of the node together with its parents i.e the family index set.

Denote the domain of , its size, , and the configuration space.

Def. 2 — Factorization of a distribution

Let be random variables, and be a DAG over these variables. We say that a distribution factorizes according to over if it can be expressed as the product

This equation is called the chain rule for Bayesian networks. The individual factors are called conditional probability distributions (CPDs), local probabilistic models, or — in their tabulated form — conditional probability tables (CPTs).

It means the distribution of the whole system is fully determined by the conditional of each node given its parents.

Def. 3 — Bayesian Network

A Bayesian network is a pair where is a DAG and factorizes over , where is specified as a set of CPTs associated with ’s nodes subject to two construction requirements:

  1. Acyclicity has no directed cycle.
  2. Local normalisation — for every and every parent configuration ,

    The joint obtained from the CPTs by the chain rule (Def. 2) is annotated .

Def. 4 — Moral graph

Let be a DAG. The moral graph of is the undirected graph obtained by:

  • keeping every edge of and dropping its direction;
  • adding an edge between any two parents of a common child (“marrying the parents”).

Every family of is by construction a clique of .

Def. 5 — DIRAC mode

Let be a Bayesian Network. A DIRAC mode is a rule mapping a causal query on to a job, specified by

  1. the target distribution it is meant to sample;
  2. a transform of — a penalty added on top of it, or a factor swapped inside it — yielding the compiled energy;
  3. its realisation on the backend.

A mode is classified on two independent axes:

  • Target provenance — the target is theory-fixed if it is written down from causal theory before any compilation, or realisation-defined if it is defined as recreating a theory-fixed target by a stated procedure.
  • Realisation exactness — the transform reproduces its target exactly at finite parameters, in the limit only (exact as a parameter tends to a limit, with a quantified error at every finite value), or openly (the agreement is measured, not proved).

A reference mode is one that is realisation-defined and exact: that is the only combination that can serve as the ground truth another mode is judged against. Every other combination is tested — its correctness at the parameters actually used is an experimental result, never an assumption.


Markov Random Fields

Def. 6 — MRFs

Let be an undirected graph. Each node carries a random variable . The edges encode direct probabilistic dependence. Critically, absence of an edge means something precise: those two variables are conditionally independent given everything else.

Properties

This is the defining idea, and it comes in three equivalent strengths:

  • Local Markov property: a variable is independent of all other variables given its immediate neighbors. That neighbor set is called its Markov blanket — once you condition on it, nothing else in the graph tells you anything more.
  • Pairwise Markov property: any two non-adjacent variables are conditionally independent given all the rest.
  • Global Markov property: if a set of nodes separates the graph into two pieces and (every path from to passes through ), then and are conditionally independent given .

Hammersley-Clifford theorem

For any strictly positive distribution satisfying the Markov property on , the joint distribution must factorize over the graph’s cliques (fully-connected subsets of nodes)

Here is a nonnegative potential function defined on clique , and is the partition function — a normalizing constant summing over every possible configuration

Because , it’s conventional to rewrite each potential as , giving the Gibbs/Boltzmann form

This is exactly the energy-based form used in the Ising model — an Ising model is a pairwise MRF, where cliques are just edges (pairwise potentials) and single nodes (local fields).

Conversely, any distribution of this Gibbs form — a product of clique potentials on — satisfies the Markov properties with respect to ; for strictly positive distributions the two characterisations are equivalent.

Strict positivity is where the zero entries bite

Hammersley–Clifford assumes . A CPT with a zero entry makes somewhere and puts the compiled model outside the theorem’s hypothesis. That is not a defect of the compilation — the factorisation still holds — but it is why zero entries need their own treatment, and why the treatment cannot be dismissed as a numerical detail.

Def. 7 — Job

A job submitted for sampling is the pair :

  • the coefficient set of the energy’s multilinear expansion (Def. 1bis) — diagonal , pairwise links , higher orders (if supported)
  • the inverse-temperature schedule at which it is sampled.

Implementing or updating any query means writing exactly these two objects.


Clamping

Let index all variables in the model, and be a full system assignment. That is, contains one value for every variable in the model.

Let be the set of clamped variable indices, and be the target assignment for the clamped variables only. In general, is a partial assignment, not a full state vector. For example, if:

x = (x1, x2, x3, x4, x5)
S = {2, 5}
a = {a2 = 1, a5 = 0}

then only and are being clamped. We denote by the clamped block — the one we try to set to — and for the free variables.

The clamp penalty counts mismatches so if every clamped variable matches its target, and if one or more disagree. It depends on through the entries for .

The clamped energy at clamp strength is

This yields a different distribution given . The clamped model is a joint over the full state space

The object of interest is the free-variable marginal, obtained by summing over the clamped block

Spin form

If the backend uses spin variables with targets , the same
penalty is

The equivalent local-field implementation is

rewarding alignment between the current spin and the desired one, up to a constant offset.

Under the binary-to-spin mapping , the baseline fields and couplings shift: it accumulates linear contributions, so the spin-form baseline is


Clamping variable on spin hardware therefore adds the clamping force to the shifted baseline:

is not a validation metric

is an energy penalty used to construct the clamped model, not the metric used to validate the conditional distribution. Validation compares the resulting distribution against the exact target using the metrics below.


Validation metrics

Distribution-level, and all defined against a target computed exactly. and below are distributions over the same configuration space .

Total variation distance. The worst-case error over events:

It is symmetric, lies in , and is the default metric of the series. The second equality is what makes it the right default: it bounds the error of every query at once.

Kullback–Leibler divergence. Mass-weighted, asymmetric:

with the convention if charges a state where vanishes. That divergence is informative rather than a nuisance: it is exactly the signature of a target that forbids a state the realisation permits.

Query-level error. For a query set , the largest cell error of the marginal:

where . This is the error a user of the answer sees, and it is not monotone in the parameters even when the joint-level error is — the joint and the marginal can cross coincidentally.

Impossible-state mass. Given a realised distribution and a reference network with joint , the mass places on states forbids outright:

It measures pollution from a zero-entry treatment specifically: a smoothed or capped model puts
mass where the exact model puts none, and this is how much.


Intervention vs Observation

Conceptual understanding of the difference

Take the confounding structure :

graph LR 
	C((C)) --> X((X))
	C((C)) --> Y((Y))
	X((X)) --> Y((Y))

Observing X = x: You are looking at the subpopulation where X happens to equal x. But C still varies as it normally would among that subpopulation, and since C also drives Y, some of the association between X and Y is really C leaking through — confounding.

Intervening do(X = x):

graph LR 
	C((C)) --> Y((Y))
	X((X)) --> Y((Y))

The C → X arrow is erased. X no longer depends on C at all — it is set directly. So C can no longer create a spurious channel to Y through X. Any leftover association between X and Y in the post-surgery graph is now genuinely caused by X.

This is the entire reason the field exists: mixes real causal effect with confounding bias, while isolates the causal effect by construction, because the graph surgery removes the confounding pathway.

Example :

  • Observational: “Among people who happen to smoke, what fraction get sick?” →
  • Interventional: “If I forced everyone to smoke, what fraction would get sick?” →

Impact on the distribution

the operator acts on a graph, performing graph mutilation. A hard intervention:

  • deletes every arrow pointing into X — X’s own structural equation is discarded entirely;
  • sets X = x as a constant, unconditionally;
  • leaves every other distribution in the system untouched.

After , node j’s factor is deleted and the truncated joint is

You can't use 'macro parameter character #' in math mode\mathbb{P}(X_{1}, \cdots, X_{n} | do(X_{j}=x)) = \Pi_{i\neq j} \mathbb{P}(X_{i} | Pa^{\mathcal{G}}_{X_{i}}) $$ with $X_{j}$ set to x wherever it appears as a parent elsewhere. --- ## Intervention ### Def. 8 Let $B=(\mathcal{G},\mathbb{P})$ be a Bayesian Network over $X_1,\ldots,X_n$, with $\mathbb{P}$ specified by the CPTs ${\mathbb{P}(x_i\mid pa_i)}_{i=1}^n$, and $V=\{1,\ldots,n\}$. An **intervention** is a pair $$ \sigma=\big(J,\ {(\tilde{\mathbb{P}}_j})_{j\in J}\big), $$ where $J\subseteq V$ is the set of intervened nodes and, for each $j\in J$, the **replacement kernel** $\tilde{\mathbb{P}}_j$ is a conditional distribution $\tilde{\mathbb{P}}_j(x_j\mid pa_j)$ on $D_j=\mathrm{Domain}(X_j)$ satisfying local normalisation: $$ \sum_{x\in D_j}\tilde{\mathbb{P}}_j(x_{j}\mid pa_{j}) = 1 $$ $\sigma$ acts on the **model**, not on a distribution: it returns the Bayesian Network $$ \sigma(B):=B_\sigma=(\mathcal{G},\mathbb{P}_\sigma), \qquad \mathbb{P}_\sigma(x_i\mid pa_i):= \begin{cases} \tilde{\mathbb{P}}_i(x_i\mid pa_i), & i\in J,\\[2pt] \mathbb{P}(x_i\mid pa_i), & i\notin J. \end{cases} $$ The graph is unchanged and every CPT of $B_\sigma$ is locally normalised, so $B_\sigma$ is a well-defined Bayesian Network. Its chain-rule joint is the **post-intervention joint** $$ P_\sigma(x):=\mathbb{P}_\sigma(X=x)=\prod_{j\in J}\tilde{\mathbb{P}}_j(x_j\mid pa_j)\prod_{i\notin J}\mathbb{P}(x_i\mid pa_i). $$ **Special cases:** - _Identity:_ $\sigma=(\varnothing,\cdot)$ gives $B_\sigma=B$ and $P_\sigma=P_G$. - _Hard intervention:_ $\sigma=\big(\{j\},\ \tilde{\mathbb{P}}_j(x_j)=\mathbf{1}[x_j=x^\ast]\big)$ — exactly what $do(X_j=x^\ast)$ denotes. All incoming edges of $X_j$ become inactive and the mechanism is replaced with a parent-free point mass $\mathbb{P}(X_j=x^\ast)=1$. - *Soft intervention*: every other case — mechanism is replaced rather than pinned. - _$\epsilon$-smoothing:_ $\sigma_\epsilon=\big(V,\ (1-\epsilon)\mathbb{P}+\epsilon U_{D}\big)$, replacing every mechanism by its $\epsilon$-mixture with the uniform distribution $U_{D}$ on the corresponding domain. --- ## Notational conventions - Blackboard $\mathbb{P}$ is a probability measure or a conditional kernel of the model. Italic $P$ with a subscript names a *derived global* object on configuration space: $P_G$ the chain-rule joint, $P_\lambda$ the clamped joint, $P_\sigma$ the post-intervention joint. An italic $P$ never carries a conditional bar without a subscript. - A subscript names the operation that produced a derived _global_ object: $(P_\sigma, E_\sigma, Z_\sigma)$ for intervention on the model by $\sigma$, $(P_\lambda, E_\lambda, Z_\lambda)$ for clamping at strength $\lambda$ and $(P_\epsilon, E_\epsilon, Z_\epsilon)$ for smoothing at level $\epsilon$ (the special case $\sigma_\epsilon$; formally $P_\epsilon:=P_{\sigma_\epsilon}$).