Imai, Kosuke and Kentaro Nakamura. ``Causal Inference with Generative Artificial Intelligence: Application to Texts as Treatments.'' Journal of the American Statistical Association, Forthcoming.

Abstract

In this paper, we demonstrate how to enhance the validity of causal inference with unstructured high-dimensional treatments like texts, by leveraging the power of generative Artificial Intelligence. Specifically, we propose to use a deep generative model such as large language models (LLMs) to efficiently generate treatments and use their internal representation for subsequent causal effect estimation. We show that the knowledge of this true internal representation helps disentangle the treatment features of interest, such as specific sentiments and certain topics, from other possibly unknown confounding features. Unlike existing methods, our proposed approach eliminates the need to learn causal representation from the data, and hence produces more accurate and efficient estimates. We formally establish the conditions required for the nonparametric identification of the average treatment effect, propose an estimation strategy that avoids the violation of the overlap assumption, and derive the asymptotic properties of the proposed estimator through the application of double machine learning. Finally, using an instrumental variables approach, we extend the proposed methodology to the settings in which the treatment feature is based on human perception rather than is assumed to be fixed given the treatment object. The proposed methodology is also applicable to text reuse where an LLM is used to regenerate existing texts. We conduct simulation and empirical studies, using the generated text data from an open-source LLM, Llama 3, to illustrate the advantages of our estimator over state-of-the-art causal representation learning algorithms.

Replication Archive

Software

gpi: Gen-AI Powered Inference — GitHub / PyPI

Related Papers

Imai, Kosuke and Kentaro Nakamura (2026). ``Leveraging generative AI for causal inference with unstructured data.'' Proceedings of the National Academy of Sciences, Vol. 123, No. 36, e2530532123.
Nakamura, Kentaro, Adam Breuer, Michael H. Crespin, Bryce J. Dietrich, and Kosuke Imai (2026). ``Causal Inference with Video Features as Treatments.''
Nakamura, Kentaro and Kosuke Imai (2026). ``GenAI Powered Dynamic Causal Inference with Unstructured Data.''
Dasanaike, Noah and Kosuke Imai (2026). ``Using Embedding Models to Improve Probabilistic Race Prediction.''
Shi, Wenqi, Kosuke Imai, and Yi Zhang (2026). ``Privacy-preserving Meta-analysis through Low-Rank Basis Hunting.''
Breuer, Adam, Bryce J. Dietrich, Michael H. Crespin, Matthew Butler, J.A. Pyrse, Kosuke Imai (2025). ``Using AI to Summarize US Presidential Campaign TV Advertisement Videos, 1952-2012.'' Scientific Data, Vol. 12, No. 1552.
Goplerud, Max, Kosuke Imai, Nicole E. Pashley (2025). ``Estimating Heterogeneous Causal Effects of High-Dimensional Treatments: Application to Conjoint Analysis.'' Annals of Applied Statistics, Vol. 19, No. 2 (June), pp. 866-888.
Imai, Kosuke and Michael Lingzhi Li (2025). ``Statistical Inference for Heterogeneous Treatment Effects Discovered by Generic Machine Learning in Randomized Experiments.'' Journal of Business & Economic Statistics, Vol. 43, No. 1, pp. 256-268.
Jia, Zeyang, Kosuke Imai, and Michael Lingzhi Li (2025). ``Cramming Contextual Bandits for On-policy Statistical Evaluation.''
Ham, Dae Woong, Kosuke Imai, and Lucas Janson (2024). ``Using Machine Learning to Test Causal Hypotheses in Conjoint Analysis.'' Political Analysis, Vol. 32, No. 3 (July), pp. 329-344.
Li, Michael Lingzhi and Kosuke Imai (2024). ``Neyman Meets Causal Machine Learning: Experimental Evaluation of Individualized Treatment Rules.'' Journal of Causal Inference, Vol 12, No. 1, pp. 1-20. Special Issue on Neyman (1923) and its influences on causal inference
Eshima, Shusei, Kosuke Imai, and Tomoya Sasaki (2024). ``Keyword-Assisted Topic Models.'' American Journal of Political Science, Vol. 68, No. 2 (April), pp. 730-750.
Tarr, Alexander, June Hwang, and Kosuke Imai (2023). ``Automated Coding of Political Campaign Advertisement Videos: An Empirical Validation Study.'' Political Analysis, Vol. 31, No. 4 (October), pp. 554-574.
Imai, Kosuke and Michael Lingzhi Li (2023). ``Experimental Evaluation of Individualized Treatment Rules.'' Journal of the American Statistical Association, Vol. 118, No. 541, pp. 242-256.
Ning, Yang, Sida Peng, and Kosuke Imai (2020). ``Robust Estimation of Causal Effects via High-Dimensional Covariate Balancing Propensity Score.'' Biometrika, Vol. 107, No. 3 (September), pp. 533-554.
Kim, In Song, Steven Liao, and Kosuke Imai (2020). ``Measuring Trade Profile with Granular Product-level Trade Data.'' American Journal of Political Science, Vol. 64, No. 1 (January), pp. 102-117.
Egami, Naoki, and Kosuke Imai (2019). ``Causal Interaction in Factorial Experiments: Application to Conjoint Analysis.'' Journal of the American Statistical Association, Vol. 114, No. 526 (June), pp. 529-540.
Svyatkovskiy, Alexey, Kosuke Imai, Mary Kroeger, and Yuki Shiraito (2016). ``Large-scale text processing pipeline with Apache Spark.'' IEEE International Conference on Big Data, Washington, DC, pp. 3928-3935.
Imai, Kosuke and Marc Ratkovic (2013). ``Estimating Treatment Effect Heterogeneity in Randomized Program Evaluation.'' Annals of Applied Statistics, Vol. 7, No. 1 (March), pp. 443-470. Winner of the Tom Ten Have Memorial Award. Reprinted in Advances in Political Methodology, R. Franzese, Jr. ed., Edward Elger, 2017.
Imai, Kosuke, and Aaron Strauss (2011). ``Estimation of Heterogeneous Treatment Effects from Randomized Experiments, with Application to the Optimal Planning of the Get-out-the-vote Campaign.'' Political Analysis, Vol. 19, No. 1 (Winter), pp. 1-19. Winner of Political Analysis Editors' Choice Award.
© Kosuke Imai