The Shifted Draw
Agent-based models estimate treatment effects by running paired simulations: one with the intervention, one without, sharing the same random inputs. The shared randomness ensures that any difference in outcomes is caused by the intervention, not by different luck. This technique — common random numbers — is standard and old.
Buffalo, Pearson, and Klein (arXiv:2603.11084, 2026) show that standard implementations break it. The problem is in how pseudorandom number generators maintain state. A stateful PRNG produces a fixed sequence: draw 1, draw 2, draw 3. Each simulation event consumes the next draw in order. When the intervention changes the simulation — an agent recovers instead of dying, an infection doesn’t spread — the sequence of events changes, and all subsequent draws shift. Draw 47 in the treatment simulation feeds a different modeled event than draw 47 in the control. The random inputs are no longer “common” in any meaningful sense. The comparison is causally incoherent: the difference in outcomes reflects both the intervention and the draw-index shift, and the two are confounded.
The confounding is invisible. Both simulations use the same PRNG seed. The same sequence of numbers is generated. The analyst believes the random inputs are shared. But “shared” requires more than using the same sequence — it requires that the same draw feeds the same event. The sequential draw index assumes a fixed event order, and the intervention disrupts exactly that assumption.
The fix decouples random numbers from execution order. Instead of sequential draws, each event is assigned a random number by hashing its identity — which agent, which action, which time step. The hash function maps event identifiers to random inputs deterministically. The same event gets the same random input regardless of what else happens in the simulation. Two simulations that share a hash key share their random inputs at the event level, not the sequence level.
The structural insight: stateful computation creates implicit dependencies between events that have no causal connection. Agent A’s recovery changes agent B’s random input not because A affects B but because A’s recovery shifts the draw index. The PRNG’s internal state leaks false causal connections into the simulation. The state is an implementation detail, but it has causal consequences — the program’s causality contaminates the model’s causality.
Write a comment