Causal Discovery and Inference through Next-Token Prediction
Eivinas Butkus, Nikolaus Kriegeskorte
Abstract
Deep neural networks have been criticized as fundamentally statistical systems that fail to capture causal structure and perform causal reasoning. Here we demonstrate that a GPT-style transformer trained for next-token prediction can simultaneously discover instances of linear Gaussian structural causal models (SCMs) and learn to answer counterfactual queries about those SCMs. First, we show that the network generalizes to counterfactual queries about SCMs for which it has seen interventional data but not any examples of counterfactual inference. The network must, thus, have successfully composed discovered causal structures with a learned counterfactual inference algorithm. Second, we decode the implicit "mental" SCM from the network's residual stream activations and manipulate it using gradient descent with predictable effects on the network's output. Our results suggest that statistical prediction may be sufficient to drive the emergence of internal causal models and causal inference capacities in deep neural networks.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 903fd190-8fc4-4c77-926c-9f5af1acdda6Builds on16
- Zero-Shot Text-to-Image GenerationAditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray et al.ICML 2021 · 6,356 citations
- Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
- Causal Abstractions of Neural NetworksAtticus Geiger, Hanson Lu, Thomas Icard, Christopher PottsNeurIPS 2021 · 516 citations
- Deep Structural Causal Models for Tractable Counterfactual InferenceNick Pawlowski, Daniel Coelho de Castro, Ben GlockerNeurIPS 2020 · 353 citations
- Does Localization Inform Editing? Surprising Differences in Causality-Based Localization vs. Knowledge Editing in Language ModelsPeter Hase, Mohit Bansal, Been Kim, Asma GhandehariounNeurIPS 2023 · 307 citations
Related papers
- A Causal World Model Underlying Next Token Prediction: Exploring GPT in a Controlled EnvironmentRaanan Yehezkel Rohekar, Yaniv Gurwicz, Sungduk Yu, Estelle Aflalo et al.ICML 2025
- Neural Causal Models for Counterfactual Identification and EstimationKevin Muyuan Xia, Yushu Pan, Elias BareinboimICLR 2023 · 3 citations
- High Fidelity Image Counterfactuals with Probabilistic Causal ModelsFabio De Sousa Ribeiro, Tian Xia, Miguel Monteiro, Nick Pawlowski et al.ICML 2023 · 68 citations
- Causally Consistent Normalizing FlowQingyang Zhou, Kangjie Lu, Meng XuAAAI 2025
- From Black-box to Causal-box: Towards Building More Interpretable ModelsInwoo Hwang, Yushu Pan, Elias BareinboimNeurIPS 2025 · 3 citations
