Why a compiled model has to be operated on

The structure note turns a BN into an energy landscape. That landscape is a picture of how things are, and people bring three kinds of question to such a picture:

  1. What should I believe, now that I have seen something? Symptoms observed, disease inferred.
  2. What happens if I act? A treatment given, an outcome predicted.
  3. What would have happened if I had acted differently? The patient recovered — was it the drug?

Only the first can be read off the picture. The other two cannot, and the reason is the same in both cases: the picture already contains the mechanism that decides the variable we want to set. Reading the picture tells us what that mechanism does. It cannot tell us what happens when we overrule it, because in the picture we never do.

So questions 2 and 3 are queries on different landscapes, and to answer them we have to change the model and compile again. This note says which changes, and what each one does.


Three tasks, and the actions each one takes

Each task is given as what it achieves, then as a list of actions on the BN.

A — Conditioning

Note

Task. Revise what we believe about the rest of the model, given information about it.

Usage examples. Diagnosis, prediction from an observation, filtering.

Pearl [14] calls this seeing, but the task is wider than looking: the information can be an observation, a measurement, a report, or an assumption entertained for the sake of argument. What makes it conditioning is not where the information came from but that nothing in the model changes — we learn about the world, we do not alter how it works.

Actions. Fix and values with .

  1. Restrict the state space to the configurations that agree with .
  2. Reduce every mechanism to that context: each factor keeps its table but loses the coordinates in .
  3. Renormalise by the mass of the restricted set.

No mechanism is replaced and no edge is removed.

Step 3 is the hard one, and we want it both ways

Restricting and reducing are local and cheap. Renormalising is neither: the mass of the restricted set is the very quantity the query is about, so step 3 is the inference rather than a tidying step after it.

That puts two things we want in direct conflict. Working with an energy model, the normalisation constant is the thing one arranges never to need — it is a sum over the whole state space, and the usual craft is to phrase every question so that it cancels. But the task itself is stated in normalised terms: “revise what we believe” means a distribution that sums to one, and a model that does not is not yet an answer.

So either conditioning renormalises, and the operation costs as much as the query it was meant to serve; or it stops after reducing, returns a legal unnormalised model, and leaves the constant to whatever answers the query. Not chosen here.

B — Doing

Task

Predict what follows from setting a variable ourselves, overruling whatever normally decides it.

Usage examples. Treatment effect, policy choice, control.

Called so because it changes how the world works, not what we know about it.

Actions. Two, and keeping them apart matters.

  1. Sever. Remove the chosen node’s mechanism entirely. The node stays in the model, but nothing says how is produced.
  2. Pin. Put a distribution back in its place. Either a hard pin — a point mass, forcing one value — or a soft pin, any other kernel.

Severing alone is already a complete operation, and it is where the causal content sits. Pinning alone is not an operation: without severing, the old mechanism is still there and still competing.

Hard and soft differ only in which distribution is pinned back. A soft pin is not a weaker version of a hard one — it answers a different question, namely what follows from changing a tendency rather than forcing a value.

C — Imagining

Task.

Say what would have happened to this case, the one we actually observed.

Usage examples. Blame, credit, regret.

Called imagining because the world it asks about never occurred.

Actions.

  1. Abduct. Work out, from what was observed, the state of everything the model leaves unmodelled.
  2. Act. Replace the mechanism, holding that state fixed.
  3. Predict. Read the answer in the changed model.

The three on one graph

One graph and one context for all three. is how ill the patient is before treatment, whether they are given the drug, whether they recover. The illness drives both who gets treated and who recovers, and the drug acts on recovery:

graph LR 
	I((I)) --> D((D))
	I((I)) --> R((R))
	D((D)) --> R((R))

Conditioning on asks: among the patients who were given the drug, how many recovered? Inside that group still varies as it always did, and also drives — so if the sicker patients were the ones treated, part of what reads as the drug’s effect is really their illness coming through. The effect we wanted and the bias we did not are added together, with nothing marking which is which.

Doing asks a different question: if we gave the drug to everyone, whatever their illness, how many would recover? The mechanism that used to decide who gets treated is discarded, so can no longer reach through :

graph LR 
	I((I)) --> R((R))
	D((D)) --> R((R))

Whatever association is left is the drug acting on recovery.

Imagining asks about neither group. This patient was treated and recovered — would they have recovered untreated? The graph is the same one, but the question is about a single case rather than a population: their illness is whatever it actually was, and so is everything else about them the graph does not draw. That last part is what separates it from the other two. Two patients equally ill and equally treated can still differ in outcome, so the graph and its tables do not say which of them we are looking at — and the counterfactual asks about this one.

Three levels, three words

The same operation can be described on the graph, on the model, or on the coefficients, and mixing the three is the main source of confusion. Fixed vocabulary:

levelwhat is touchedthe action is called
the graph edges and nodessurgery
the model — its mechanismsone or more kernelsreplacement (severing removes one, pinning puts one back)
the coefficients columns, and the totals they sum towrite

These are not three choices. They are one operation seen at three resolutions, and the causal content lives at the middle level:

  • Surgery is a consequence, not a step. Replacing a mechanism by one that ignores its parents makes those edges inactive, so the graph loses them without anyone cutting them.
  • A write is an implementation. It is how a replacement reaches the compiled model, and it carries no meaning of its own — the same write means different things depending on whether the old column was removed first.

So every mode below is specified as a replacement, and its surgery and its write are read off afterwards. That the three descriptions agree is proved, not assumed.


The modes

Only modes are this note’s subject; recreations belong to the realisation note. Each mode gives its actions, its impact on , and its impact on the coefficients, and then checks that the operation does the task it was introduced for.

Mode 0 — no operation

Query: none. Target: . Actions: none.

Prop. 1 says the compiled energy’s Boltzmann distribution is the chain-rule joint, with . Mode 0 is listed because it is the substrate every other mode edits, and the reference the certificates are read against.

Mode 1 — conditioning (task A)

Query: , . Target: the conditional of . Actions: restrict, reduce, renormalise.

The first two actions produce one object, the compiled energy evaluated on the evidence: , real-valued on . Write for the network on whose kernels are those of at , and for its chain-rule joint — is fixed throughout and kept out of both names.

Write for the parents of left free. Substitution leaves every factor with the coordinates it had outside :

and the difference between the two is crucial.

Thm. 3 - Evidence reduction

Theorem 3 — evidence reduction [standard] [6] [ours] (2–3)

Let have joint and let carry with .

  1. Restricting to and reducing the mechanisms, is a Bayesian network and

    the second factor — the evidence factor — being no kernel;

  2. Pricing the renormalisation,

  3. Answering the query,

Proof. 1. By Prop. 1, . Evaluating at and splitting the product at gives the display, leaving the first factor to identify.

By Lemma 2, is a DAG with , topologically indexed. For and any , the pair is a parent configuration of in , so Def. 3 gives

meets Def. 3 and the first factor is its chain-rule joint. For the child is fixed at instead, and no equation at survives.

2. The left sum is by Prop. 2. By 1 and Theorem 1, , so the same sum of clause 1 is .

3. By 1, 2 and , the quotient is . Summing it over and applying Prop. 2 to gives the marginal.

Remark. need not be parent-minimal: a reduced kernel may stop varying in a parent that still draws, minimality being a statement about all parent configurations while only those agreeing with survive. Nothing below reads structure back off it.

Example — the observed collider. Take with all three binary, , and given by

a smoothed OR, strictly positive as the standing assumption requires. Observe at , so , is the pair of priors and . Clause 2 gives

and clause 3 the conditional . All of the evidence’s effect sits in : is what the model said about and before was looked at.