Observational data alone usually cannot settle which way a causal arrow points. A causal discovery algorithm returns a family of equally good graphs that share the same connections but disagree on the direction of some edges. A popular recent fix is to ask a large language model which direction is plausible, for example "does Raf activate Mek, or the reverse?", and to use its answers as prior beliefs in a Bayesian structure learner. That fix has a validity problem. The standard test graphs, such as the Sachs protein-signaling network or the Asia network, are almost certainly in the model's training data. So a correct answer may only show that the model recalled a famous figure, and it may not show that it understood the biochemistry. A wrong answer may also come from a paraphrase that the model happens to handle badly.
We propose a two-sided test of whether a language model's causal prior reflects domain mechanism. The first side checks that the model's answer stays the same under rewrites that keep the meaning, such as synonyms, renamed variables described by function, or restructured sentences. The second side checks that the answer changes correctly under small edits that change the mechanism while keeping the observational data indistinguishable. The second side is built from what we call counterfactual twins: pairs of graphs that sit in the same equivalence class, differ only in one reversible edge, and differ in their text only by a mechanism-level description of that edge. Data cannot tell twins apart and memory cannot either. Only reading and applying the described mechanism can. We use this test to evaluate priors. We also use it to construct them: the model is allowed to orient only the edges the data leave ambiguous, and each of its votes is weighted by how well it passes both sides of the test.
Core Claim
Agreement across prompts is the best current reliability signal for language-model causal judgments. From Causal Plausibility to Causal Reliability evaluated 12 open models on six CausalGraphBench graphs and found that cross-prompt agreement is better calibrated than logits or verbalized confidence. Our first claim is that agreement is only half a test. A model that has memorized the canonical Sachs graph will agree with itself perfectly across paraphrases, because recall is robust to paraphrase. Agreement therefore rewards contamination. The missing half is counterfactual sensitivity: when the text says the mechanism differs, the answer should differ.
Our second claim is practical. Suppose a prior is restricted to the edges that are undirected in the equivalence class, and is scored by invariance plus counterfactual sensitivity. On data-ambiguous edges, such a prior should beat both an agreement-weighted prior and a purely data-driven learner. It should also avoid the damage that over-eager edge prediction does to structure recovery.
To make the score concrete, consider an undirected edge $e = X - Y$. Let $\bar{p}_e$ be the fraction of meaning-preserving rewrites in which the model answers $X \to Y$. Let $\bar{q}_e$ be the fraction of mechanism-reversing edits in which the model correctly answers $Y \to X$, measured only after removing the rate $r_e$ at which it flips under irrelevant edits that merely mention a reversal. The orientation confidence is
$$ s_e = \big|2\bar{p}_e - 1\big| \cdot \max(0,\ \bar{q}_e - r_e), $$
where the first factor rewards a stable direction and the second rewards responding to mechanism rather than to surface cues.
What Prior Work Establishes and Leaves Open
Two papers show that language-model priors can help structure learning, and both flag contamination without measuring it. Large Language Models as Tools to Improve Bayesian Causal Discovery feeds GPT-4 and DeepSeek-V3 pairwise judgments into the differentiable Bayesian structure learner DiBS. It reports better expected structural Hamming distance and better AUROC on Sachs, MAGIC-NIAB and Summer. The authors themselves note that Sachs is likely overrepresented in pretraining data. CausalGraphBench audits 35 graphs and finds that contamination substantially lowers Structural Hamming Distance (SHD) on small graphs. In other words, it makes models look better.
These papers motivate our test, and the next two constrain the design. The Causal Reliability paper finds that models are "recall-dominant." They called 36.0% of reversed relations and 40.0% of indirect relations direct edges, and assigned confidence of 80% or more to over 80% of their false positives. This is why we never let the model add edges and confine it to the orientation step. Work on semantic robustness supplies the perturbation method and also warns about it. POSIX quantifies how output likelihoods shift across 60 intent-preserving prompt variants, and finds that instruction tuning can increase this sensitivity. UPHILL shows that models accept false presuppositions in health queries. This second finding is the reason for the irrelevant-edit correction $r_e$: a model that flips whenever any text mentions a reversal is being sycophantic, not reading the mechanism.
PEARL is the closest precedent for using perturbation to detect memorization. It assumes that memorized outputs are brittle under character-level noise. Our setting predicts the opposite: a memorized causal graph should be robust to paraphrase and insensitive to mechanism edits. This is why a one-sided brittleness test cannot detect contamination here.
DyVal generates fresh DAG-structured reasoning problems to avoid leakage, but only for arithmetic, logic and reachability. Our twins are a dynamic, domain-grounded counterpart: each new twin is a new item that no corpus contains. TheoremQA finds that giving models the relevant theorem does not fix their failures, because the bottleneck is applying the theorem, not recalling it. The twins test exactly this: the edited mechanism is stated in the text, and the model must apply it to orient the edge.
Research Program
The pipeline starts from observational data. It runs PC, or GES as a check, to obtain the equivalence class, written as a partially directed graph. The data have already oriented every v-structure, so the language model is queried only about the remaining undirected edges.
For each undirected edge we build a query family with two halves. The meaning-preserving half contains the following rewrites:
- lexical rewrites, such as clinical or biochemical synonyms and lower-frequency terms, following Leidinger et al.'s frequency-controlled substitution;
- anonymized variables described only by function;
- declarative versus interrogative framings;
- swapped orders of the two variables.
The mechanism-edit half contains short, domain-specific statements that reverse the arrow if true. An example for Sachs is "in this engineered line, PKA expression is driven by a reporter downstream of Erk." This half also contains matched irrelevant edits that use the same reversal vocabulary about a different relation, which supply the estimate of $r_e$.
The edge scores $s_e$ become a soft prior over directions within the equivalence class. We pass this prior to DiBS, and we also run a hard-orientation variant. The hard variant orients edges with $s_e$ above a threshold, propagates the implied directions with Meek's rules, and abstains on the rest.
The twin benchmark is built from the graph structure. For each benchmark graph we find covered edges: edges whose two endpoints have the same parents apart from each other. Reversing a covered edge leaves the equivalence class unchanged, which is a standard result. For each covered edge, the original graph $G$ and its twin $G'$ get identical observational data distributions, simulated from structural models fitted to each graph. Their variable documentation is identical except for a mechanism paragraph describing the edited direction. Domain experts write and vet the edit paragraphs for Sachs (signaling), Hepar2 (hepatology), Coal Gasifier (process engineering) and COVID.
Because twins can be regenerated with new edits and renamings, the benchmark cannot leak in the way a static benchmark can. Contamination becomes measurable as a twin-flip failure rate: how often the model gives the canonical direction on $G'$ even though the text describes the reversed mechanism.
Baselines
The naive reference point is purely data-driven. It uses DiBS with its default uninformative graph prior, plus a nonlinear additive-noise orientation of undirected edges on the small graphs where that method is tractable. Additive-noise orientation, from Nonlinear causal discovery with additive noise models, fits a regression in each direction and tests whether the residual is independent of the input. On twins, this baseline should score at chance by construction, since the twins share a distribution. This fixes the floor.
The second baseline is the full-adjacency language-model prior of Large Language Models as Tools to Improve Bayesian Causal Discovery: Monte Carlo pairwise queries become a probabilistic adjacency matrix used inside DiBS. It is the published system for exactly this use. We rerun it with the same models, the same DiBS settings, the same samples and the same random seeds. No reported result was found on Lacuna for its numeric E-SHD or AUROC on Sachs, MAGIC-NIAB or Summer, since the paper reports only qualitative improvements. We therefore regenerate its numbers ourselves.
The strongest competitor is an agreement-weighted prior, following From Causal Plausibility to Causal Reliability. Each edge is weighted by agreement across prompts, and nothing else. This baseline gets the same total number of model queries as our method, so its budget of paraphrases equals our meaning-preserving and edited queries combined. That paper's reported figures are F1 of about 0.30 on the smallest graphs, falling to 0.031 on Munin1, with 36.0% of reversed relations misclassified as direct. For whole-graph generation by language models, CausalGraphBench reports a normalized SHD of 0.65 for GPT-4o on graphs of up to 10 nodes.
To beat these baselines, our prior must meet two conditions on twin edges and on held-out undirected edges, using the same models and query budget:
- its orientation accuracy must be higher by a margin outside bootstrap confidence intervals;
- its expected calibration error must be lower.
It must also not be worse than the full-adjacency prior on the canonical graphs.
Two ablations isolate the key ingredients. The first removes the sensitivity factor, which leaves agreement alone and is equivalent to the third baseline. The second lifts the restriction to undirected edges, which leaves our scoring applied to the full adjacency matrix. A third ablation removes the irrelevant-edit correction $r_e$, which tests whether apparent sensitivity is only sycophancy.
Why not just…?
Why not just use cross-prompt agreement, which already calibrates well? This is the real threat. On canonical graphs, agreement may match our score, because the memorized answer there is also correct. The twins are the experiment that settles the question. A memorizing model agrees with itself on $G'$ and is consistently wrong there. We predict that agreement-weighted accuracy on twins falls toward or below chance, while our score keeps its accuracy. If agreement holds up on twins as well, the sensitivity factor adds nothing, and we will report that.
Why not just anonymize variable names to remove contamination? Anonymization removes the domain knowledge that justifies using a language model in the first place. Anonymized descriptions are included as one of the meaning-preserving rewrites. Comparing named, described-only and fully anonymized conditions measures how much of the prior's accuracy is name recall. We expect a large drop for fully anonymized variables on Sachs and AsiaM, consistent with the contamination effect found in CausalGraphBench.
Why not just let the data orient the edges, with additive-noise models or interventions? Within an equivalence class, linear-Gaussian data carry no directional signal. On twins, data carry none by construction. Additive-noise methods need correct nonlinear-plus-additive-noise assumptions and do not scale beyond small graphs. Interventions are often unavailable. The data-only baseline sits in every table, so any regime where it wins, such as clearly nonlinear small graphs, will be visible.
Why not just filter edges by the model's own confidence? The Causal Reliability study found over 80% of false-positive edges labeled with 80% or higher confidence, and found that logits collapse near certainty. We include verbalized-confidence weighting as an extra row, but expect it to trail agreement.
Proposed Experiments
The first experiment is the twin test. It covers every covered edge in AsiaM, Sachs, Hepar2, Coal Gasifier and COVID, with five independent renamings and edit paraphrases per twin. It is run on open models from 7B to 72B parameters and on one API model. The outcome we report is the twin-flip failure rate under each scoring rule, with Summer, the less-established synthetic graph, as a low-contamination comparison.
The decisive check is a crossing pattern. On canonical graphs, agreement and our score should perform similarly. On twins, they should diverge, with the size of the gap tracking independent contamination evidence. We measure that evidence with Min-K% Prob on the graph documentation, as used for CausalProbe-2024 in Unveiling Causal Reasoning in Large Language Models: Reality or Mirage?.
The second experiment runs full structure learning on Sachs and MAGIC-NIAB, and on observational samples of 100, 500 and 2,000 from simulated structural models of Hepar2. We report expected SHD, AUROC, and orientation accuracy restricted to edges that were undirected in the equivalence class. This tests whether restricting the prior avoids the false-edge damage that the recall-dominance findings predict for the full-adjacency prior.
The third experiment is a sensitivity sanity check. If removing $r_e$ substantially increases the measured counterfactual sensitivity, then much of the apparent mechanism-reading is presupposition-following. We would then tighten the irrelevant-edit controls before trusting any other result.
References
- From Causal Plausibility to Causal Reliability: Evaluating LLMs as Calibrated Direct Causal-Edge Classifiers
- Large Language Models as Tools to Improve Bayesian Causal Discovery
- CausalGraphBench: a Benchmark for Evaluating Language Models capabilities of Causal Graph discovery
- POSIX: A Prompt Sensitivity Index For Large Language Models
- Evaluating Large Language Models for Health-related Queries with Presuppositions
- Memorization or Interpolation ? Detecting LLM Memorization through Input Perturbation Analysis
- DyVal: Dynamic Evaluation of Large Language Models for Reasoning Tasks
- TheoremQA: A Theorem-driven Question Answering Dataset
- Nonlinear causal discovery with additive noise models
- Unveiling Causal Reasoning in Large Language Models: Reality or Mirage?