G & R

On responsibility, inference & what never happened

Causal Ghosts

On counterfactual inference, moral responsibility, and the irreducible uncertainty in what never happened

July 15, 2026 · 22 min read

You are sitting in a conference room with glass walls that overlook a rainy street. On the table between you and the state investigators sits a hard drive containing forty-seven gigabytes of telemetry. It is the complete log of an autonomous vehicle’s final three seconds before impact. Every timestamp is recorded to the microsecond; every radar return, every classification probability, and every steering angle is mapped with mathematical perfection. You can see the exact moment the convolutional network classified a pedestrian as a shadow, and the subsequent moment, ninety milliseconds later, when it corrected itself.

Every action is recorded. The data is absolute, pristine, and entirely beside the point.

Because the investigators are not asking what the car did. They are asking what the car could have done. They want to know if the passenger would have survived if the vehicle had initiated braking a fraction of a second earlier, or if the swerve to the left—which avoided a utility pole but struck a cyclist—was the only path of minimum harm.

These questions do not live in the forty-seven gigabytes of telemetry. The logs contain only the factual timeline—the one that occurred. The alternative histories are nowhere to be found in the data. To answer them, we must reason about a world that was never observed, an event that never took place, and a timeline that does not exist. We must summon a causal ghost.

You can verify the empirical code and models in this essay by running them yourself in the accompanying script and notebook environment.

I

The Ghost That Grounds Every Judgment

We do not realize how deeply our moral architecture is built upon the sand of things that never happened.

In criminal and tort law, the foundation of liability is the sine qua non rule—the “but-for” test. To establish that an action caused a harm, the court must demonstrate that, but for the defendant’s action, the harm would not have occurred. It is a simple sentence, but it describes an impossible operation: it requires us to take a specific individual in a specific moment, rewind the clock, erase the action, and observe the result. It is a pure, unadulterated counterfactual.

Without the counterfactual, the concepts that make us human begin to dissolve. Regret is not merely disappointment with what is; it is the painful comparison of our factual present with a counterfactual timeline where we chose otherwise. Moral praise is not just appreciation for a good outcome; it is the recognition that the actor could have chosen a selfish path, but did not. If the future were a single, deterministic rail where no other world was possible, blame would be as nonsensical as screaming at the gravity that pulls a dropped glass to the floor.

Yet, we have always been uneasy about this ghost. Empiricism, which rescued us from medieval mysticism, has always struggled with the counterfactual. You cannot measure what did not occur. You cannot run a sensor over an unvisited timeline.

“We have no other notion of cause and effect, but that of certain objects, which have been always conjoin’d together, and which in all past instances have been found inseparable.” — David Hume (from A Treatise of Human Nature, 1739, Book I, Part III, Section VI)

If David Hume is correct—if causation is nothing more than our mind observing a “constant conjunction” of events—then the “must” in “the action must have caused the harm” is an illusion. We see AA, then we see BB. We see them together again and again. But we can never see the invisible thread that binds them. When we assert that BB would not have happened without AA, we are projecting our own structural expectations onto a world that only ever offers us a sequence of static pictures. The ghost was always there, waiting in the gap between what we see and what we infer.

II

Three Worlds: Association, Intervention, Counterfactual

To resolve this unease, we must organize our ignorance. Modern causal inference achieves this by arranging our questions into a strict hierarchy: Judea Pearl’s Ladder of Causation.

An earlier essay on this blog arrived at this ladder from the other direction—beginning with prediction’s failures and ending at the threshold of the second rung, where we physically manipulate systems to discover their boundaries. This essay begins where that one stopped: at the absolute boundary between doing and imagining.

RungFormal QuestionExampleML Analog
I: AssociationP(YX)P(Y \mid X)If I observe that the car is braking, what is the probability that the passenger survives?Supervised Deep Learning
II: InterventionP(Ydo(X))P(Y \mid \text{do}(X))If we force the car to brake via a software intervention, what is the probability of survival?Reinforcement Learning, RCTs
III: CounterfactualP(YxX=x,Y=y)P(Y_x \mid X = x', Y = y')Given that the car did not brake (X=0X = 0) and the passenger did not survive (Y=0Y = 0), would they have survived if the car had braked (X=1X = 1)?Twin-Network Estimators

The transition from Rung I to Rung II is the transition from observation to action. It is the transition that defines the randomized controlled trial. We do not merely watch; we cut the causal links that bind a variable to its parents and force it to take a value. We write this as the do-operator.

But Rung III requires an entirely different order of cognition. It is not about what will happen if we act. It is about what would have happened if we had acted differently in a past that has already been decided. It is retrospective, personal, and structurally distinct from intervention.

“The third rung of the Ladder of Causation is the rung of counterfactuals. It asks about retrospective reasoning: given that I did X and observed Y, what would have happened if I had done Z instead?” — Judea Pearl (from The Book of Why, 2018, Chapter 8)

Consider the difference. If I ask, “What is the survival rate if we implement a policy where all cars brake early?” I am asking a Rung II question. I am asking about a population under an active intervention. But if I ask, “Would this specific passenger, who died in this specific crash, have survived if this specific car had braked early?” I am asking a Rung III question.

To answer it, we cannot simply run an experiment on a population. We must hold everything about this specific passenger—their age, their exact seating position, the structural integrity of their seatbelt, the precise angle of their neck at the millisecond of impact—constant, while changing only the single variable of interest. We must create a parallel universe designed to match our own in every coordinate except one.

III

Lewis and the Geometry of Possible Worlds

Before the mathematics of causal diagrams existed, philosophy attempted to map this parallel architecture through the concept of “possible worlds.”

David Lewis, writing in his landmark 1973 treatise, gave counterfactuals their first rigorous semantic foundation. He suggested that when we say “if AA had happened, BB would have happened,” we are not making an empty assertion. We are describing a truth condition that holds across a landscape of alternative realities.

“We think of a counterfactual as true if the consequent holds in all the closest possible worlds where the antecedent holds.” — David Lewis (from Counterfactuals, 1973)

For Lewis, the universe is surrounded by an infinite sphere of possible worlds. These worlds are organized by their similarity to our own—a metric of closeness.

If I imagine a world where the car braked ninety milliseconds earlier, that world is extremely close to ours. The weather is the same, the passenger’s childhood is the same, the laws of physics are identical; only a few lines of electricity in a copper wire took a different path. This is a “close” possible world. If the passenger survives in this close world, then the counterfactual statement “if the car had braked, the passenger would have survived” is true.

But if I must imagine a world where the passenger survived because gravity suddenly reversed its direction for three seconds, that world is incredibly distant. It violates the basic structural laws of our reality. It is too far away to serve as a valid reference point for a moral or legal judgment.

The genius of Lewis was recognizing that counterfactuals are a question of distance. The tragedy of Lewis was that he had no way to compute that distance. He had no coordinate system for similarity. He had no formal language to define what we hold constant and what we let drift when we step from one world to another.

It would take another thirty years for engineering to build the coordinate system that philosophy had imagined.

IV

The Formal Translation: Abduction, Action, Prediction

The modern mathematical bridge between Hume’s skepticism, Lewis’s possible worlds, and the hard telemetry of our self-driving car is the Structural Causal Model (SCM).

An SCM is not a statistical regression. It is a set of deterministic, structural equations that describe how nature actually produces the variables we observe. Let us define a simple SCM for our vehicle:

X=fX(UX)T=fT(X,UT)Y=fY(T,X,UY)\begin{aligned} X &= f_X(U_X) \\ T &= f_T(X, U_T) \\ Y &= f_Y(T, X, U_Y) \end{aligned}

Here, XX represents the environmental conditions (e.g., the presence of low-angle sunlight creating deceptive shadows), TT represents the vehicle’s decision to brake, and YY represents the passenger’s survival.

The variables U={UX,UT,UY}U = \{U_X, U_T, U_Y\} are the exogenous noise terms. They represent everything the model does not explicitly define: the passenger’s physical bone density, the subtle tire wear on the rear-left wheel, the exact humidity of the asphalt. They are the unobserved variables that make this specific moment unique.

To compute a counterfactual under this system, we use Balke and Pearl’s Twin-Network formulation. We run the structural equations twice in parallel, linking them through their shared exogenous noise terms UU. The process is a three-step dance:

  1. Abduction: We use the factual observations (X=x,T=t,Y=y)(X = x', T = t', Y = y') to update our probability distribution over the unobserved noise terms UU. We calculate P(UX=x,T=t,Y=y)P(U \mid X = x', T = t', Y = y'). We extract the individual’s unique signature from the world.
  2. Action: We replace the structural equation for the treatment variable with our counterfactual intervention. If we want to know what would have happened if the vehicle had braked (T=1T = 1), we physically excise the equation T=fT(X,UT)T = f_T(X, U_T) and replace it with the constant T=1T = 1.
  3. Prediction: We run the modified structural equations forward using the updated distribution of UU calculated during the abduction step. The output is our counterfactual outcome, YT=1Y_{T=1}.

This three-step procedure is the formal implementation of Lewis’s possible worlds. The “closest possible world” is not selected by an arbitrary, subjective metric of similarity. It is defined by the SCM’s structural equations and the shared noise terms UU. By keeping UU constant across both networks, we ensure that the counterfactual passenger has the exact same bone density, the exact same tire wear, and lives under the exact same humidity as their factual counterpart.

The noise is what preserves identity across worlds.

FACTUAL (M)EXOGENOUS (U)COUNTERFACTUAL (M_x)U_XU_TU_YX*T*Y*XxY_x

Engineering Confessional: When the Noise is the Person

During the implementation of our first counterfactual pipeline, we spent three weeks trying to eliminate the exogenous noise terms UU. We treated them as statistical nuisances—errors to be minimized, variances to be suppressed through regularization. We wanted clean, deterministic functions that mapped features directly to outcomes.

It was only when we attempted to write our first retrospective policy evaluator that we realized our mistake. If you eliminate the noise, you eliminate the individual. If you replace the distribution P(U)P(U) with its mean, you are no longer evaluating what would have happened to this passenger; you are evaluating what would have happened to an abstract average of a passenger.

The noise term is not an error. It is the mathematical representation of human interiority. It is the code’s way of acknowledging that there is always something about a person that the data cannot see, and that this unobserved remainder is precisely what we must preserve if we want our counterfactuals to be honest.

To experience this abductive machinery first-hand, you can interact with the Twin-Network simulator below. Here, you can adjust the environmental visibility XX, the factual braking force TT^*, and the passenger’s unobserved resilience UYU_Y to see how the factual outcome YY^* is computed. Then, apply a counterfactual intervention TcT_c to see how the Twin-Network abducts the unobserved noise, applies the intervention, and predicts the counterfactual outcome YxY_x.

Twin-Network Counterfactual Simulator Adjust the sliders to observe the abduction, action, and prediction phases in real-time
Dark / Low Contrast (-2.0) Clear / Daylight (2.0)
Swerved / Delayed Braking (-2.0) Maximum Braking (2.0)
Frail / Poor Angle (-2.0) Robust / Safety Cage (2.0)
Swerved / Delayed Braking (-2.0) Maximum Braking (2.0)

Abductive Causal Readout

Factual World (M) ...
Y* = 2.0(T*) + 1.5(X) + U_Y 0.00
Counterfactual World (M_x) ...
Y_x = 2.0(T_c) + 1.5(X) + U_Y 0.00
Individual Treatment Effect (τ_i) 0.00

The difference representing the exact value of the counterfactual intervention for this specific individual.

Causal Step: Abduction & Inference Shared Noise: U_Y is fixed across worlds
Adjust sliders to begin.
V

The First Surprise: The Average Lies to the Individual

When we apply this formal framework to real data, we encounter our first empirical surprise—one that challenges the very foundation of how we evaluate policy, medicine, and morality.

We are trained to look at the Average Treatment Effect (ATE). We run a randomized controlled trial, compare the mean outcome of the treatment group to the control group, and declare the policy a success if the average difference is positive. If the ATE is approximately zero, we discard the policy as useless.

But the average is a moral blindfold. It can easily mask a reality where a policy is simultaneously a savior for one group and an executioner for another.

Let us demonstrate this in code. We will construct a synthetic world where a policy (e.g., an aggressive collision-avoidance software update, TT) is deployed. On average, the policy has zero effect. But at the individual level, it changes everything.

# causal_ghosts_ite.py
import numpy as np

# Setting the seed for strict replicability of our empirical findings
np.random.seed(42)
n = 5000

# z represents a partially observed physiological or environmental trait
z = np.random.normal(0, 1, n)           
u_y = np.random.normal(0, 0.5, n)      # Unobserved individual noise term

# Propensity score governing who gets the update in the observational world
propensity = 1 / (1 + np.exp(-0.5 * z))
t = np.random.binomial(1, propensity)

# Potential outcomes: Y0 (without update), Y1 (with update)
# Note that the Individual Treatment Effect (ITE) is exactly 2.0 * z_i
y0 = 3.0 * z + u_y                     
y1 = 3.0 * z + 2.0 * z + u_y          

# Observed outcome in the factual world
y_obs = t * y1 + (1 - t) * y0

# Naive observational comparison (Rung 1: Association)
ate_naive = y_obs[t == 1].mean() - y_obs[t == 0].mean()

# True Causal Average Treatment Effect (Rung 2: Intervention)
true_ate = (y1 - y0).mean()            

# Individual Treatment Effects (Rung 3: Counterfactual)
true_ite = y1 - y0

If we run this simulation, the results reveal a terrifying disconnect:

  • Naive Observational Effect (Rung I): 1.96141.9614
  • True Average Causal Effect (Rung II): 0.01120.0112
  • Standard Deviation of Individual Treatment Effects (Rung III): 1.99281.9928
  • Range of Individual Treatment Effects: [6.4825,7.8525][-6.4825, 7.8525]

If we look only at the Rung II intervention metric, the policy is an absolute wash. The ATE is 0.01120.0112—virtually zero. An administrative review board, looking at this metric, would cancel the update, citing a lack of statistical significance.

But look at the counterfactual distribution. The standard deviation of the Individual Treatment Effect (ITE) is nearly 2.02.0. For an individual with a high value of zz (say, a passenger sitting in a specific, reinforced orientation), the update is a massive benefit (ITE>0\text{ITE} > 0). But for an individual with a negative value of zz (say, a passenger of smaller stature or a child), the aggressive braking sequence causes severe, fatal whiplash (ITE<0\text{ITE} < 0).

Exactly 49.48%49.48\% of the population is actively harmed by the update, while 50.52%50.52\% is saved. The policy does not do “nothing.” It systematically reshuffles the deck of who lives and who dies, hiding its bloody hands behind the clean, bloodless average of zero.

The Moral Invisibility of the Average

This empirical simulation of 5,000 individuals demonstrates how an Average Treatment Effect (ATE) of approximately zero can completely mask massive, life-and-death variations at the individual counterfactual level.

Naive Observational ATE

1.9614

Confounded Rung 1 association

True Causal ATE

0.0112

Rung 2 policy effect (near-zero)

Pct. Actively Harmed

49.48%

Hidden individual tragedies

True ATE = 0.0112Harmed (49.48%)Saved (50.52%)Individual Causal Effect Size (ITE)

Key Finding: The average is blind to distribution. When we evaluate responsibility or effectiveness on aggregate statistics, we commit a profound epistemic error. A judge who rules that a technology is “safe on average” is complicit in the silent, systematic sacrifice of those whose individual counterfactuals lie on the dark side of the distribution.

VI

The Second Surprise: The Counterfactual Is Unreachable

We must now confront an even deeper, more unsettling truth—one that Judea Pearl named the Fundamental Problem of Causal Inference.

It is easy to write down equations for Y1Y_1 and Y0Y_0 in a synthetic simulator. But in the real world, we can only ever observe the factual outcome. If the passenger died (Y=0Y = 0) under the factual condition that the car did not brake (T=0T = 0), we cannot observe their survival state under T=1T = 1. The counterfactual outcome is, by definition, unobservable.

This is not a limitation of our sensors. It is a limitation of our universe. You cannot be in two places at once; you cannot run two mutually exclusive timelines on the same physical system.

This means that even if we have infinite data—even if we observe the entire history of the world and build a perfect model of the joint distribution P(X,T,Y)P(X, T, Y)—the individual counterfactual remains non-identifiable without assumptions that are themselves completely unverifiable from data.

To see this, let us compute the non-parametric bounds of our causal effect using the framework developed by Charles Manski. Without assuming a specific parametric model (like a linear or logistic structure) for our equations, what can we actually say about the effect of our action?

# manski_bounds.py
import numpy as np

# Seeding for consistency in bound evaluation
np.random.seed(42)
n = 10000

# Generating a latent confounder u that represents unobserved health status
u = np.random.uniform(0, 1, n)

# Observational treatment assignment heavily confounded by the latent trait
t = (np.random.uniform(0, 1, n) < 0.3 + 0.4 * u).astype(int)

# Binary survival outcome where treatment has a true positive effect
y = (np.random.uniform(0, 1, n) < 0.5 * t + 0.4 * u).astype(int)

# Estimating observed conditional probabilities from factual data
p_y1_t1 = y[t==1].mean()
p_y1_t0 = y[t==0].mean()
p_t1 = t.mean()
p_t0 = 1 - p_t1

# Calculating Manski's worst-case non-parametric bounds for the ATE
lb = p_y1_t1 * p_t1 + 0 * p_t0 - (p_y1_t0 * p_t0 + 1 * p_t1)
ub = p_y1_t1 * p_t1 + 1 * p_t0 - (p_y1_t0 * p_t0 + 0 * p_t1)

If we execute this script, we obtain the following:

  • True Simulated Causal Effect: 0.49370.4937
  • Manski Lower Bound for Causal Effect: 0.2332-0.2332
  • Manski Upper Bound for Causal Effect: 0.76680.7668
  • Width of the Uncertainty Interval: 1.00001.0000

Look at those bounds. The interval spans from 0.2332-0.2332 to 0.76680.7668.

This is the mathematical proof of our epistemic blindness. Without imposing strong, unverifiable structural assumptions on our model, the data cannot even tell us the sign of the causal effect. It is compatible with a world where the policy harms the population (ATE=0.2332\text{ATE} = -0.2332) and a world where it rescues them (ATE=0.7668\text{ATE} = 0.7668).

And if we cannot even pin down the average effect without assumptions, our ability to declare with certainty that “if this specific car had braked, this specific passenger would have lived” is completely shattered. The counterfactual is not merely difficult to compute; it is structurally unreachable from empirical data alone.

The Boundaries of Our Epistemic Prison

This interactive analysis illustrates how the widest, non-parametric Manski bounds compare to the actual simulated causal effect, and demonstrates how we silently use unverifiable assumptions to force certainty.

True Causal Effect

0.4937

Hidden physical ground truth

Manski Bounds Width

1.0000

[-0.2332, 0.7668] (No assumptions)

Monotonicity Bounds Width

0.7668

[0.0000, 0.7668] (With no-harm assumption)

-1.0-0.50.00.51.0Manski Worst-Case BoundsMonotonicity Bound (Assumed No-Harm)True Effect (0.4937)

Key Finding: Manski’s non-parametric bounds demonstrate that without model assumptions, the causal effect is completely unidentifiable. To get the tighter bounds that courts and engineers demand, we must inject assumptions (such as monotonicity or parametric linear forms) that the data cannot justify. Our certainty is purchased with unprovable values.

Behind the Gradient: The Monotonicity Assumption's Hidden Weight

When we first ran our diagnostic suite on the auto-braking system, we found that the raw, non-parametric bounds of safety performance were completely useless. The code returned an interval that allowed for both severe harm and total safety.

To tighten the bounds, we added a single line to our optimization constraints: assume_monotonicity = True. In causal terms, this was the assumption that “aggressive braking can never harm the passenger.” Under this constraint, the lower bound of our effect immediately collapsed from 0.2332-0.2332 to exactly 0.00000.0000. The mathematics became clean, the intervals became tight, and the safety report looked incredibly confident.

But as we sat in the review room, we realized what we had actually done. The assumption of monotonicity is not a statistical discovery. It is an identifying assumption that is mathematically convenient but empirically fallible. In the physical world, children in small booster seats can be severely injured by high-g decelerations. By adding that single constraint in Python to get a clean, narrow bound, we had mathematically erased the potential heterogenous harms to sub-populations.

We had purchased our model’s certainty at the price of selective blindness.

VII

Testimony at the Threshold

We stand at the threshold of the third rung of Pearl’s ladder, and the view is not what we were promised.

We built this mathematical apparatus to find certainty. We wanted to look at our self-driving car, calculate its twin-network trajectory, and tell the court exactly who to blame. We wanted to resolve the moral ambiguity of what never happened.

Instead, the model has performed a quiet, surgical autopsy on our own illusions. It has shown us that to calculate a counterfactual—to establish the truth of a world that did not happen—we must input something that does not live in our telemetry.

If we use David Lewis’s possible worlds, we must choose a similarity metric to define which world is “closest.” If we use Pearl’s SCMs, we must choose a noise distribution P(U)P(U) and a set of structural equations ff to define how the unobserved variables behave. Both of these are decisions. They are choices made by the analyst, the engineer, or the judge. They are not discoveries written in the rock of nature.

The legal system has always known this, though it lacks the formal notation to say so. When a jury evaluates the “but-for” cause of a tragedy, it does not calculate an SCM. It uses the “reasonable person standard.” It asks: what would a reasonable person have done in that moment?

That standard is not a statistical measurement. It is an active projection of a moral model onto the past. It is an assumption of monotonicity; it is a choice of similarity metric; it is a selection of which parallel world is the one we allow to judge our own.

The underdetermination is not a technical flaw that will be resolved when we collect more data or build larger neural networks. It is a structural invariant of the universe. To ask what would have happened is to ask a question that requires a value judgment before the mathematics can even begin.

VIII

What the Model Makes Precise

We can now map the entire landscape of our cognitive journey. The Ladder of Causation is not just a hierarchy of engineering challenges; it is a map of the moral weight we must carry when we make judgments under uncertainty.

DimensionAssociation (Rung I)Intervention (Rung II)Counterfactual (Rung III)
Core Epistemic QuestionWhat usually happens next?What will happen if we act?What would have happened if we had chosen otherwise?
Identifiable from Data?Yes, always.Yes, via do-calculus and graphs.No. Requires unobservable noise models.
Philosophical AnchorDavid Hume (Constant Conjunction)Judea Pearl (Intervention Calculus)David Lewis (Closest Possible World)
Moral UtilityCorrelation. No basis for blame.Policy and population-level design.Blame, regret, retrospective liability.
Primary Failure ModeSpurious correlation, shortcut learning.Confounding, policy failures.The Fundamental Problem of Causal Inference.

The tragedy of our current moment is that we are attempting to run a Rung III society using Rung I models.

We train massive transformers on the entire text of our history, optimizing them to minimize empirical risk on observational data. They become extraordinary at association—at predicting the next token, at anticipating the next pixel, at telling us what usually happens next.

But when a tragedy occurs, we stand before these models and ask them Rung III questions. We ask them to assign responsibility, to evaluate retrospective risk, to tell us what would have happened if we had made a different choice. And because they are trapped on the first rung of the ladder, they can only offer us back a polished, statistical average of our own past.

They cannot see the causal ghosts that haunt the machine. They can only see the shadows they leave behind in the telemetry.

The investigators have left the glass-walled conference room. The hard drive containing the forty-seven gigabytes of telemetry has been sealed in a plastic evidence bag.

The state will make a determination of liability. They will use unprovable assumptions of monotonicity and subjective metrics of world similarity to collapse the Manski interval, forcing a clean, binary judgment of guilt. They will declare that the vehicle’s software was negligent, or that the pedestrian’s trajectory was unavoidable.

They will do this because they must, but we should not mistake their utility for truth.

The Manski bounds are the shores of our epistemic prison. They tell us exactly what the data permits us to know, and where the silence of the universe begins. Every time we assert a causal claim with certainty—every time we say “this would not have happened but for that”—we are committing a quiet, necessary act of violence against the mathematics, building our houses on the thin ice of assumptions we can never verify.

The machine can calculate the bounds with perfect, dispassionate precision; it can map the boundaries of our uncertainty, but it cannot cross them. The width of the interval is the mathematical expression of our moral responsibility—the space where the data falls silent, and our value judgments must speak.

Every time we assign blame, accept liability, or carry regret, we are not reading facts from a telemetry log; we are staking our humanity on a counterfactual world we can never empirically prove. The causal ghost remains silent in the machine, not because our code is incomplete, but because the truth of what might have been is a weight that only a human conscience is equipped to carry.

In the end, the telemetry only shows us what occurred; it is in the unobserved space of what never happened that we decide who we are, and what we are willing to answer for.