LLM-Driven Treatment Effect Estimation Under Inference Time Text Confounding

Yuchen Ma, Dennis Frauen, Jonas Schweisthal, Stefan Feuerriegel · DOI

Abstract

Estimating Conditional Average Treatment Effects (CATE) is a cornerstone of personalized medicine. However, a significant gap exists between the structured data available during model training and the unstructured, self-reported text encountered at inference time. This paper presents Text Confounding Adjustment (TCA), a three-stage framework that leverages Large Language Models (LLMs) to bridge this gap. By decoupling causal estimation from textual adaptation, TCA generates unbiased treatment effect estimates from messy patient narratives. Experiments on the International Stroke Trial (IST) and MIMIC-III datasets demonstrate that TCA reduces estimation error by up to 40% compared to standard text-based baselines.

1. Introduction

In clinical decision support, the goal is often to determine the optimal treatment for an individual patient by estimating the Conditional Average Treatment Effect (CATE). Accurate CATE estimation requires adjusting for confounders—variables like age, blood pressure, or pre-existing conditions that influence both the treatment choice and the eventual outcome. While researchers often have access to high-fidelity, structured clinical registries for training, real-world deployment (e.g., in telemedicine or patient-facing chatbots) often provides only unstructured text descriptions. This phenomenon, termed Inference Time Text Confounding, introduces significant bias if the model cannot adequately recover the underlying confounding information from the text.

2. Methodology: The TCA Framework

The proposed Text Confounding Adjustment (TCA) framework addresses this challenge by separating the task of causal inference from the task of natural language understanding. The framework operates in three distinct stages:

2.1 Stage 1: Nuisance Estimation and Pseudo-Outcomes

The process begins with the "gold standard" structured training data ($X$). To ensure robustness, the authors employ a Doubly Robust (DR) learner. This method estimates both the propensity score (probability of treatment) and the outcome model. By combining these, it generates "pseudo-outcomes" that serve as unbiased targets for the treatment effect, even if one of the underlying models is slightly misspecified.

2.2 Stage 2: LLM-Based Synthetic Text Generation

A primary hurdle in training models for inference-time text is the lack of paired structured-text data. TCA overcomes this by using an LLM (specifically GPT-4o mini) as a semantic generator. The LLM transforms structured patient records into realistic natural language narratives, such as symptom descriptions or patient histories. This creates a synthetic training environment that mirrors the "messy" data the model will encounter in practice.

2.3 Stage 3: Text-Conditioned Regression

In the final stage, a regression model (utilizing BERT embeddings) is trained to map the synthetic text generated in Stage 2 to the high-quality pseudo-outcomes calculated in Stage 1. By training the model to "see through" the text to the underlying treatment effect, TCA ensures that the final estimate remains unbiased at inference time.

3. Empirical Evaluation

The framework was evaluated using semi-synthetic versions of two major medical datasets: the International Stroke Trial (IST), involving over 19,000 patients, and the MIMIC-III database from critical care units. These datasets allowed the authors to simulate varying degrees of confounding strength and evaluate performance against ground-truth causal effects.

3.1 Performance Results

The primary metric for evaluation was the Precision of Estimating Heterogeneous Effects (PEHE). TCA demonstrated superior performance over "naïve" baselines that attempt to learn treatment effects directly from text without the decoupling strategy:

  • IST Dataset: TCA achieved an approximately 40% reduction in PEHE.
  • MIMIC-III Dataset: TCA achieved an approximately 35% reduction in PEHE.

Performance gains were consistent across different demographic subgroups (age and gender), suggesting that the LLM-based text generation did not introduce significant new biases. Furthermore, as the "hidden" confounding information became more influential, the performance gap between TCA and the baselines widened, proving TCA's effectiveness at capturing latent information.

4. Key Insights

The study highlights that LLMs are most effective when used as semantically rich generators rather than direct causal reasoners. By using the LLM to bridge the modality gap, TCA preserves the mathematical rigor of traditional causal inference while benefiting from the linguistic flexibility of modern transformers. Furthermore, the framework showed high resilience to different prompting styles, maintaining accuracy whether the input was a formal summary or a colloquial patient complaint.

5. Discussion and Limitations

While TCA represents a significant step forward, several areas for future research remain. The framework's success is contingent on the faithfulness of the LLM; any hallucinations or omissions of critical clinical details during the text generation phase could degrade the training signal. Additionally, medical text is inherently ambiguous. Future iterations could benefit from uncertainty quantification, allowing the model to signal when the provided text is too vague to support a confident recommendation. Finally, domain-specific adaptation may be required to ensure the framework handles specialized medical jargon across different clinical fields.

6. Conclusion

TCA provides a robust solution for treatment effect estimation when structured confounders are hidden behind unstructured text at inference time. By leveraging LLMs to synthesize training data and decoupling the causal and textual components of the problem, TCA enables more accurate and unbiased personalized medicine in real-world, text-heavy environments.

Summary updated

BibTeX
@inproceedings{ma2025llm,
  author = {Yuchen Ma and Dennis Frauen and Jonas Schweisthal and Stefan Feuerriegel},
  title = {{LLM-Driven Treatment Effect Estimation Under Inference Time Text Confounding}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=sv41aaGTit},
}
Figure