acceptodds
Under review as a conference paper at ICLR 2027

CaLM: Causal Language Modeling for Counterfactual World Simulations

Abstract

Counterfactual trajectory simulation asks how a sequence would have unfolded had selected actions been different. Autoregressive Transformers provide a powerful framework for sequence modeling by learning the conditional distribution of each token given the preceding tokens. However, fitting these conditional distributions does not ensure that simulations respect causal relationships or correctly account for unobserved confounding when evaluating interventions. We formalize counterfactual trajectory simulation in the language of structural causal models. To evaluate how reliably a simulator class answers counterfactual queries, we introduce *counterfactual coverage*, which holds when the true counterfactual value lies between the lower and upper bounds of the class's estimates. We show theoretically that next-token prediction alone does not guarantee counterfactual coverage for vanilla Transformers. We develop CaLM (Causal Language Modeling), a Transformer-based simulator that incorporates constraints specified by an arbitrary causal graph into its attention mechanism. We establish counterfactual coverage for the CaLM simulator class and demonstrate improved counterfactual prediction across chess, buyer-seller negotiation, autonomous driving, clinical trajectories, and poker.

Primary area:
causal reasoning
Keywords:
causal reasoning, counterfactuals, sequence modeling, transformer

Reviews

Among:
Shape:
1234this paper, Top 15%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 3.00 over 3 reviews, above 85% of the others.
Reviewer_jhV7OpenReview ↗
Rating
3(+1)
Confidence
2
Informativeness
2
Presentation
3
Soundness
1
Read review
Paper summary

The paper introduces a special attention mechanism for modelling structural causal models. The key innovation is a construction that preserves parent restrictions at arbitrary depth and supports explicit counterfactual semantics. This is achieved by introducing separate computation and value tokens. The suggested architecture is evaluated in a range of benchmarks and compared against a regular transformer and a random-sparse transformer.

Critical strengths

The construction and augmentation of the attention design via computational and value tokens is elegant and supports counterfactual semantics.

Critical weaknesses

I see the following weaknesses:

  1. there has been many alternative neural architectures that have been proposed for structural causal models, e.g., under the rubrik of 'neural causal models', 'DAG-aware transformers', 'deep SCMs', 'causal normalizing flows', etc. The paper should compare and benchmark specifically against those, as the current baselines (regular transformer and random-sparse transformers) do not have access to the DAG.

  2. the paper should isolate the benefit of the architectural modification. Compared to the earlier deep structural causal models that directly parametrize the structural equations, the current solution modifies the attention layers by introducing the DAG and the computational/value tokens. These changes should be ablated, and the performance gains compared to causual baselines is unclear at the moment.

  3. Algorithm 2 for counterfactual inference starts by drawing from the posterior P_\theta(U|Z=z). It is unclear whether these posterior draws can be computed efficiently, and the suggested rejection sampling scheme seems to have extremely small acceptance probability in general. It is therefore unclear whether counterfactual inference is computationally feasible with the suggested architecture.

Overall, while I enjoyed reading the paper, the main question that remained unaswered was 'what benefit comes specifically from using a transformer/multi-layered attention, beyond the supplied structural equations?'.

Questions for authors

Please respond to the concerns raised in weaknesses.

In addition, I was unsure about the foundation model example. How is the underlying DAG of the structural causal model chosen in this example?

6 comments
AuthorsOpenReview ↗

Author Response [1/4]

We are grateful to the reviewer for their detailed comments.

Response to W1.

… alternative neural architectures that have been proposed for structural causal models, e.g., under the rubrik of 'neural causal models', 'DAG-aware transformers', 'deep SCMs', 'causal normalizing flows', etc. …

We address this point in two steps: we first discuss why existing baselines that use causal structure are not directly applicable to our setting, and then provide an empirical comparison with versions of these baselines adapted for counterfactual simulation. We add all these discussions in the App. H.

Applicability of the DAG baselines

CaLM is designed for large-scale counterfactual trajectory simulation under a general causal diagram. This requires three capabilities at once: (1) counterfactual trajectory simulation with abduction (an L3 query); (2) long sequences whose number of variables is not fixed in advance; and (3) a general causal structure with unobserved confounding. Each of the cited baselines, although it builds on causal assumptions (for example, a given DAG) to estimate causal queries, lacks at least one of these capabilities, so none can be applied directly to the tasks in Sec. 4.

Method(1) Counterfactual trajectory simulation with abduction (L3 query)(2) Long-length sequences (large graph)(3) General structure with unobserved confounding
NCM [3]YesNoYes
DeepSCM [4]YesNoNo
Causal Normalizing Flows [5]YesNoNo
DAG-aware Transformer [6]NoYesNo
CaLM (ours)YesYesYes

(1) Counterfactual trajectory simulation with abduction (L3 query). Our target is the counterfactual trajectory distribution P(Zx′∣Z=z)P(\mathbf{Z} _ {x'} \mid \mathbf{Z} = \mathbf{z}), which requires abduction of the exogenous variables, P(U∣Z=z)P(\mathbf{U} \mid \mathbf{Z} = \mathbf{z}), from the factual trajectory and reuse of the same UU in the intervened world. In our ICU experiment, for instance, the query is: given a patient's completed ICU record z1:Tz _ {1:T}, what would the full record have been had the clinician given vasopressor dose x′x' at hour tt instead of the factual one, i.e. P(Z1:T[Xt=x′]∣Z1:T=z1:T)P(\mathbf{Z} _ {1:T}[X_t = x'] \mid \mathbf{Z} _ {1:T} = \mathbf{z} _ {1:T}) (App. C.4.3). Answering it requires inferring the patient's unobserved frailty UFU_F from the whole record and keeping it fixed under the alternative treatment. DAG-aware Transformer [6] estimates an interventional query on the outcome YY only, not on the trajectory. Specifically, it fits the propensity score and the outcome regression from observational data and plugs them into standard formulas (g-formula, IPW, AIPW) for the ATE or CATE. It has no procedure for counterfactual queries, which require inferring P(U∣Z=z)P(\mathbf{U} \mid \mathbf{Z} = \mathbf{z}). NCM [3], DeepSCM [4] and Causal Normalizing Flows [5] do support abduction, but they fall short on (2) or (3) below. CaLM performs abduction and generates the full trajectory in one model: P(U∣Z=z)P(\mathbf{U} \mid \mathbf{Z} = \mathbf{z}) is inferred within the sequence prediction itself, with an attention mask ensuring that the inferred UU takes only the factual trajectory as input.

(2) Long sequences, number of variables not fixed in advance. We work in settings where the simulated sequence is long, and its length is not fixed in advance (for example, up to 2,000 tokens in chess). NCM, DeepSCM, Causal Normalizing Flows and DAG-aware Transformer are defined over a fixed set of variables (one network, one flow dimension or one token per variable), which must be specified in advance. In addition, NCM answers conditional counterfactual queries by sampling uu from the prior, keeping the draws that reproduce the evidence, i.e. Z(u)=zZ(u)=z, and rejecting the others. As the sequence length increases, the acceptance rate decays and a very large number of samples of uu is needed.

(3) General structure with unobserved confounding. CaLM takes an arbitrary causal diagram GG as input, including bidirected edges for unobserved confounding. Thm. 9 proves that CaLM is sound and expressive for representing any SCM compatible with a given causal diagram. For example, in the driving domain, each driver's actions are confounded by that driver's unobserved persona. In contrast, DeepSCM and Causal Normalizing Flows assume an independent exogenous variable UU for each variable, and DAG-aware Transformer assumes unconfoundedness (or valid proxy variables), i.e. that adjusting for the observed covariates removes all confounding between the treatment XX and the outcome YY. These assumptions do not hold in our settings. NCM does handle general causal diagrams, but it falls short on (2).

AuthorsOpenReview ↗

Author Response [2/4]

To still provide an empirical comparison with existing methods that use causal structure, we adapted NCM, DAG-aware Transformer, DeepSCM, Causal Normalizing Flows to our setting. To make the comparison possible, we focus on the query over the target YY alone instead of the full trajectory, i.e. P(Yx′∣Z1:T=z1:T)P(Y _ {x'} \mid \mathbf{Z} _ {1:T} = \mathbf{z} _ {1:T}). Please refer to the App. H for the full details about the adaptation of each baseline.

MethodMSE ↓Error reduction vs. Naive ↑Pearson r ↑Directional accuracy ↑
CaLM0.0856+3.7%0.4973.3%
DAG-aware Transformer (best variant using G-formula, rest in Fig. 18)0.1071−20.5%0.2173.3%
NCM0.0994−11.7%0.3069.2%
Causal NF0.0980−10.2%0.3070.8%
DeepSCM0.1081−21.6%0.0373.3%

CaLM outperforms all adapted baselines and it achieves the lowest counterfactual MSE and the highest Pearson correlation on Tier M. The lower MSE means that CaLM's predicted counterfactual outcomes are closer to the ground truth, and the higher Pearson correlation means that its predictions better track how the ground truth outcome varies across patients and interventions. Moreover, CaLM is the only method that improves over the Naive Transformer; none of the adapted baselines reduces the error relative to Naive. Please refer to the App. H and Fig. 18 for the full results.

Response to W2.

the paper should isolate the benefit of the architectural modification… What benefit comes specifically from using a transformer/multi-layered attention, beyond the supplied structural equations?

We added studies of three architectural design choices in Appendix I:

  1. Causal-diagram masking versus dense left-to-right masking.
  2. Computation/readout/value (CRV) blocks versus one token per variable with parent-only masking.
  3. A shared Transformer versus separate feedforward networks for the structural mechanisms.

The first two studies test whether the architecture correctly enforces the causal structure. The third compares alternative parameterizations of the mechanisms.

Setup. For (1) and (2), we conduct a controlled 2×22\times 2 ablation on three causal graphs (Fig. 19a–c). Models are trained on observational data and evaluated on identifiable interventional queries. Identifiability lets us assess whether the models recover the correct queries without ambiguity from non-identifiability.

Ablation arms. We compare four variants:

  • CaLM: graph-based mask with CRV blocks.
  • CRV only: dense left-to-right mask with CRV blocks.
  • Graph mask only: parent-only mask with one token per variable.
  • Naive: dense left-to-right mask with one token per variable.

The Transformer backbone, observational training data, and optimizer are held fixed across these arms.

Metrics. We measure observational fit, interventional query error, and non-parent leakage. Leakage measures how much a variable’s predicted distribution changes when non-parent values vary while its parent values remain fixed. This directly tests the information-leakage mechanisms discussed in Section 3 and Appendix I.1.

Results. The results are illustrated in the following table. All four variants achieve similar observational fit, but only CaLM has zero non-parent leakage across all tested variable orders and achieves the lowest query error. This suggests the importance of both (1) and (2) in architecture design.

VariantAttention maskCRV blocksObservational error ↓Interventional error ↓Non-parent leakage ↓
CaLMGraph-basedYes0.0080.0080.000
CRV onlyDense left-to-rightYes0.0080.1540.299
Graph mask onlyParent-onlyNo0.0080.1650.389
NaiveDense left-to-rightNo0.0080.1680.823

For (3), we additionally compare CaLM with an MLP-based MLE-NCM using the same Sepsis causal graph, reusing the baseline experiment in Appendix H. Both methods can encode the supplied causal structure. At Tier M, CaLM achieves lower counterfactual MSE (0.0856 versus 0.0994) and higher Pearson correlation (0.49 versus 0.30) than the evaluated MLE-NCM with likelihood weighting.

Full experimental setups, analysis, and results are provided in Appendices I.1 and I.2.

Thus, the architectural benefits from using CaLM, and thus a transformer based architecture is highlighted by the results presented in App. I. Furthermore, using transformers, also allows us to fine-tune foundation models, as in App. D.8.

AuthorsOpenReview ↗

Author Response [3/4]

Response to W3.

Algorithm 2 … It is therefore unclear whether counterfactual inference is computationally feasible with the suggested architecture.

We acknowledge the lack of context and elaboration about the posterior sampling procedure, and we appreciate the reviewer for noticing the gap in the presentation; we included more elaboration in the paper (highlighted in blue), and we shall also release the code upon acceptance.

As mentioned in the paper, rejection-sampling and posterior modeling are conventional choices for the posterior step, and in CaLM we used the same transformer architecture as a posterior sampler. In particular, the unobserved variables UU are placed in the context, preceding the observable variables ZZ, which are followed by a posterior sampler U~\tilde{U} restricted to only attending ZZ. We train for conventional next-token prediction loss, to reconstruct U~\tilde{U} from UU. As we train the model to fit the observational data, the Z→U~Z \rightarrow \tilde{U} segment learns a posterior sampler with negligible cost. The sampler adds no separate network or training stage. The algorithms in the appendix digressed the specifics of implementation for sake of generality, and to maintain coherence with the notation/conventions introduced in the theory section.

Below, we provide some empirical feasibility.

Number of samples and accuracy. We use N={16,64,256}N = \{16, 64, 256\} for sampling in the abduction steps. We can therefore compare the sampler with the exact model posterior. Results are over 5 training seeds, with 1000 repeated runs of the estimator per query. Both metrics are computed per query and averaged with equal weight over queries. The sampler’s approximation error is as follows: TV(q,p)=0.25–0.29\text{TV}(q, p) = 0.25\text{–}0.29, and KL(p∥q)=0.26–0.32\text{KL}(p \parallel q) = 0.26\text{–}0.32 nats. Abduction still lowers the counterfactual error. At Tier S it falls from 0.2410.241 to 0.0770.077 (95% CI of the gain: [0.143,0.178][0.143, 0.178]). The error decreases monotonically in NN and approaches the N→∞N \rightarrow \infty limit from above. The remaining error comes from qq, not Monte Carlo noise. The induced error ∣Pq−P⋆∣=∣∑u(q−p)1{Yx(u)=y}∣|P_q - P^\star| = \left|\sum_{\mathbf{u}}(q - p)\mathbf{1}\{Y_x(\mathbf{u})=y\}\right| is bounded by TV\text{TV}, and is much smaller when the misplaced mass falls on values of u\mathbf{u} with the same outcome. Empirically it is 20–3120\text{–}31\\% of TV\text{TV} and never exceeds it. The sampler is approximate, but it shifts mass in the direction that matters for the query, which is enough to cut the no-abduction error by about two thirds at Tier S.

Computational cost. Alg. 1 trains the auxiliary variables U~\tilde{U} in the same teacher-forced forward pass as the mechanisms, so no separate network or training stage is needed. In Alg. 2, all NN draws run as one batch. Drawing uu from U~\tilde{U} takes one forward pass per exogenous variable. Prediction takes one pass per decoded variable, and the clamped intervention takes none. The number of passes therefore does not depend on NN; NN only sets the batch size. Because the rollout under a fixed uu is deterministic, repeated draws need to be decoded only once.

At N = 64 on one H100:

  • Sepsis Tier M: 3.4 s per query and 881 MiB. Abduction takes 0.12 s of this (4%).
  • Mistral-7B / Llama-3-8B: 6.0 s / 4.9 s per query and 26 / 31 GiB. Abduction takes 1.0 s / 0.8 s of this (17%).
Reviewer_w5rUOpenReview ↗
Rating
3(+1)
Confidence
3
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

The authors demonstrate that standard next-token prediction optimizes observational conditionals, which conflates interventions with persistent unobserved confounders, thereby failing to provide counterfactual coverage. To mitigate this the authors propose embedding a user specified Causal DAG into the attention mechanism taking care to avoid multi-layer contextual leakage via token isolation.

Critical strengths

Rigorous treatment of contextual representation leakage: Authors correctly identify the reopening of indirect paths across layers when a causal graph is enforced via masked attention. The proposed structural separation is an elegant solution to guarantee parent only dependence. Counterfactual Coverage: The design of the counterfactual coverage approach provides a theoretically grounded metric for certifying risk in world models. Diverse evaluation domains: The proposed approach is evaluated across a range of domains with widely varying model scales and shows a consistent mitigation of causal inversion.

Critical weaknesses

Lack of proper baselines: The method is tested against only naïve baselines which are not provided with the underlying causal DAG of the simulator environment, it is not tested against cited related works leaving an unfair comparison. Theorem 4 wording: Theorem 4 is described as a limitation of transformers but is actually a limitation of any model learned via maximum likelihood on observed data

Questions for authors

How does the model perform against state-of-the-art causal transformer baselines such as the cited Causal Transformer, G-Transformer, NCMs? Does the token isolation and removal of cross-positional connections harm performance of the attention mechanism?

4 comments
AuthorsOpenReview ↗

Author Response [1/2]

We appreciate the reviewer's thoughtful comments, and provide our responses to their questions below.

Response to W1, Q1.

… perform against state-of-the-art causal transformer baselines such as the cited Causal Transformer, G-Transformer, NCMs?

We address this point in two steps: we first discuss why existing baselines that use causal structure are not directly applicable to our setting, and then provide an empirical comparison with versions of these baselines adapted for counterfactual simulation. We add all discussions about the mentioned baselines in the App. H.

Applicability of the DAG baselines

CaLM is designed for large-scale counterfactual trajectory simulation under a general causal diagram. This requires three capabilities at once: (1) counterfactual trajectory simulation with abduction (an L3 query); (2) long sequences whose number of variables is not fixed in advance; and (3) a general causal structure with unobserved confounding. Each of the cited baselines, although it builds on causal assumptions (for example, a given DAG) to estimate causal queries, lacks at least one of these capabilities, so none can be applied directly to the tasks in Sec. 4.

Method(1) Counterfactual trajectory simulation with abduction (L3 query)(2) Long sequences, number of variables not fixed in advance(3) General structure with unobserved confounding
NCM [1]YesNoYes
Causal Transformer [2]NoYesNo
G-Transformer [3]Partly (simulates, no abduction)YesNo
CaLM (ours)YesYesYes

(1) Counterfactual trajectory simulation with abduction (L3 query). Our target is the counterfactual trajectory distribution P(Zx′∣Z=z)P(\mathbf{Z} _ {x'} \mid \mathbf{Z} = \mathbf{z}), which requires abduction of the exogenous variables, P(U∣Z=z)P(\mathbf{U} \mid \mathbf{Z} = \mathbf{z}), from the factual trajectory and reuse of the same U\mathbf{U} in the intervened world. In our ICU experiment, for instance, the query is: given a patient's completed ICU record z1:T\mathbf{z} _ {1:T}, what would the full record have been had the clinician given vasopressor dose x′x' at hour tt instead of the factual one, i.e. P(Z1:T[Xt=x′]∣Z1:T=z1:T)P(\mathbf{Z} _ {1:T}[X_t = x'] \mid \mathbf{Z} _ {1:T} = \mathbf{z} _ {1:T}) (App. C.4.3). Answering it requires inferring the patient's unobserved frailty UFU_F from the whole record and keeping it fixed under the alternative treatment. Causal Transformer [2] estimates an interventional query on the outcome YY only, not on the trajectory. Specifically, the query [2] solved is the expected outcome given the history before the treatment, E[Y[Xt=x′]∣Z1:t−1=z1:t−1]\mathbb{E}[Y[X_t = x'] \mid \mathbf{Z} _ {1:t-1} = \mathbf{z} _ {1:t-1}]. G-Transformer [3] does simulate trajectories, but its target is still an interventional query conditioned on the past history, P(Zt+1:T[Xt=x′]∣Z1:t−1=z1:t−1)P(\mathbf{Z} _ {t+1:T}[X_t = x'] \mid \mathbf{Z} _ {1:t-1} = \mathbf{z} _ {1:t-1}). Neither has a procedure for counterfactual queries, which require inferring P(U∣Z=z)P(\mathbf{U} \mid \mathbf{Z} = \mathbf{z}). In contrast, CaLM performs abduction and simulates the full trajectory in one model: P(U∣Z=z)P(\mathbf{U} \mid \mathbf{Z} = \mathbf{z}) is inferred within the sequence prediction itself, with an attention mask ensuring that the inferred U\mathbf{U} takes only the factual trajectory as input.

(2) Long sequences, number of variables not fixed in advance. We work in settings where the simulated sequence is long, and its length is not fixed in advance (for example, up to 2,000 tokens in chess). NCM defines one network or one flow dimension per variable and needs the variable set fixed in advance. In addition, NCM answers conditional counterfactual queries by sampling u\mathbf{u} from the prior, keeping the draws that reproduce the evidence, i.e. Z(u)=zZ(u)=z, and rejecting the others. As the sequence length increases, the acceptance rate decays and a very large number of samples of u\mathbf{u} is needed.

(3) General structure with unobserved confounding. CaLM takes an arbitrary causal diagram GG as input, including bidirected edges for unobserved confounding. Thm. 9 proves that CaLM is sound and expressive for representing any SCM compatible with a given causal diagram. For example, in the driving domain, each driver's actions are confounded by that driver's unobserved persona. In contrast, Causal Transformer and G-Transformer assume sequential ignorability and sequential exchangeability, respectively, i.e. that adjusting for the observed history removes all confounding between the treatments XX and the outcome YY. This does not hold in our settings.

AuthorsOpenReview ↗

Author Response [2/2]

To still provide an empirical comparison with existing methods that use causal structure, we adapted NCM, Causal Transformer and G-Transformer to our setting. To make the comparison possible, we focus on the query over the target YY alone instead of the full trajectory, i.e. P(Yx′∣Z1:T=z1:T)P(Y _ {x'} \mid \mathbf{Z} _ {1:T} = \mathbf{z} _ {1:T}). Please refer to the App. H for the modification made to each baseline.

The results are as follows for Tier M, i.e. the medium scale models. Details are provided in Fig. 18.

MethodMSE ↓Error reduction vs. Naive ↑Pearson r ↑Directional accuracy ↑
CaLM0.0856+3.7%0.4973.3%
Causal Transformer0.1466−64.9%0.1165.0%
G-Transformer0.0996−12.0%0.2573.3%
NCM0.0994−11.7%0.3069.2%

CaLM outperforms all adapted baselines and it achieves the lowest counterfactual MSE and the highest Pearson correlation. The lower MSE means that CaLM's predicted counterfactual outcomes are closer to the ground truth, and the higher Pearson correlation means that its predictions better track how the ground truth outcome varies across patients and interventions. Moreover, CaLM is the only method that improves over the Naive Transformer; none of the adapted baselines reduces the error relative to Naive. Please refer to the App. H for the full results. We hope this satisfactorily resolves the reviewers' questions about baselines.

Response to W2.

Theorem 4 wording…

This is indeed an accurate observation. The proof in App. A.1 does not rely on the architecture being restricted to Transformers at all. Notably, counterfactual inference is not a capability built into every probabilistic model, so making a claim about any probabilistic model is only well-defined once the counterfactual inference procedure is specified. In the paragraphs preceding Theorem 4 (from line 173 to 195) we instantiated different transformer-based baselines with a counterfactual inference procedure, and the theorem statement that followed it is scoped to the transformer-based baselines for concreteness.

Response to Q2.

Does the token isolation and removal of cross-positional connections harm performance of the attention mechanism?

We would like to point out that CaLM introduces auxiliary placeholders (readout and computation tokens) while it removes cross-positional connections to encode the desired causal dependencies among the observable positions. Arguably, this procedure does not reduce the flexibility of the transformer architecture to fit the observational data beyond the necessary restraints that are implied by the graph. We would like to refer the reviewer to Sec. 4.3 in the paper on Page 8, mentioning how the advantage appears under the counterfactual prediction but CaLM tracks the Naive baseline on observational sequences. As detailed in App. D.7 detailing the observations from Fig. 12, where the token isolation and removal of cross-positional connections does not harm the performance of CaLM as compared to standard self-attention (Naive) across most domains (all except for the slight drop for Chess). The error rate exhibited by CaLM is quite similar as compared to Naive, highlighting that the gain in counterfactual abilities does not come at the cost of observational prediction ability.

We hope we’ve suitably clarified the doubts raised by the reviewer.

[1] Xia, Kevin, et al. “Neural Causal Models for Counterfactual Identification and Estimation.” The Eleventh International Conference on Learning Representations, 2023, https://openreview.net/forum?id=vouQcZS8KfW

[2] Melnychuk, Valentyn, Dennis Frauen, and Stefan Feuerriegel. "Causal transformer for estimating counterfactual outcomes." International conference on machine learning. PMLR, 2022.

[3] Xiong, Hong et al. “G-Transformer: Counterfactual Outcome Prediction under Dynamic and Time-varying Treatment Regimes.” Proceedings of machine learning research vol. 252 (2024): https://proceedings.mlr.press/v252/xiong24a.html.

Dear Reviewer w5rU,

As the discussion period is drawing to a close, we wanted to ask if you had a chance to take a look at our response. We've presented additional comparisons against state-of-the-art causal transformer baselines such as the cited Causal Transformer, G-Transformer, NCMs, clarified the Thm. 4 wording, and elaborated on the effect of the token isolation and removal of cross-positional connections as requested.

We would be happy to engage further and clarify any concerns that might remain, but would appreciate you re-assessing our work in the light of the additional evidence and support provided in the rebuttal and the updated manuscript.

Thanks for your time and effort.

Reviewer_w5rUOpenReview ↗

Response to rebuttal

I thank the authors for their thorough review and clarification. Adapting the baslines to your scenario provides an effective comparison. I will raise my score.

Reviewer_HjBaOpenReview ↗
Rating
3
Confidence
2
Informativeness
2
Presentation
3
Soundness
3
Read review
Paper summary

This paper proposes CaLM, a Transformer architecture for counterfactual trajectory simulation. Given a causal graph, the model restricts information flow so that each variable depends only on its causal parents and designated latent variables. The observed trajectory is used to infer these latent variables, which are then kept fixed when simulating an intervention. The authors also establish a counterfactual coverage result for the class of CaLM models that fit the observational distribution.

The reported results are encouraging across five simulated domains and several model sizes, including extensions to pretrained language models. However, the empirical interval construction differs from the one characterized by the coverage theorem, and some important details of the counterfactual inference procedure remain unclear.

Critical strengths
  1. I find the architectural contribution interesting and well motivated. The paper clearly explains why restricting attention to parents is insufficient across multiple Transformer layers, and proposes a construction that enforces the intended dependencies.

  2. The experimental evaluation is broad, covering several domains, model sizes, and pretrained language models. The random-sparse baseline is also a useful control, since it helps distinguish the effect of the chosen causal restrictions from that of sparsity alone.

  3. The model is trained using observational trajectories, with interventions introduced only during evaluation. This makes the reported counterfactual improvements particularly interesting.

Critical weaknesses
  1. The practical relevance of the coverage theorem is not sufficiently demonstrated. Appendix D.9 constructs intervals by selecting perturbed models whose predictions are closest to the known ground truth, without requiring them to preserve observational fit. As the authors acknowledge, this does not implement Eq. (6) or inherit Theorem 6. The point-prediction results remain encouraging, but this experiment does not establish that useful counterfactual bounds can be obtained in practice.

  2. Some essential implementation details are unclear. Algorithm 2 requires samples from the posterior over exogenous variables, but I could not determine which inference procedure was used, how many samples were drawn, or how the approximation was assessed. For the pretrained language models, it is also unclear how natural-language trajectories are mapped to the token construction in Definition 5. These details matter for assessing whether the experiments implement the proposed method and understanding its computational cost.

Questions for authors
  1. How was the posterior over exogenous variables computed in the experiments? Could you specify the inference procedure, the number of samples, and its computational cost, particularly for the pretrained language models?

  2. Could you clarify how the natural-language trajectories are represented using the value, computation, and readout tokens of Definition 5?

  3. Could you provide an evaluation of the bounds obtained through Eq. (6), without using the ground-truth counterfactual value to select models? Even a small example with known identification bounds would help connect the theoretical result to the practical method.

4 comments
AuthorsOpenReview ↗

Author Response [1/3]

We are grateful to the reviewer for their positive comments and insightful questions.

Response to W1, Q3.

The practical relevance of the coverage theorem … evaluation of the bounds … connect the theoretical result to the practical method.

Expanding on App. D.9 Approach. This is a sharp observation and we elaborate on our approach. The intervals in App. D.9 are not counterfactual bounds, and are not meant to be interpreted as such. Note that counterfactual bounds are well-defined w.r.t. a model class, not a single fitted model. In this section, we fine-tuned only a single instance of CaLM and the baseline, and we emphasized that counterfactual coverage is not the intended property in this particular evaluation. The ground truth counterfactual quantity is not identifiable from any amount of observational data. Note that the true counterfactual bounds are not available either, and this complicates an evaluation based on a single instance from a model class. Therefore, we used a proxy evaluation metric as described in the App. D.9 and rephrased below.

We probe the neighborhood of a fitted model’s parameter and construct a “prediction/robustness interval” for the counterfactual quantity, for each of CaLM and baseline instances. In particular, we perturb the parameter with additive small-scale gaussian noise, and selecting candidates that have better counterfactual quantity accuracy among these perturbations. Next, we take the interval that contains the counterfactual quantities corresponding to the selected candidates. Ideally, this interval would include the true counterfactual or miss it by only a small margin. We measure the distance of the true value from the interval (zero if included inside it), and interpret this metric as a proxy for counterfactual alignment/adaptability of the model class (CaLM vs baseline), localized at a single fitted instance from the model class. We used this check because the tight bounds have no closed form in that setting and the trajectory simulation is to generate data samples not recover the bound.

CaLM recovering Known Identification Bounds. On the other hand, we incorporate the reviewer’s suggestion and show that following the exact inf/sup procedure in Eq. (6), CaLM is capable of recovering the bound. App. G in the updated manuscript includes bounding results obtained with CaLM using Eq. (6) in two settings: (1) Bow, (2) PS. In every setting, all variables are binary and only the data sampled from the observational distribution P(V)P(\mathbf{V}) is given. The target query in (1) is the interventional distribution P(y∣do(x))P(y \mid do(x)) given the bow graph (X→Y,X↔YX\rightarrow Y, X\leftrightarrow Y); the target query in (2) is the counterfactual query, probability of sufficiency PS=P(yx∣x′,y′)\mathrm{PS} = P(y_x \mid x', y'). In both of the settings, the query is not identifiable from P(V)P(\mathbf{V}), but tight bounds can be computed from P(V)P(\mathbf{V}) in closed form [1, 2]. The following table lists the causal diagram, the target query and the theoretical bounds of each setting.

SettingCausal diagramTarget queryTheoretical bounds
(1) BowX→Y, X↔YX\rightarrow Y,\ X\leftrightarrow YP(y∣do(x))P(y \mid do(x))P(x,y)≤P(y∣do(x))≤P(x,y)+1−P(x)P(x,y) \le P(y \mid do(x)) \le P(x,y) + 1 - P(x)
(2) PSX→YX\rightarrow YP(yx∣x′,y′)P(y_x \mid x', y')max⁡{0, P(y∣x)−P(y∣x′)P(y′∣x′)}≤P(yx∣x′,y′)≤min⁡{1, P(y∣x)P(y′∣x′)}\max\{0,\ \frac{P(y \mid x) - P(y \mid x')}{P(y' \mid x')}\} \le P(y_x \mid x', y') \le \min\{1,\ \frac{P(y \mid x)}{P(y' \mid x')}\}

For each setting, we randomly sample 20 SCMs inducing the corresponding graphs as ground-truth SCMs. We draw 10k samples from each ground-truth SCM, run CaLM and NCM (as a baseline) on each dataset to obtain the lower bound and the upper bound in the same way as [3]. The full experimental setting details are discussed in the App. G. The results are shown in Tab. 4 from App. G. reproduced below, and please refer to other experimental details and bound visualization in Fig. 17 in App. G.

SettingMethodBound MAECoverage of boundsCovers truth (%)
(1) BowNCM0.0031.00100%
CaLM0.0090.9695%
(2) PSNCM0.2250.015%
CaLM0.0150.98100%

Tab. 4 reports three metrics comparing the estimated bound with the ground-truth theoretical bounds. Bound MAE illustrates the mean absolute error of the lower bound and upper bound; Coverage of bounds illustrates the fraction of the theoretical interval that CaLM's interval covers. Covers truth (%) the share of SCMs whose interval contains the true value.

AuthorsOpenReview ↗

Author Response [2/3]

To illustrate, NCM and CaLM both recover the bound of the interventional query P(y∣do(x))P(y \mid do(x)) with the bow setting (1). CaLM also recovers the bound for the counterfactual quantity in the PS setting (2) while the baseline NCM fails to recover it. CaLM achieves 0.98 coverage of the ground truth bound while NCM nearly collapses to a single point (the coverage is only 0.01). This shows CaLM’s ability to recover the bounds, thus connecting the theoretical result to the practical method, as requested.

Response to W2.1, Q1.

Some essential implementation details …

Expanding on the posterior inference. We appreciate the reviewer for bringing this to our attention, and we acknowledge that clarification is needed, and we included more elaboration in the paper, Line 287 to Line 305, on page 6. As mentioned in the paper, rejection-sampling and posterior modeling are conventional choices for the posterior step, and in CaLM we used the same transformer architecture as a posterior sampler. In particular, the unobserved variables UU are placed in the context, preceding the observable variables ZZ, which are followed by a posterior sampler U~\tilde{U} restricted to only attending ZZ. We train for conventional next-token prediction loss, to reconstruct U~\tilde{U} from UU. As we train the model to fit the observational data, the Z→U~Z \rightarrow \tilde{U} segment learns a posterior sampler with negligible cost. The sampler adds no separate network or training stage. The algorithms in the appendix digressed the specifics of implementation for sake of generality, and to maintain coherence with the notation/conventions introduced in the theory section. At inference, U~\tilde{U} is decoded from ZZ as the approximation of UU fed into the counterfactual world.

Number of samples and accuracy. We use N={16,64,256}N = \{16, 64, 256\} for sampling in the abduction steps. We can therefore compare the sampler with the exact model posterior. Results are over 5 training seeds, with 1000 repeated runs of the estimator per query. Both metrics are computed per query and averaged with equal weight over queries. The sampler’s approximation error is as follows: TV(q,p)=0.25–0.29\text{TV}(q, p) = 0.25\text{–}0.29, and KL(p∥q)=0.26–0.32\text{KL}(p \parallel q) = 0.26\text{–}0.32 nats. Abduction still lowers the counterfactual error. At Tier S it falls from 0.2410.241 to 0.0770.077 (95% CI of the gain: [0.143,0.178][0.143, 0.178]). The error decreases monotonically in NN and approaches the N→∞N \rightarrow \infty limit from above. The remaining error comes from qq, not Monte Carlo noise. The induced error ∣Pq−P⋆∣=∣∑u(q−p)1{Yx(u)=y}∣|P_q - P^\star| = \left|\sum_{\mathbf{u}}(q - p)\mathbf{1}\{Y_x(\mathbf{u})=y\}\right| is bounded by TV\text{TV}, and is much smaller when the misplaced mass falls on values of u\mathbf{u} with the same outcome. Empirically it is 20–3120\text{–}31\\% of TV\text{TV} and never exceeds it. The sampler is approximate, but it shifts mass in the direction that matters for the query, which is enough to cut the no-abduction error by about two thirds at Tier S.

Computational cost. Alg. 1 trains the auxiliary variables U~\tilde{U} in the same teacher-forced forward pass as the mechanisms, so no separate network or training stage is needed. In Alg. 2, all NN draws run as one batch. Drawing uu from U~\tilde{U} takes one forward pass per exogenous variable. Prediction takes one pass per decoded variable, and the clamped intervention takes none. The number of passes therefore does not depend on NN; NN only sets the batch size. Because the rollout under a fixed uu is deterministic, repeated draws need to be decoded only once.

At N=64N = 64 on one H100:

  • Sepsis Tier M: 3.4 s per query and 881 MiB. Abduction takes 0.12 s of this (4%).
  • Mistral-7B / Llama-3-8B: 6.0 s / 4.9 s per query and 26 / 31 GiB. Abduction takes 1.0 s / 0.8 s of this (17%).
AuthorsOpenReview ↗

Author Response [3/3]

Response to W2.2, Q2.

… natural-language trajectories …

In the natural-language experiments in Appendix D.8, each causal variable represents a semantically defined text span that contains multiple text tokens. To illustrate, ViV_i represents the examination description at hour ii, while AiA_i represents the corresponding treatment-order description. The causal graph includes the edge Vi→AiV_i \rightarrow A_i.

For example, as shown in App. D.8, V1=V_1 = *[HOUR_1_EXAM] Patient remains hypotensive with persistent tachycardia. MAP 57.8 mmHg, HR 107.9 bpm. Lactate elevated at 4.61 mmol/L. Peripheral perfusion poor with delayed capillary refill (>3s). [/HOUR_1_EXAM]* and A1=A_1= *[HOUR_1_ORDER] Initiate Norepinephrine infusion at 0.08 mcg/kg/min; infuse 500 mL Lactated Ringer’s bolus. [/HOUR_1_ORDER]*

As described in Def. (5), each individual variable has its own corresponding value, computation and readout tokens. Suppose variable ViV_i contains mm text tokens. The value tokens are exactly identical to these mm text tokens; The computation tokens (and also readout tokens) are mm learnable representations that precede the value tokens. To encode the structure Vi→AiV_i \rightarrow A_i, every mm computation tokens of AiA_i attend to every mm value tokens of ViV_i. In other words, the value tokens, computation tokens and the readout tokens can be extended to a set practically.

We hope the above clarifications and results satisfactorily answer the reviewers questions.

[1] Pearl, Judea. Causality. Cambridge university press, 2009.
[2] Tian, Jin, and Judea Pearl. "Probabilities of causation: Bounds and identification." Annals of Mathematics and Artificial Intelligence 28.1 (2000): 287-313.
[3] Xia, Kevin, et al. "The causal-neural connection: Expressiveness, learnability, and inference." Advances in Neural Information Processing Systems 34 (2021): 10823-10836.

Dear Reviewer HjBa,

As the discussion period is drawing to a close, we wanted to ask if you had a chance to take a look at our response. We've presented additional results on known intervention bounds to connect the theoretical result to the practical method and expanded on the essential implementation details like the posterior inference and the natural language trajectories as requested.

We would be happy to engage further and clarify any concerns that might remain, but would appreciate you re-assessing our work in the light of the additional evidence and support provided in the rebuttal and the updated manuscript.

Thanks for your time and effort.

Comments on the paper

1 comment
AuthorsOpenReview ↗

Overall Author Response

We thank the reviewers for their thoughtful comments and suggestions.

We appreciate that Reviewer jhV7 enjoyed reading the paper and found our proposed approach "elegant and supportive of counterfactual semantics". Reviewer w5rU’s comments, remarking that our treatment of contextual representation leakage is "rigorous" and noting the "theoretical groundedness and diverse applicability", reaffirm the concrete and consistent advantage of CaLM compared to other baselines. Reviewer HjBa also finds the "architectural innovation interesting", and appreciates the "broad experimental evaluations" and the "counterfactual improvements using only the observational trajectories."

Thus, we are grateful that the reviewers find our proposed method innovative and backed by theoretical rigor and comprehensive empirical results. We hope our detailed responses to the reviewers, and the updated manuscript (changes in blue), and additional appendices G, H and I have answered their questions and doubts, and are happy to engage with constructive feedback throughout the discussion period to improve our paper.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.