Text-Transport: Toward Learning Causal Effects of Natural Language

Victoria Lin, Louis-Philippe Morency, Eli Ben-Michael · DOI

Abstract

Estimating the causal impact of linguistic attributes—such as sentiment, tone, or specific vocabulary—on reader behavior is a fundamental challenge in natural language processing. While randomized experiments provide a gold standard for causal inference, their findings often fail to generalize across domains due to inherent distribution shifts in language use and audience perception. This paper introduces TEXT-TRANSPORT, a framework designed to estimate causal effects in a target domain where experimental data is unavailable by "transporting" insights from a controlled source domain. By utilizing importance weighting via classifiers or large language models (LLMs), the framework accounts for domain shifts and provides more accurate estimates of how text features influence real-world outcomes.

Introduction

In NLP research, we frequently seek to understand the causal relationship between text features and human reactions: Does a more professional tone increase the likelihood of a helpfulness vote? or Does the use of specific slang trigger higher rates of moderation?

Traditionally, these questions are answered through randomized A/B testing. However, experiments are often restricted to specific, "clean" datasets (the source domain). When these findings are applied to different real-world settings (the target domain), they frequently lose validity. A tone perceived as "helpful" in a technical forum might be viewed as "condescending" on a social media platform. Furthermore, observational data is often confounded by variables like user demographics or intent, which are rarely fully captured. TEXT-TRANSPORT addresses this "transportability" problem, providing a mathematical bridge to project valid causal effects from controlled environments onto new, unobserved target domains.

The TEXT-TRANSPORT Framework

The core of the TEXT-TRANSPORT approach is treating the gap between domains as a distribution shift problem. The framework employs a "density ratio" (importance weight) to re-weight samples from the source domain so that they statistically resemble the target domain. The authors propose two primary methods for estimating these weights:

  1. TEXT-TRANSPORT_clf (Classifier-based): A binary classifier is trained to distinguish whether a text sample originates from the source or the target domain. The resulting classification probabilities are used to calculate the importance weights for each sample.
  2. TEXT-TRANSPORT_LM (Language Model-based): This "zero-shot" approach leverages the internal knowledge of Large Language Models. By prompting an LLM to adopt the persona of a writer in a specific domain (e.g., "You are writing a review for a musical instrument"), the researchers use the model’s internal sentence probabilities to calculate the density ratio between the source and target distributions.

By applying these weights to the causal effects measured in the source, the framework can estimate the "transported" effect for the target without requiring new experiments in that domain.

Experimental Evaluation

The researchers evaluated TEXT-TRANSPORT across three distinct settings, ranging from controlled to naturalistic environments:

  • Amazon Reviews: Using reviews of musical instruments as the source and office supplies as the target. This setting used semi-synthetic responses to establish a known ground truth for validation.
  • EmoBank: A setting where sentences were split based on "writer-intended valence" (positivity/negativity) to test if causal effects transport across different emotional tones.
  • Hate Speech (Reddit & Gab): A naturalistic setting using Reddit as the source and Gab as the target. The study examined how linguistic attributes like "netspeak" or "family-oriented language" affected whether a comment was perceived as hateful across different community norms.

Key Insights

Context-Dependency of Language

A primary finding is that linguistic attributes do not have universal causal effects. For instance, the use of "netspeak" (slang and abbreviations) had no significant impact on perceived hatefulness on Reddit. However, on Gab, it had a significant negative effect, making comments appear less hateful to the audience. This highlights the necessity of domain-specific causal analysis.

LLMs as Density Estimators

The study demonstrates that LLMs can effectively estimate distribution shifts without additional training. By using the model's probability outputs as a proxy for domain density, researchers can perform causal transport even when they lack the data to train a dedicated domain classifier.

Natural vs. Isolated Effects

The authors advocate for focusing on "natural" causal effects—how an attribute affects a reader within its typical linguistic context (e.g., how "optimism" functions alongside the positive emotions it usually accompanies). This approach avoids the pitfalls of creating "robotic" or unnatural text often found in studies that attempt to isolate variables too aggressively.

Results and Performance

In validation tests using the Amazon and EmoBank datasets, TEXT-TRANSPORT estimates were statistically indistinguishable from the true target effects. In contrast, "naive" baselines that ignored distribution shifts failed to move toward the target values. Specifically, on the Amazon dataset, TEXT-TRANSPORT_clf achieved a normalized Root Mean Square Error (RMSE) of 0.019, a significant improvement over the naive baseline's 0.073.

In the Reddit-to-Gab transport, the model successfully identified that "function words" (pronouns, conjunctions) increased the perception of hate speech on Gab—a shift that would have been entirely missed if researchers relied solely on Reddit data.

Limitations and Future Directions

While promising, the framework has specific requirements and limitations:

  • Absolute Continuity: The source domain must "cover" the target; if the target domain contains language types entirely absent from the source, the transport logic fails.
  • LLM Instability: The LM-based approach can be sensitive. Because LLMs assign very low probabilities to specific strings, the resulting ratios can exhibit high variance, leading to wider confidence intervals.
  • Future Work: The current framework focuses on natural effects. Future iterations could extend this to "isolated" effects to better disentangle which specific components of a linguistic shift drive the observed causal changes.

Summary updated

BibTeX
@inproceedings{lin2023text,
  author = {Victoria Lin and Louis-Philippe Morency and Eli Ben-Michael},
  title = {{Text-Transport: Toward Learning Causal Effects of Natural Language}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.82},
}
Figure