Event-Triggered Lazy ABC: Learned, Exact Early Stopping for Long Stochastic Simulations

Many scientific models are stochastic computer programs that can be run forward but whose likelihood, the probability of the observed data given the parameters, cannot be written down. Approximate Bayesian Computation (ABC) works around this. It draws parameters, runs the simulator, and keeps the draws whose output lands close to the real data. The cost is set almost entirely by the simulator, and most of that cost is spent on runs that could have been recognized as hopeless long before they finished. A simulated neuron that fires at the wrong rate in its first few spikes will not match a long recording. Neither will an epidemic that peaks too early. These long rollouts are also highly redundant in time. Membrane voltage sits near rest between rare spikes, and cell lattices are mostly static between hops, so the moments that decide whether a run is still plausible are few and irregular.

We propose to make ABC stop runs early in a way that changes neither the answer nor its exactness. The stopping decisions are made at informative events in the trajectory, such as spikes, peaks, or bursts of change, rather than at fixed clock times. At each event checkpoint, a small classifier reads a compressed version of the partial trajectory and outputs a probability of continuing. A run that is stopped gets weight zero. A run that survives is reweighted by the inverse product of its continuation probabilities. This reweighting is the device from Lazy ABC, which proved that it leaves the ABC posterior exactly unchanged. What is new is replacing hand-chosen decision statistics and a single fixed checkpoint with learned, multi-stage, event-placed decisions. Temporal redundancy is used only to decide when and how cheaply to check, and never to alter the data that defines the posterior.

Core Claim

Lazy ABC shows that early abandonment is exact. It reports efficiency gains, measured as effective sample size per unit CPU time, of 3.5x to 4.7x on an SIR epidemic model and of 3x and 8x on spatial-extremes data with 20 and 35 locations. Those gains depended on a human choosing what to look at and when. Our claim is that, for long and temporally redundant simulators, two changes compound. The first is placing checkpoints at events detected in the partial trajectory. The second is learning the continuation probability from pilot simulations with a cheap sequence classifier. Together they should give substantially larger efficiency gains than fixed-checkpoint Lazy ABC at identical posterior fidelity, because the decision is made as soon as decisive information appears.

Concretely, a simulation of parameter $\theta$ is cut at checkpoints $k=1,\dots,K$. These are the times at which an event detector fires on the partial path $x_{1:t_k}$. At checkpoint $k$ we continue with probability $\alpha_k \in [\alpha_{\min}, 1]$. A completed run receives the importance weight

$$w(\theta, x) = \frac{\mathbf{1}\{\rho(S(x), S(x_{\text{obs}})) \le \epsilon\}}{\prod_{k=1}^{K} \alpha_k(x_{1:t_k}, \theta)},$$

where $S$ is the summary statistic, $\rho$ a distance, and $\epsilon$ the tolerance. Because each $\alpha_k$ depends only on information available at the moment it is applied, the argument of Lazy ABC carries over stage by stage. The weighted sample therefore targets the same ABC posterior as running every simulation to the end. The floor $\alpha_{\min}$ bounds the weights and so controls the extra variance.

Research Program

The first component is the event detector, which decides where checkpoints go. For voltage traces, events are threshold crossings and spike peaks. For epidemic and lattice models, they are changes in the sampled state larger than a tolerance. A generic version applies the Ramer–Douglas–Peucker simplification used by KeyWorld, which uses it to find turning points in robot end-effector paths, so that checkpoints fall where the trajectory bends. KeyWorld uses key frames to decide what a generative model should spend capacity on. We use them to decide when an inference algorithm should spend a decision. One consequence follows from the FitzHugh–Nagumo study (Samson, Tamborrino, Tubikanec), which found that total recording horizon matters more than sampling rate for identifiability. Truncating runs is therefore not an option, but deciding early whether a full-horizon run is worth finishing is.

The second component is the scorer. It is a small classifier that, given $\theta$ and the partial path, predicts whether the completed run will be accepted at the current tolerance. It is trained on pilot runs that are carried to completion. Running it should cost far less than the simulator, so its input is compressed by merging consecutive near-identical states into single tokens carrying a duration. This is the temporal merging idea from DyCoke, which merges near-duplicate tokens across adjacent video frames and cuts sequence length by 50–60%. Applied here, a quiescent stretch of thousands of solver steps collapses to one token. DyCoke also showed that one-shot pruning discards context that later steps need. We sidestep that failure mode because the scorer keeps a running summary across checkpoints, and because pruning never touches the simulated data used in the final acceptance test.

The third component converts predicted acceptance probabilities into continuation probabilities. We choose them to maximize the efficiency criterion that Lazy ABC defines, effective sample size per expected compute, using the predicted remaining simulation cost at each checkpoint. Inside SMC-ABC (Sequential Monte Carlo ABC, which runs a sequence of shrinking tolerances), the scorer is refit or fine-tuned each generation on the completed runs from the previous one. This adds no extra simulations, because those runs were already finished.

There is a tension, raised by abcTau, which showed that truncated or compressed time series bias autocorrelation-based timescale estimates (a true 20 ms recovered as about 17 ms by direct fitting). We address it by design. Every summary statistic is computed on full, uncompressed simulated and observed data. A bad scorer can only cost efficiency, never correctness. We will test this claim directly rather than assume it.

Baselines

The naive reference point is diligent ABC: SMC-ABC that runs every simulation to the full horizon with the same summaries, tolerance schedule, and kernels. On the FitzHugh–Nagumo task this is the structure-preserving SMC-ABC of Samson, Tamborrino, Tubikanec, whose summaries are invariant and spectral densities and which needed 200,000 to 300,000 simulations on real rat dorsal-rootlet recordings. On the timescale task it is the adaptive ABC in abcTau. All of our methods are swapped in as early-stopping layers on top of these same pipelines, so the posterior target is identical by construction.

The strongest existing method on the question of exact early stopping is fixed-checkpoint Lazy ABC (Lazy ABC). We implement it with a single checkpoint at a tuned fraction of the horizon. Its continuation probability is fit by logistic regression on hand-chosen decision statistics, such as spike count so far and cumulative epidemic size, using the same pilot budget our scorer gets. Its reported results are 3.5x–4.7x efficiency on SIR and 3x and 8x on spatial extremes, with posterior means and standard deviations within 4% of standard ABC. Beating it means a higher ESS per CPU-second at a posterior that matches the diligent-ABC reference within Monte Carlo error. We will report the ratio of our efficiency to Lazy ABC's on the same hardware and pilot budget, and we would call a consistent gain above about 1.5x on the long-horizon tasks meaningful.

The ablations isolate the two ingredients. The first keeps the learned scorer but places checkpoints at uniform times. The second uses event-placed checkpoints with logistic regression on hand features. If either ablation matches the full method, the corresponding ingredient is not pulling its weight. A third ablation removes token merging, to check that scorer overhead, not scorer accuracy, is what merging buys.

We also include amortized neural posterior estimation (SNPE) as implemented in Benchmarking Simulation-Based Inference. SNPE learns the posterior directly with a normalizing flow, and we run it at a matched simulator CPU budget. It targets a different, approximate posterior, so we compare by C2ST against the same reference. C2ST is the accuracy of a classifier separating two sample sets, where 0.5 means the sets are indistinguishable. The file reports C2ST of 0.5 for sequential neural methods on Two Moons at $10^5$ simulations. No reported result was found on Lacuna for C2ST on the SIR task or on FitzHugh–Nagumo.

Why not just…?

Why not just simulate a shorter horizon or downsample? Samson, Tamborrino, Tubikanec found that horizon length drives identifiability. abcTau shows that shortened recordings bias timescale estimates. Both shortcuts change the posterior, whereas our method does not. We will still run uniform downsampling of the summaries as a reference and report the resulting posterior shift.

Why not just use Lazy ABC with better hand-picked statistics? This is the real threat. On a short SIR model, where one obvious statistic (cases so far) is nearly sufficient for the decision, a well-tuned single checkpoint may capture most of the gain. We expect the advantage to appear only where decisive information arrives at irregular times, as in spiking models with sparse spikes. The checkpoint-placement and scorer ablations settle this directly. If hand features with event-placed checkpoints match the learned scorer, we will report that the contribution is checkpoint placement, not learning.

Why not just use neural posterior estimation and avoid ABC? NPE may need far fewer simulations, and on smooth benchmarks it may win outright. Its costs are that its posterior is only as good as the flow, and its long-sequence embedding networks are themselves a bottleneck: DINGO names long-duration signals as an open difficulty. The matched-budget comparison will show where each wins. We regard a finding that SNPE dominates on all tasks at equal compute as a legitimate negative result for this line of work.

Proposed Experiments

We use four testbeds. The first is the SIR task from the sbibm suite, together with the SIR setting used in Lazy ABC, for direct comparison with its 3.5x–4.7x figure. The second is the spatial extremes (Schlather process) rainfall setting from Lazy ABC, with 20 and 35 locations. The third is the hypoelliptic stochastic FitzHugh–Nagumo model, first on synthetic data with known parameters and long horizons, then on the rat dorsal-rootlet recordings under resting and stimulated conditions. The fourth is two-timescale Ornstein–Uhlenbeck processes with the abcTau package, including the synthetic 20 ms ground truth.

The metrics are ESS per CPU-second, scorer overhead counted inside that CPU time, and posterior fidelity. Fidelity is measured by C2ST against a long diligent-ABC run at the same final tolerance, by relative error of posterior means and standard deviations, and by recovery of known parameters on synthetic data. Calibration is checked by simulation-based coverage over repeated synthetic datasets.

Three checks are decisive. The first is exactness: across 100 synthetic FitzHugh–Nagumo datasets, our posteriors must be statistically indistinguishable from diligent ABC (C2ST near 0.5). On the timescale task, the 20 ms recovery must be preserved, confirming that merging tokens in the scorer introduces none of the bias that compressed summaries would. The second is scaling: the efficiency gain over fixed-checkpoint Lazy ABC should grow as the horizon lengthens and spikes become sparser, which is the regime where temporal redundancy is greatest. If the gain stays flat, the event-placement hypothesis is wrong. The third is a robustness stress test: we deliberately train the scorer on a mismatched parameter region. Accuracy should stay intact while efficiency degrades gracefully, set by the floor $\alpha_{\min}$, which demonstrates that a bad scorer costs compute but not correctness.