Causal-Masked Neural SDE
Implementation & benchmark of arXiv:2607.12140 — Causal Graphs, Markov Properties and Do-calculus for Stochastic Differential Equations
Source paper: Causal Graphs, Markov Properties and Do-calculus for Stochastic Differential Equations arXiv:2607.12140 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace a fully connected neural SDE drift with coordinate-wise functions that can read only the paths of graph parents. Learn soft edge gates and penalize violations of the paper's pathwise Lipschitz condition, so the model remains stable during long rollouts and supports explicit interventions on selected coordinates.
Formulas
Mathematical statement
The paper requires causal coefficients to be adapted: a coefficient at time t depends only on the stopped path x^{\\wedge t}, defined by x^{\\wedge t}(s)=x(s\\wedge t). Its existence theorem assumes linear growth, ||g(t,x,y)|| <= K(t,y)(1+sup_{0<=s<=t}||x(s)||), and pathwise Lipschitz continuity, ||g(t,x_1,y)-g(t,x_2,y)|| <= K(t,y)sup_{0<=s<=t}||x_1(s)-x_2(s)||. Here D([0,T],R^d) is the cadlag path space, g is a coefficient, K is a positive measurable growth/Lipschitz envelope, and T is the rollout horizon. For a directed graph with parent set pa(i), define dX_i(t)=mu_i(t,X_pa(i)^{\\wedge t})dt+sigma_i(t,X_pa(i)^{\\wedge t})dW_i(t), where X_i is coordinate i, mu_i and sigma_i are neural drift and diffusion functions, and W_i is Brownian noise. The graph mask enforces causal structure; the Lipschitz penalty controls sensitivity to parent trajectories.
Implementation notes
(1) Integration point: use a latent neural SDE or continuous-time state-space model with latent state x in R^d. Replace its dense drift MLP by a graph-masked drift. For adjacency logits a_ij, define soft gates q_ij=sigmoid(a_ij/tau), compute h_i(t)=sum_{j != i} q_ij e_ij(x_j(t)), and evaluate mu_i(t)=MLP_i([h_i(t),t]). Apply the same mask to sigma if the noise mechanism should also be causal. During numerical integration, only states up to the current solver time are supplied, implementing the stopped-path requirement. (2) Pseudocode: sample x_0; for each Euler-Maruyama step t_k to t_{k+1}, compute q=sigmoid(A/tau), form h_i=sum_j q_ij e_ij(x_j^k), evaluate mu_i and positive sigma_i, sample epsilon_i from a standard normal, and update x_i^{k+1}=x_i^k+mu_i Delta_t+sigma_i sqrt(Delta_t) epsilon_i. Draw a random perturbation delta x and estimate L_hat_i=||mu_i(x+delta x)-mu_i(x)||/||delta x||; add the displayed Lipschitz penalty. Anneal tau and hard-threshold q at inference. (3) The paper supplies the adapted path restriction and the growth/Lipschitz criteria. Estimate L_hat_i, graph sparsity, and L_max empirically; choose L_max using a rollout-stability sweep. (4) First experiment: train on a 5-10 variable nonlinear SDE with a known sparse cyclic graph, comparing a dense neural SDE, an unregularized graph neural SDE, and this model at equal parameter count. Measure one-step likelihood, long-horizon rollout error, edge AUROC, and intervention error after fixing one coordinate to an externally supplied trajectory. Success is lower intervention and long-rollout error without exploding trajectories, at similar one-step likelihood and FLOPs.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Not reproduced ✗
Stage 2 · Practical benchmark result: Significantly worse ✗
Methodology: 8 paired seeds, permutation test (p<0.05) against a learning-rate-tuned baseline. How verification works
Stage 1 — Mechanism check agent confidence 8/10
Built a causal-masked Euler–Maruyama SDE module with soft sigmoid graph gates, coordinate-wise drift structure, empirical Lipschitz penalty, interventions, and reproducible checks. The mechanism manifested: forbidden-edge sensitivity was exactly 0 across logits, allowed-edge sensitivity matched q|B| to below 1e-10, and Euler rollout amplification matched (1+dt*lambda)^N within about 3e-8. The secondary regression comparison did not show an accuracy win: masked one-step MSE was 0.00060525 versus dense 0.00060523, and masked long-rollout MSE was 0.0003988 versus dense 0.0002075; the result therefore supports the mechanism but not a general performance improvement.
- Agent confidence
- 8/10
- Baseline
- Dense linear drift: one-step MSE 0.0006052323; long-rollout MSE 0.0002075380.
- Idea
- Masked drift: one-step MSE 0.0006052518; long-rollout MSE 0.0003988242; intervention MSE 0.0000117614. Mechanism checks: forbidden sensitivity 0 exactly; gate-scaled Lipschitz sensitivity relative error <1e-9; Euler amplification relative agreement <1e-7.
Limitations: Only a deterministic two-dimensional linear toy system and a small one-step regression were tested. No nonlinear neural-SDE training, learned graph recovery, diffusion modeling, AUROC, likelihood, FLOP/latency measurement, temperature annealing, or statistically repeated experiments were performed.
How to run: python3 causal_masked_sde.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2607.12140)
Significantly WORSE than the tuned baseline (+208.4%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0001
- Idea mean
- 0.0003
- Effect (Δ)
- 0.0002 (+208.4%; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±73.9%
- Mechanism
- Not confirmed ✗
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Only the registered dynamics track was tested. No full stochastic neural-SDE likelihood, diffusion estimation, graph AUROC, temperature annealing, hard thresholding, or explicit intervention-rollout metric was evaluated.
How to run: python3 bench_causal_masked.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Failed ✗
Agent confidence: 10/10
Built and evaluated a causal-masked GRU on the registered dynamics track, structurally matched to rollout stability and control. The best idea configuration was significantly worse than the tuned baseline across 8 paired seeds, and the trained-model sensitivity signature did not confirm attenuation.
- Baseline
- rnn_small, best lr=0.01; full 8-seed mean MSE 0.0000820010.
- Idea
- Causal-gated GRU, best lr=0.01; full 8-seed mean MSE 0.0002529041; 0/8 paired wins; permutation p=0.0081.
- Mechanism signature
- Baseline sensitivity 0.1278394; idea sensitivity 0.1740205; relative change +36.12%; confirmed=false.
Benchmark result
Significantly WORSE than the tuned baseline (+208.4%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0001
- Idea mean
- 0.0003
- Effect (Δ)
- 0.0002 (+208.4%; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±73.9%
- Mechanism
- Not confirmed ✗
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Only the registered dynamics track was tested. No full stochastic neural-SDE likelihood, diffusion estimation, graph AUROC, temperature annealing, hard thresholding, or explicit intervention-rollout metric was evaluated.
How to run: python3 bench_causal_masked.py
Artifacts
- bench_causal_masked.py 4.7 KB View Raw
- bench_report.json 4.7 KB View Raw
- causal_masked_sde.py 5.5 KB View Raw
- report.md 1.6 KB View
- report_bench_2026-08-31T010658.md 5.6 KB View
- results.json 2.4 KB View Raw