USC's CausalDANN Lets LLMs Measure How Anger Drives Social Media Outcomes
USC researchers built CausalDANN, a framework that combines LLM text rewrites with domain-adversarial training to measure causal effects of language attributes like anger or sentiment.
ProTakeaways
- CausalDANN estimates causal effects of text attributes using LLM rewrites plus domain-adversarial training on GitHub.
- Treats whole text as treatment, letting LLMs generate counterfactual interventions like "same post but angrier."
- Uses gradient reversal to align observed and transformed text embeddings, reducing prediction bias.
- Beat BERT, IPW, and doubly robust baselines across Amazon reviews and Reddit AITA benchmarks.
- Matched TextCause performance without needing observed outcomes in the treated group.
- Limitations include LLM bias in rewrites, semi-synthetic evaluation, and residual unobserved confounders.
Measuring the causal effect of something like anger in a social media post is notoriously slippery. You cannot randomly assign people to write angry versus calm posts, and traditional causal inference tools were built for clean binary treatments like drug versus placebo, not messy high-dimensional text. A team at USC's Information Sciences Institute is proposing a workaround called CausalDANN, which uses an LLM to rewrite text along a target dimension and then a domain-adaptive classifier to predict what the outcomes would have been.
The code is on GitHub, and the approach is interesting because it sidesteps a problem that has quietly limited a lot of computational social science work.
Why text breaks classical causal inference
The key challenge is that a treatment variable like "anger" is latently embedded in text, never directly observed, and must be inferred, which further complicates causal-effect estimation. If you use a proxy classifier to label posts as angry or not, any bias in that classifier contaminates your causal estimate. And even if you can label the observed data, you often have no examples of the counterfactual: what would the same post look like if it were angrier, and what engagement would it get?
Prior work on causal effect estimation with text typically does not treat the text itself as the treatment variable; instead, embeddings are used as covariates or a discrete label extracted from the text serves as the treatment. CausalDANN inverts this by treating the whole text as the unit and defining the intervention as a transformation function applied to that text.

How the pipeline actually works
The framework has three moving parts:
- Define the intervention as a text transformation. An LLM is prompted to rephrase text to intensify or attenuate an attribute such as anger or sentiment, while preserving all other properties. For the anger experiments, the authors used Claude 3.5 Sonnet because GPT-4 was too conservative to meaningfully shift the anger level.
- Rephrase the control group too. Both the original and transformed versions get run through an LLM rewrite. This is a small but important trick: if only the treated group is LLM-generated, any stylistic tell of the model leaks into the causal estimate. Rephrasing both sides makes the bias roughly cancel out.
- Predict outcomes with a domain-adversarial network. Because the intervened text lives in a slightly different distribution than the observed text, a vanilla BERT classifier tends to degrade on it. CausalDANN adapts the Domain Adversarial Neural Network (DANN) approach, which integrates a domain classifier as an adversary to encourage domain-invariant features. A gradient reversal layer pushes the encoder to produce embeddings where the classifier cannot tell observed from transformed text, so the outcome predictor generalizes across the shift.

Benchmarks across three case studies
The team evaluated on Amazon product reviews and Reddit r/AmItheAsshole (AITA) discussions of social dilemmas, using LLM-simulated ground truth to score how close each method got to the true treatment effect. They compared against BERT alone, inverse propensity weighting (IPW), doubly robust estimation (DR), and TextCause, which needs data from both treatment and control groups.
On the Amazon reviews benchmark, where the task is estimating the effect of positive sentiment on click likelihood, CausalDANN produced an ATE error of 0.09 versus BERT's 0.12 and DR's 0.58. IPW blew up entirely with an error of 27.29, because the propensity predictor easily classifies reviews as positive or negative, yielding probability outputs near 0 or 1, even after temperature scaling, and this extreme weighting leads to numerical ill behavior.
The anger experiment on AITA posts is the most interesting one. CausalDANN matched TextCause's performance despite not having access to observed outcomes in the treated group at all, which is the practical scenario if you cannot run an intervention.

When it works and when to be cautious
This is useful when you want to ask counterfactual questions about linguistic attributes: does angrier phrasing get more engagement, do shorter reviews convert better, does politeness change moderation outcomes. It's a way to get causal estimates from purely observational text data without running an A/B test.
Several caveats matter for anyone thinking of using it:
- The LLM has to actually disentangle the attribute. If prompting for "more anger" also increases toxicity or changes topic, you're no longer isolating a single causal variable. The authors did manual inspection but acknowledge this needs validation for each use case.
- Evaluation is semi-synthetic. The ground truth verdicts on AITA posts come from GPT-4 acting as a moral judge, not real Reddit users. Estimated effects reflect simulated behavior, not necessarily human behavior.
- Unobserved confounders still exist. Conditioning on text and topic helps, but latent factors driving both writing style and outcomes could still bias results.
The paper is worth reading if you work with observational text data and want to move beyond correlational claims. The real contribution is showing that the domain-adaptation view of causal inference, treating counterfactual prediction as a distribution shift problem, plays much more nicely with LLM-generated interventions than propensity-based methods do.