Skip to content

The devil is in the neurons: Interpreting and mitigating social bias in pre-trained language modelsThe Devil is in the Neurons: Interpreting and Mitigating Social Biases in Pre-trained Language Models

arXiv· arXiv:2406.10130· Yan Liu, Yu Liu, Xiaokang Chen, Pin-Yu Chen, Daoguang Zan, Min-Yen Kan, Tsung-Yi HoChinese University of Hong Kong; Microsoft Research; Peking University; IBM Research; National University of SingaporeIndexed by this site · 27 days ago· Originally publishedAlignment

Quick read

Interpretability

Based on the paper PDF (AI-generated); refer to the original

The authors propose IG2 to locate social bias neurons in PLMs and BNS to suppress these neurons for debiasing; on StereoSet, the ICAT of BERT/RoBERTa/FairBERTa with BNS is 81.82/77.81/84.79, respectively.

Questions
PLMs contain social bias; existing detection mostly treats the model as a black box and depends on the quality of prompt templates, and existing debiasing mostly requires constructing counter-stereotypical datasets and retraining or fine-tuning, which is costly and may cause catastrophic forgetting.
Methods
Proposes Integrated Gap Gradients (IG2), which performs integrated gradient attribution on the predicted logits gap of a pair of demographics to locate social bias neurons in the FFN; then uses Bias Neuron Suppression (BNS) to set the activations of neurons whose attribution score exceeds a threshold to zero, achieving training-free debiasing.
Experiments and results
On StereoSet intrasentence, the ICAT of BERT/RoBERTa/FairBERTa with BNS is 81.82/77.81/84.79, respectively, all higher than DPCE, AutoDebias, and Union_IG; suppressing the located neurons decreases the logits gap, while random neurons have almost no effect.
Limitations and future work
The authors note that BNS directly zeroes neuron activations, and leave more refined suppression methods for future work. The experiments cover only three MLMs, BERT, RoBERTa, and FairBERTa, and the debiasing evaluation uses only StereoSet intrasentence.
Experimental setupBERT-Base-cased、RoBERTa-Base et al. · StereoSet (intrasentence)、作者构建的 judgment-bearing prompts 数据集(193800 条) · SS、LMS et al.
Evaluated models
BERT-Base-casedRoBERTa-BaseFairBERTa
Benchmarks
StereoSet (intrasentence)作者构建的 judgment-bearing prompts 数据集(193800 条)
Metrics
SSLMSICATlogits gap 变化率
AI summaryThe researchers propose the concept of Social Bias Neurons, use Integrated Gap Gradients (IG²) to precisely locate the neurons in pre-trained language models that cause social bias, and on this basis propose Bias Neuron Suppression (BNS) to suppress them. Measured by StereoSet metrics on BERT, RoBERTa and the debiased FairBERTa, the method achieves higher fairness at low cost while preserving language modeling capability, in contrast to prior high-cost debiasing approaches that fine-tune on anti-stereotypical datasets or re-pretrain.

The researchers propose the concept of Social Bias Neurons, use Integrated Gap Gradients (IG²) to precisely locate the neurons in pre-trained language models that cause social bias, and on this basis propose Bias Neuron Suppression (BNS) to suppress them. Measured by StereoSet metrics on BERT, RoBERTa and the debiased FairBERTa, the method achieves higher fairness at low cost while preserving language modeling capability, in contrast to prior high-cost debiasing approaches that fine-tune on anti-stereotypical datasets or re-pretrain.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    How to interpretably locate social bias neurons inside PLMs and mitigate bias at low cost.

    Core question: how to precisely locate the neurons within pretrained language models (PLMs) that cause social bias, and mitigate these biases at low cost.

    • Problem setting and importance: the authors state that PLMs exhibit biased behavior that is unfair to marginalized social groups and may have negative social impact; as AI fairness research becomes increasingly important, detecting and mitigating social bias in PLMs becomes a key problem.
    • Shortcomings of existing methods: the authors state that existing detection methods are mostly black-box methods such as probing, which measure bias by observing model outputs, and whose effectiveness depends heavily on the quality of the prompt template or probing schema; existing debiasing methods mostly require constructing anti-stereotypical datasets and then retraining or fine-tuning, with high data construction and retraining costs, and fine-tuning also faces the challenge of catastrophic forgetting.
    • Core observation: the authors believe that biased outputs mainly stem from the gap in the model's predicted logits distribution (logits gap) across different demographics, so bias should not be attributed only to the neurons that lead to a certain prediction, but to the neurons that cause the logits gap.
    • What the paper proposes: proposes the interpretable attribution method Integrated Gap Gradients (IG2) to locate "Social Bias Neurons," and constructs a dataset of 193800 prompts as a testbed; on this basis, proposes the training-free debiasing method Bias Neuron Suppression (BNS); also analyzes the change in the distribution of bias neurons before and after debiasing by comparing RoBERTa and FairBERTa.
    • Scope of the study: the authors explicitly handle only human-relevant data, covering 9 demographic dimensions (Gender, Sexuality, Age, Socioeconomic Status, Ethnicity, Religion, Physical Appearance, Politics, Occupation, see Table 1).
  2. What related research exists?

    Related work falls into three categories: bias detection, debiasing, and fairness in downstream tasks; the authors state that no work has yet focused on the interpretability of fairness research.

    Bias detection (black-box methods)

    • Goldfarb-Tarrant et al. (2023), Feng et al. (2023), etc.—use prompt templates or probing schemas to elicit PLM outputs and count the proportion of biased outputs; the authors note that the effectiveness of such methods depends heavily on the quality of the template or schema (citing Shaikh et al., 2022).
    • Davani et al., Fleisig et al. (2023), An & Rudinger (2023)—detect social bias in PLMs, such as FairPrism evaluating fairness harms in text generation.

    Debiasing methods

    • Kaneko & Bollegala (2021) (DPCE)—debiases pretrained contextual embeddings; Guo et al. (2022) (AutoDebias)—debiases MLMs with automatically generated biased prompts; Qian et al. (2022) (FairBERTa)—retrains RoBERTa on a constructed anti-stereotypical dataset. The authors note that this line of "constructing anti-stereotypical datasets and then retraining or fine-tuning" is costly, and fine-tuning also faces catastrophic forgetting.
    • Bolukbasi et al. (2016), Kaneko et al. (2022)—detect and mitigate social bias at the word-embedding level; Chowdhury & Chaturvedi (2022)—learn fair representations at the hidden-representation level.

    Fairness in downstream and generation tasks

    • Dixon et al. (2018), Liu et al. (2021), Dinan et al. (2020)—fairness in text classification tasks; Stanovsky et al. (2019) (machine translation), Lucy & Bamman (2021) (story generation), Parrish et al. (2022) (question-answering benchmark BBQ)—fairness in generation tasks.
    • Li et al. (2022) (HERB)—measures hierarchical regional bias in PLMs; Liu et al. (2023a)—studies annotator group bias in crowdsourced datasets.

    Baselines and benchmarks: the baselines for the debiasing comparison are three published methods, FairBERTa, DPCE, and AutoDebias, plus Union_IG constructed by the authors (running vanilla IG separately for each demographic in UT and then taking the union of neurons); the evaluation benchmark is the intrasentence subset of StereoSet (Nadeem et al., 2021).

    Positioning of this paper: the authors state that "no work focuses on the interpretability of fairness research," and this paper fills this gap by proposing an interpretability technique for multidimensional social bias; IG2 itself is a modification of the classic attribution method Integrated Gradients (Sundararajan et al., 2017), and the dataset construction part draws on the template-based cloze task format of PARAREL (Elazar et al., 2021).

  3. How does the paper address this problem?

    IG2 performs integrated gradient attribution on the logits gap of a demographic pair to locate bias neurons, and then BNS sets their activations to zero.

    Overall approach: social bias is formalized as the gap between the model's predicted distributions for a pair of demographics; Integrated Gap Gradients (IG2) attributes this logits gap to FFN intermediate neurons, and then Bias Neuron Suppression (BNS) suppresses neurons with high attribution scores.

    Problem Setting and Formalization

    • Unfair Target (UT): a pair of demographics under one demographic dimension, denoted (Demographic_1, Demographic_2), e.g., (male, female) under the Gender dimension.
    • Judged Unfair Target (JUT): a UT plus a category of judgmental modifiers, denoted (Judgment, Demographic_1, Demographic_2); the modifiers fall into 6 categories (Negative, Negative Comparative, Negative Superlative, Positive, Positive Comparative, Positive Superlative), 100 words each, 600 in total (Table 2).
    • Analysis targets: the masked token position in the input and the intermediate neurons of the FFN module—i.e., the position where the predicted logits gap is observed.

    IG2: Integrated Gradient Attribution of the Logits Gap

    • Core definition: IG2(wj(l)) = wj(l) ∫α=01 (∂ Px(d1|α wj(l)) − Px(d2|α wj(l)))/(∂ wj(l)) dα, i.e., the integral of the gradient of the difference between the predicted probabilities of the two demographics with respect to the neuron as its activation gradually changes from 0 to its original value; a larger gradient indicates a larger effect of the neuron on the biased output.
    • Difference from IG: vanilla IG attributes a single prediction, whereas IG2 attributes the logits gap of a pair of demographics; the authors consider the logits gap to be the root cause of the uneven output distribution of the model.
    • Computation: the continuous integral cannot be computed directly, so Riemann approximation is used, with the number of approximation steps m = 20.

    BNS: Bias Neuron Suppression

    • Suppression rule: if a neuron's IG2 attribution score is not lower than the threshold σ, its activation is set to 0; otherwise it is kept; the threshold is σ = 0.2 × the maximum IG2 score across all neurons.
    • Characteristics: BNS is training-free and suppresses only the located neurons; the authors state that in this way it targets only the neurons causing the distribution gap and can preserve other knowledge of the model.

    Dataset Construction

    • Templates: GPT-3.5 is used to help paraphrase templates to ensure diversity, yielding 17 fill-in-the-blank templates (Table 3) in the format "modifier + person + demographic dimension + [MASK]".
    • Scale: 9 demographic dimensions × 6 categories of modifiers, 114 JUTs and 19 UTs in total, 1700 examples per JUT, totaling 193800 judgment-bearing prompts (Table 4).

    Verification and Analysis Design

    • Neuron verification: two operations are performed on the neurons located by IG2—suppression (setting activations to 0) and amplification (doubling activations)—and the change in the logits gap is observed; the same operations are performed on the same number of random neurons as a control.
    • Debiasing evaluation: BNS and the baselines are evaluated on the StereoSet intrasentence subset using the three metrics SS, LMS, and ICAT.
    • Distribution analysis: the distribution of bias neurons across layers in BERT, RoBERTa, and FairBERTa is compared, and the neuron intersections within the same JUT (Avg. Intra) and between different JUTs (Avg. Inter) are counted.
  4. What experiments did the paper conduct?

    On StereoSet, the ICAT of BNS exceeds all baselines; suppression/amplification experiments verify the localization accuracy, and the shift in neuron distribution of FairBERTa is analyzed.

    Experimental Setup

    • Models evaluated: BERT-Base-cased, RoBERTa-Base, FairBERTa (a debiased model obtained by retraining RoBERTa on counter-stereotypical data), all masked language models.
    • Datasets: 193800 judgment-bearing prompts constructed by the authors (114 JUTs, 1700 each, Table 4); the debiasing evaluation uses the intrasentence subset of StereoSet (the paper does not state the number of examples in this subset).
    • Baselines: three published methods, FairBERTa, DPCE, and AutoDebias, as well as Union_IG (attributing each of the two demographics in a UT separately with vanilla IG, taking the union, and then suppressing).
    • Metrics: SS (Stereotype Score, ideal value 50), LMS (Language Modeling Score, ideal value 100), ICAT (a combination of SS and LMS, ideal value 100), all computed according to the definitions in StereoSet.
    • Key parameters: the number of Riemann approximation steps for IG2 is m = 20; the BNS threshold is σ = 0.2 × the maximum IG2 score.
    • Number of repetitions: not reported in the paper.

    Main Results

    Debiasing results on StereoSet intrasentence (according to Table 5):

    Swipe horizontally to read the table

    ModelSS (→50)LMS (↑)ICAT (↑)
    BERT-Base-cased56.9387.2975.19
    + DPCE62.4178.4858.97
    + AutoDebias53.0350.7447.62
    + Union_IG51.0131.4730.83
    + BNS (Ours)52.7886.6481.82
    RoBERTa-Base62.4691.7068.85
    + DPCE64.0992.9566.67
    + AutoDebias59.6368.5255.38
    + Union_IG53.8230.6128.27
    + BNS (Ours)57.4391.3977.81
    FairBERTa58.6291.9076.06
    + Union_IG52.2737.3635.66
    + BNS (Ours)53.4491.0584.79
    • BNS's ICAT is the highest for the same model across all three models: the authors state that BNS precisely locates only the neurons causing the distribution gap, maximally preserving useful knowledge, achieving an ICAT of 84.79 (on FairBERTa).
    • The exception of Union_IG: the authors point out that Union_IG's SS is closer to 50 (e.g., 53.82 on RoBERTa-Base), but LMS drops from 91.70 to 30.61 because it indiscriminately suppresses all neurons associated with different demographics, destroying other knowledge of the model.
    • Comparison with retraining methods: the authors state that BNS performs better than AutoDebias and FairBERTa, and that FairBERTa requires retraining whereas BNS is training-free and requires only very few computational resources; the paper does not report specific time or resource figures. Note that DPCE's SS on BERT and RoBERTa is actually further from 50 than the original models (62.41, 64.09).

    Verification of Neuron Localization (Figure 2)

    • What was measured: on FairBERTa, several JUTs were randomly selected (Gender, Physical Appearance, and Ethnicity each paired with 6 categories of modifiers), the neurons located by IG2 were suppressed or amplified, and the rate of change of the logits gap was observed.
    • Results: the example given in the figure caption is Gender-N—suppression decreases the logits gap by 22.98%, and amplification increases it by 29.05%; performing the same operations on the same number of random neurons changes the logits gap very little (the bars for random operations in the figure are close to 0).
    • Authors' interpretation: the authors state that this shows IG2 accurately locates the neurons affecting biased outputs, while random neurons have little effect on bias.

    Distribution Shift Analysis of FairBERTa (Figure 3)

    • What was measured: the distribution of the number of bias neurons across Transformer layers in BERT, RoBERTa, and FairBERTa was compared.
    • Results: the bias neurons of BERT and RoBERTa are concentrated in the deepest layers 10–12, with layer 12 accounting for about 55.7% (BERT) and 36.4% (RoBERTa); after debiasing, the average number of neurons is almost unchanged (10.35 → 10.06), but the proportion in the two shallowest layers rises from 2.9% (RoBERTa) to 26.0% (FairBERTa), layer 12 drops to 26.4%, and about 1/3 of the neurons migrate from the deepest three layers to the shallowest three layers.
    • Authors' interpretation: the authors speculate that, being close to the output layer, deep bias neurons have a large effect on the output; FairBERTa's retraining shifts bias neurons from deep layers to shallow layers, weakening their effect on the output, which the authors consider may be the reason for its effective debiasing.

    Other Ablations and Analyses

    • Number of neurons per dimension (Figure 4, BERT): Ethnicity has the most (14.57 on average), Gender the fewest (1.09); except for Ethnicity, the other dimensions require suppressing fewer than 4 neurons on average.
    • Neuron intersection statistics (Table 6): within the same JUT the intersection is large (e.g., Avg. Intra for BERT Ethnicity is 10.97), while between different JUTs the intersection is close to 0 (e.g., 0.34); the authors state that this shows the localization results are unrelated to the template sentence pattern and related only to the bias itself, and that bias neurons differ greatly across different JUTs.
  5. What are some points that can be further explored?

    The authors only note that directly zeroing BNS is rather coarse and that more refined suppression methods could be designed; the experiments cover only three MLMs and one benchmark.

    Limitations and Future Directions Pointed Out by the Authors

    • Suppression method is rather coarse (Limitations, Section 7): the authors point out that BNS directly sets the activations of the selected social bias neurons to zero; although effective, a more refined suppression method might yield better results, which is left for future research.
    • The paper does not specifically discuss other limitations.

    Scope of Experiments

    • Models evaluated: 3 in total, BERT-Base-cased, RoBERTa-Base, and FairBERTa, all masked language models (Section 4.2); autoregressive generative models are not covered.
    • Debiasing evaluation benchmark: only the intrasentence subset of StereoSet (Section 4.4); the paper does not report the number of examples in this subset.
    • Self-constructed dataset: 193800 prompts, 114 JUTs, 9 demographic dimensions; the modifiers are 100 positive words and 100 negative words randomly selected from an English sentiment word list (Hu & Liu, 2004) along with their comparatives and superlatives (Sections 2.3, 4.1).
    • Neuron verification experiment: conducted on FairBERTa, with the x-axis being several randomly selected JUTs (the three dimensions Gender, Physical Appearance, and Ethnicity, Figure 2 caption); the paper does not report the number of selected JUTs or the number of repetitions.
    • Not reported in the paper: the number of repetitions and variance of the debiasing experiments, specific computation time or resource figures for BNS, and evaluation against adaptive attacks or finer-grained suppression variants.
  6. Summarize the main content of the paper

    IG2 attributes the logits gap of a demographic pair to neurons, and BNS suppresses these neurons, achieving the highest ICAT on StereoSet at low cost.

    A work on the interpretability and debiasing of social bias in PLMs (ICLR 2024), whose core is turning bias from "black-box output statistics" into "localizable neuron-level attribution".

    • Problem to solve: existing bias detection depends on the quality of prompt templates and treats the model as a black box; existing debiasing requires constructing counter-stereotypical datasets and retraining or fine-tuning, which is costly and may cause catastrophic forgetting.
    • Method highlights: proposes IG2—integrated gradient attribution on the predicted logits gap of a pair of demographics (Riemann approximation, m = 20) to locate "social bias neurons" in the FFN; then proposes the training-free BNS, which sets the activations of neurons whose IG2 score is not lower than a threshold (0.2 × the maximum score) to zero. A dataset of 193800 prompts was also constructed (9 demographic dimensions, 600 judgmental modifiers, 114 JUTs).
    • Main results: on StereoSet intrasentence, the ICAT of BERT/RoBERTa/FairBERTa with BNS is 81.82/77.81/84.79, respectively, all the highest values for their respective models, and LMS is largely maintained (86.64/91.39/91.05); although the control Union_IG has an SS closer to 50, its LMS drops to around 30 (Table 5).
    • Verification and analysis: suppressing the located neurons decreases the logits gap of Gender-N on FairBERTa by 22.98%, and amplifying them increases it by 29.05%, while random neurons have almost no effect (Figure 2); comparing RoBERTa and FairBERTa shows that after debiasing the number of bias neurons is almost unchanged (10.35 → 10.06), but about 1/3 migrate from the deepest three layers to the shallowest three layers, which the authors speculate may be the reason retraining-based debiasing is effective.
    • Authors' conclusion: the authors state that IG2 can precisely identify bias neurons and that BNS can debias at low cost while maintaining language modeling ability, and hope these findings inspire future AI fairness research; the authors also point out that BNS's direct zeroing approach is rather coarse and that more refined suppression methods are a future direction.

Related papers

Both use: StereoSet
Read originalarxiv.org