TL;DR
While Large Language Models (LLMs) are excellent at generating natural-language hypotheses to explain differences between text corpora, they often latch onto global confounds rather than insights of true substantive interest. This paper introduces conditional hypothesis generation, a framework that integrates researcher-specified covariates into the feature-selection process using econometrics-inspired techniques. By controlling for these covariates, the proposed methods successfully overcome data imbalances and sign reversals (Simpson's Paradox) to surface much more useful, targeted insights.
What Problem Does This Paper Address?
In computational social science, researchers frequently use LLMs to discover interpretable differences in how language varies across different outcomes (e.g., comparing speeches from different political parties). A common approach is to map text to interpretable features using Sparse Autoencoders (SAEs) and select the most discriminative features via a statistical model like LASSO before handing them to an LLM for description.
However, global discrimination can be highly misleading due to confounding variables. For instance, "national park" language might appear globally predictive of a specific political party simply because public lands are unevenly distributed across states, not because the issue itself is inherently partisan.
To steer discovery away from these confounds, researchers need a way to find text differences that hold within specific subgroups or conditions (covariates). Doing so introduces two major statistical hurdles:
- Stratum Imbalance: The target subgroup might be rare or underrepresented in the dataset, causing its signal to be drowned out by larger groups.
- Sign Reversal (Simpson's Paradox): The direction of a text-outcome relationship might completely flip between different subgroups, causing the global average to cancel out the pattern entirely.
Methods
The authors build on top of recent state-of-the-art pipelines that combine Sparse Autoencoders (SAEs) with LASSO feature selection. Instead of running a standard global LASSO, they introduce two complementary, econometrics-inspired selection methods to handle covariates ($C$):
- Interaction-lasso: This method augments the feature space by multiplying the SAE features with the covariates ($Z \odot C_p$). This allows the model to select a feature if it is highly discriminative within a specific subgroup, even if its global effect is zero. This is specifically designed to catch sign reversals.
- Demeaned-Reweighted-Lasso: This method groups documents by their covariate values and subtracts the group means from both the feature activations and the labels (within-stratum demeaning). It then applies inverse-frequency weighting to ensure underrepresented groups contribute equally to feature selection. This is optimized for stratum imbalance.
Datasets
The framework was evaluated using both controlled synthetic environments and real-world datasets:
- Synthetic Congress Bills: Built using bill summaries from the 110th–114th U.S. Congress (originally from the BILLS dataset). The authors engineered specific corpus compositions to simulate varying levels of stratum imbalance and explicit sign reversals.
- CONGRESS: A real-world dataset of U.S. congressional speeches where the outcome is party affiliation (Republican vs. Democrat) and the covariate is whether the talk is substantive public policy or merely procedural.
- NCTE: A dataset of math classroom transcripts. The outcome is the quality of student error remediation, and the covariate is the level of classroom behavioral management.
Key Insights and Ideas
- Statistical Modeling Beats Prompt Engineering: Simply feeding covariate labels directly into an LLM prompt (
llm-covariate) fails to find conditional patterns reliably. Corpus-level statistical feature selection is necessary to guide the LLM effectively. - SAEs Enable Econometric Text Analysis: Because Sparse Autoencoders project text into a fixed set of sparse, monosemantic (single-concept) features, traditional econometric tools like fixed effects and interaction terms can be applied directly to text data as if they were standard numerical variables.
- No Free Lunch for Model Choice: Demeaned-reweighted-lasso assumes No Qualitative Interaction (NQI)—meaning the effect doesn't flip signs across groups. If the effect does flip (Simpson's paradox), demeaning fails, and interaction-lasso must be used instead.
Key Results
In synthetic experiments simulating stratum imbalance, the demeaned-reweighted-lasso approach maintained a high surface similarity to ground-truth hypotheses (~0.730) even when the target stratum made up only 20% of the data ($r=0.20$), vastly outperforming the standard global LASSO baseline (~0.393).
In the sign reversal setup, where the text-outcome relationship flipped entirely after the year 2011, interaction-lasso was the only method capable of recovering the true patterns, boosting F1 similarity from 0.362 (global LASSO) to 0.576.
For real-world datasets, domain experts blindly evaluated the generated hypotheses. As shown in the evaluation results, hypotheses unique to the covariate-aware method (demeaned-reweighted-lasso) were rated as significantly more helpful for understanding the true group differences than those generated by the global baseline.
Limitations and Future Work
- Dependence on Pre-specified Covariates: The framework cannot automatically discover which covariates matter; it relies entirely on the researcher's domain knowledge to input the correct control variables.
- Categorical Constraints: The current implementation is optimized for binary or categorical covariates. Handling continuous variables would require discretization or alternative residualization strategies.
- Downstream Pipeline Reliance: The quality of the final natural-language hypothesis is still bound by the inherent limitations of the underlying SAE's interpretability and the LLM's phrasing accuracy.
Summary updated