- DiffLOB introduces a regime-conditioned DDPM model for generating realistic counterfactual limit order book (LOB) trajectories, treating future market regimes as controllably intervenable.
- The model's control module, inspired by ControlNet, allows for learning interventions as residual modifications, improving flexibility and realism in simulated market scenarios.
- DiffLOB outperforms competitors by achieving the lowest KS and Wasserstein distances for price realism
- follow_up_questions
Motivation and problem statement
Generative models for limit order books (LOBs) have reached a level of statistical realism sufficient for market simulation, yet they remain largely passive: autoregressive and diffusion-based simulators learn the observational distribution of market dynamics, while agent-based approaches obtain alternative outcomes only through interaction with trading agents, with no guarantee that the resulting trajectories correspond to a desired future state. This restricts their applicability to stress testing, scenario analysis, and decision support, all of which require answering questions of the form: "If the future market regime were X instead of Y, how would the LOB evolve?" The paper proposes DiffLOB (2602.03776), a regime-conditioned DDPM that treats future market regimes—trend, volatility, liquidity, and order-flow imbalance—as intervenable control variables rather than observed labels, thereby formulating counterfactual LOB generation as conditional generative modeling of p(xt+1:t+τ​∣x1:t​,ct+1:t+τ​).
Architecture and training
DiffLOB uses a WaveNet-style backbone of 16 gated residual blocks with residual and skip connections, operating on noised future LOB trajectories over horizons of Ï„=32 one-second snapshots conditioned on the preceding 32 snapshots. Conditioning is injected through FiLM modulation, applied sequentially by the diffusion timestep embedding, local regime embeddings (historical LOB, liquidity, imbalance, time-of-day, encoded via convolutions), and global regime embeddings (future trend and volatility, encoded via MLPs). This separation between local and global conditions allows the model to represent heterogeneous regime effects at different temporal scales.
The central architectural contribution is a ControlNet-inspired control module trained in a second stage: after the backbone and condition encoders are trained on the base distribution, all backbone parameters are frozen and only the control module is optimized, injecting regime signals through zero-initialized 1×1 convolutions so that the control pathway has no effect at initialization and learns interventions as residual modifications. Sampling uses ancestral sampling for the variance-preserving SDE with classifier-free guidance (conditions dropped with probability 0.5 during training), which permits continuous adjustment of intervention strength.
Data preprocessing targets stability: prices are represented as one-step mid-price differences plus cross-sectional price differences (removing absolute price levels), and volumes are capped at the 99th percentile followed by square-root normalization. Experiments use LOBSTER data at one snapshot per second with top-10 levels per side for AMZN, AAPL, and GOOG, with 16 training days, 1 validation day, and 2 test days in February 2023.
Evaluation framework
The paper contributes a three-criterion evaluation protocol for counterfactual LOB generation:
- Controllable realism: conditioning on observed future regimes, do generated trajectories reproduce marginal distributions, temporal dependence structure, and regime variable distributions?
- Counterfactual validity: do interventions on future regimes induce changes consistent with real markets observed under comparable extreme conditions (top/bottom 20% quantiles)?
- Counterfactual usefulness: does augmenting real training data with counterfactual samples improve downstream regime prediction?
Distances are measured with KS statistics, Wasserstein distance, KL divergence, and JS divergence across price and volume statistics.
Controllable realism results
Under observed regimes, DiffLOB achieves the lowest or near-lowest distributional distances across all three stocks and nearly all metrics. Representative figures for AMZN price realism include KS = 0.052, Wasserstein = 0.028, KL = 0.076, and JS = 0.018, versus Wasserstein distances of 64.6 for Diff-CSDI and KL of 9.34 for cGAN on AAPL. On volume realism, Diff-CSDI produces Wasserstein distances on the order of 105–106, whereas DiffLOB remains around 55–98. Qualitatively, DiffLOB reproduces mid-price return distributions across horizons, the bid–ask spread distribution, the persistent autocorrelation decay characteristic of volatility clustering (which cGAN and cVAE fail to capture and AR underestimates), and—uniquely among the tested baselines—the negative correlation of first-differenced volumes at adjacent price levels. Ablating the control module degrades performance substantially (e.g., AMZN price KS rises from 0.052 to 0.212), indicating that explicit regime conditioning improves fidelity even when the conditioning values are observed rather than intervened upon.
Counterfactual validity results
Interventions are imposed as extreme hypothetical regime values, and generated distributions are compared against real trajectories in the corresponding top or bottom 20% quantiles. For liquidity and order-flow imbalance, DiffLOB closely matches empirical extreme-regime distributions; for trend and volatility, the match is imperfect but consistently shifts in the correct direction and preserves high/low separation. Visualizations confirm interpretable responses: high-trend interventions yield persistent upward price paths, high-volatility interventions yield larger fluctuations, high-liquidity interventions raise volume magnitudes across depth, and imbalance interventions induce bid–ask asymmetries consistent with the imposed condition.
Quantitatively, DiffLOB attains the lowest or near-lowest distances across most regimes and assets—for example, under high-volatility conditions on AMZN it achieves KS = 0.083 and Wasserstein = 0.061, versus 59.7 for Diff-CSDI. Two caveats are stated plainly by the authors: cGAN is competitive specifically under trend interventions on AMZN (KS = 0.049 high-trend, 0.040 low-trend) despite degrading sharply elsewhere; and DiffLOB without the control module is competitive under some volume-driven regimes (high liquidity, high imbalance), suggesting the diffusion backbone partially captures volume dynamics on its own—a result the authors connect to their earlier DiffVolume work. The claim of superiority therefore rests on consistency across regimes and assets rather than uniform dominance on every metric.
Counterfactual usefulness results
Downstream tasks use past 1-minute LOB data to predict the next minute's regime, evaluated on out-of-sample data (1 March 2023) restricted to the top and bottom 20% of each regime distribution. Three settings are compared: real data alone, real data duplicated (to control for dataset size), and real data augmented with counterfactual samples. Augmentation improves most high- and low-regime metrics—for instance, low-trend classification accuracy on AMZN rises from 0.061 (Real) and 0.064 (Real × 2) to 0.289 (Real + CF); AAPL low-regime liquidity prediction improves from R2=−0.184 to 0.17; GOOG high-regime liquidity prediction improves from R2=−0.742 to 0.017. Because the Real × 2 control isolates the effect of sample count, these gains indicate that counterfactual trajectories supply information about extreme regimes that is scarce in observational data. Notably, some baseline accuracies are extremely poor (AMZN low-trend accuracy of 0.061), underscoring how poorly calibrated standard predictors are in tail regimes—and hence where synthetic augmentation has the most value.
Limitations and open questions
Several limitations are acknowledged or evident from the reported results. First, counterfactual alignment under trend and volatility interventions is directional rather than exact: generated distributions shift correctly but do not fully overlap with empirical extreme-regime distributions, and the corresponding KS/KL values (e.g., KL up to 3.53 under low-trend on AMZN) are materially worse than those for volume-driven regimes. Second, evaluation covers only three large-cap NASDAQ stocks, 32-second horizons, and one-second snapshot resolution; generalization to other instruments, longer horizons, event-level dynamics, or higher-frequency data is untested. Third, the regime variables themselves are simple aggregate statistics computed from the target trajectory, so "counterfactual" here means intervention on summary regime descriptors, not on underlying agent behavior—the model explicitly decouples dynamics from agent-level mechanisms, which limits interpretability of the causal semantics of such interventions. Fourth, the usefulness evaluation relies on a single downstream day and two task types; whether augmented training transfers across regimes, assets, or more complex decision-making tasks remains open. Finally, the comparison shows localized baseline strengths (cGAN on trend), leaving open the question of which architectural components drive robustness versus which gains come from the diffusion backbone itself.
Conclusion
DiffLOB reframes LOB generation as regime-conditioned diffusion, making future market states directly intervenable through a ControlNet-style module trained on a frozen backbone. Across three stocks, it delivers the strongest controllable realism among tested generative baselines, produces counterfactual trajectories whose statistics align with real extreme-regime markets—most convincingly for liquidity and order-flow imbalance—and yields measurable downstream gains when used to augment scarce tail-regime data. The framework's principal open issues are exactness of counterfactual matching for price-driven regimes, limited asset and horizon coverage, and the gap between intervening on regime summaries and intervening on market microstructure itself.