Investigating Gender Bias in Language Models Using Causal Mediation Analysis

Paper · Source
LLM Failure Modes

The success of neural network models in various natural language processing tasks, coupled with their opaque nature, has led to much interest in interpreting and analyzing such models. One goal of these analyses is to identify whether a model utilizes latent information in its internal representations to arrive at a prediction. This is of particular importance when diagnosing the reasons for a biased prediction. A popular class of analysis methods, often called structural analysis, aims to extract this information using probing classifiers that predict linguistic properties from representations of trained models (e.g., Adi et al., 2017; Conneau et al., 2018; Hupkes et al., 2018; Tenney et al., 2019). However, since probing classifiers only yield a correlational measure between a model’s representations and an external property (Belinkov and Glass, 2019), they cannot show if the property is causally connected to the model’s predictions. Moreover, Barrett et al. (2019) showed that probing classifiers may generate unfaithful interpretations and fail to generalize to unseen data.

We introduce a methodology for interpreting neural models to address these limitations. We adapt causal mediation analysis (Pearl, 2001) for analyzing the mechanisms by which information flows from input to output through different model components. Mediation analysis relies on measuring the change in an output following a counterfactual intervention in an intermediate variable, or mediator. Through such interventions, one can measure the degree to which inputs influence outputs directly (direct effect), or indirectly through the mediator (indirect effect). In our case, the mediator can be any model components that we wish to study, such as neurons or attention heads. We propose multiple controlled interventions in these mediators, which reveal their causal role in a model’s behavior.

In an experiment using several datasets designed to gauge a model’s gender bias, we find that gender bias effects increase with larger models, which potentially absorb more bias from the underlying training data. The causal mediation analysis further reveals that gender bias is sparse, with much of the effect concentrated in a relatively small proportion of neurons and attention heads.

Lines of inquiry this paper opens 24

Research framings built by reading the notes related to this paper — the questions it feeds into.

Can single-axis benchmarks accurately measure deployment-ready agent capability? How much do LLMs rely on surface-level prompt characteristics rather than semantic meaning? Why do multi-agent LLM systems struggle with coordination and genuine deliberation? How do architectural constraints limit monolithic LLM performance on complex tasks? What gap exists between benchmark scores and genuine language model capabilities? How well do model explanations reveal their actual knowledge and reasoning? Does extended thinking consistently improve accuracy or exhibit diminishing returns? Do language models learn true linguistic principles or just surface patterns? What mechanistic structures underlie the reasoning traces that language models produce? What tradeoffs emerge from fine-tuning models for extended reasoning? Do reasoning traces accurately represent how models actually compute their answers? Do base models contain latent reasoning that training can unlock? How can AI systems maintain cognitive diversity in collaborative idea generation? Can neural networks achieve compositionality without explicit mechanisms? Why does model self-revision amplify confidence in incorrect answers? How does policy entropy collapse constrain the scaling of reasoning RL? What are the distinctive characteristics of language models at different scales? Do language models learn genuine linguistic structure or just surface patterns?