Adjusting for Confounders with Text: Challenges and an Empirical Evaluation Framework for Causal Inference

Galen Weld, Peter West, Maria Glenski, David Arbour, Ryan A. Rossi, Tim Althoff

Abstract

Causal inference from text is an emerging field where researchers use natural language as a proxy for unobserved confounders. However, the lack of ground truth counterfactuals makes evaluating these methods difficult. This paper introduces the first empirical evaluation framework for text-based causal inference, utilizing semi-synthetic datasets to benchmark models across five challenging tasks. Our findings reveal a sobering reality: most current methods fail basic sanity checks, such as the placebo test, and high predictive accuracy often masks significant causal bias.

Introduction: The Confounding Challenge

In causal inference, a primary hurdle is confounding—variables that influence both the treatment and the outcome. For instance, in studying whether online therapy (treatment) reduces suicide risk (outcome), one must account for depression, which affects both the likelihood of seeking therapy and the risk of suicide. Researchers frequently turn to a person's text history (e.g., social media posts) as a proxy to adjust for these latent confounders.

Causal DAG illustrating the relationship between latent confounders, text history, treatment, and outcome.

Despite the promise of NLP-based causal methods, they remain inconsistent. When applied to identical real-world datasets, different models often produce widely varying estimates of the Average Treatment Effect (ATE). Without objective benchmarks, practitioners have had no way to determine which estimates are trustworthy.

A Semi-Synthetic Evaluation Framework

To address this, we propose a semi-synthetic evaluation framework. By taking real user histories from Reddit and Twitter and injecting synthetic "indicator" posts (e.g., specific mentions of sickness), we create known confounders. This allows us to control the "true" ATE and propensity scores while maintaining the complexity of natural language.

The framework evaluates models across five dimensions:

  1. Linguistic Complexity: Ability to recognize diverse expressions for the same confounder.
  2. Signal Intensity: Ability to distinguish users based on signal frequency.
  3. Strength of Selection Effect: Handling scenarios with minimal overlap between treated and untreated groups.
  4. Sample Size: Performance degradation under data scarcity.
  5. Placebo Test: A critical check where the true causal effect is zero.

We also introduce SHERBERT (cauSal HiERarchical variant of BERT), a model designed for long text histories using hierarchical attention layers on top of pre-trained BERT embeddings.

Key Results and the "Accuracy Trap"

Our benchmarking of 10 propensity score models and 3 common estimators (IPTW, Stratification, and Matching) across 648 experiments yielded several critical insights.

Comparison of treatment prediction accuracy and ATE estimates across different NLP models in real-world experiments.

The Accuracy Trap

A major finding is that high accuracy in predicting treatment (propensity scoring) is often a negative indicator for causal inference. High accuracy typically signals a "strong selection effect," where the treated and control groups are so distinct that they lack "common support," making valid causal comparisons impossible. As shown in the Gender Experiment results, models with the highest accuracy often produced the lowest (and potentially most biased) ATE estimates.

Placebo Failures and Model Performance

Alarmingly, 8 out of 9 evaluated methods failed the Placebo Test, falsely identifying statistically significant causal effects when the true effect was zero. While BERT-based models like SHERBERT excel at capturing linguistic variety and handling strong selection effects, they struggle with "counting" (Signal Intensity) and require large datasets (at least ~1,600 users) to remain effective.

Conclusion and Future Directions

The choice of text representation (e.g., n-grams vs. BERT) has a significantly larger impact on bias than the choice of the causal estimator itself. However, current models remain "temporally blind," failing to distinguish whether a signal occurred before or after treatment. Future work must focus on improving data efficiency for transformer-based models and developing architectures capable of accounting for the temporal order of text to truly unlock the potential of text-based causal adjustment.

Summary updated

BibTeX
@inproceedings{weld2022adjusting,
  author = {Galen Weld and Peter West and Maria Glenski and David Arbour and Ryan A. Rossi and Tim Althoff},
  title = {{Adjusting for Confounders with Text: Challenges and an Empirical Evaluation Framework for Causal Inference}},
  booktitle = {ICWSM},
  year = {2022},
}
Figure