From Prejudice to Parity: A New Approach to Debiasing Large Language Model Word Embeddings

Aishik Rakshit, Smriti Singh, Shuvam Keshari, Arijit Ghosh Chowdhury, Vinija Jain, Aman Chadha

TL;DR

DeepSoftDebias is a new algorithm that uses residual neural networks to "scrub" gender, racial, and religious biases from Large Language Model (LLM) word embeddings. By replacing traditional linear transformation matrices with a deeper, non-linear architecture, the method achieves near-perfect parity on bias benchmarks while preserving the semantic richness needed for downstream tasks.

What Problem Does This Paper Address?

Word embeddings are the "bedrock" of modern NLP; they are the high-dimensional vectors that allow models to understand the relationships between words. However, because these models are trained on massive crawls of human-generated text, they inevitably inherit human prejudices. A model might "learn" that "doctor" is closer to "man" than "woman," or associate certain religions with violence.

As LLMs are increasingly deployed in sensitive areas like healthcare, education, and the justice system, these biases can lead to discriminatory outcomes. Previous "soft debiasing" methods often relied on simple linear projections that struggled to scale with the massive embedding dimensions of modern SOTA models (often exceeding 4000 dimensions) or resulted in significant "information loss," degrading the model's actual performance on useful tasks.

Methods

The authors introduce DeepSoftDebias, which builds upon the foundational "soft debiasing" work of Bolukbasi et al. (2016). The core innovation is replacing the standard linear transformation matrix with a neural network composed of Residual Blocks (RBs).

The pipeline, visualized in Figure 1 below, follows three main stages:

  1. Initial Vector Generation: Extracting biased embeddings from SOTA models using a consistent vocabulary derived from the Reddit L2 corpus.
  2. Debiasing: Training a neural network using two competing loss functions:
  3. Loss 1 (Similarity): Ensures the debiased embeddings don't drift too far from the original vectors, preserving semantic information.
  4. Loss 2 (Orthogonality): Forces the embeddings to be orthogonal (perpendicular) to a defined "bias subspace" (e.g., the vector direction between "he" and "she").
  5. Quantitative Analysis: Evaluating the resulting vectors on both bias benchmarks and downstream NLP tasks.
Figure 1: A step-by-step visualization of the pipeline for DeepSoftDebias. Our pipeline has 3 major components, Initial Word Vector Generation, Debiasing, and Quantitative Analysis. The Debiasing stage leverages the DeepSoft- Debias network.

Datasets

The study utilizes several key datasets for training and rigorous evaluation:

  • L2-Reddit Corpus: A massive collection of 56 million sentences used to establish a consistent vocabulary across different LLMs.
  • StereoSet: A dataset of ~17,000 sentences designed to measure stereotype bias across gender, race, religion, and profession.
  • CrowS-Pairs: 1,508 examples that contrast historically advantaged vs. disadvantaged groups to identify social biases in masked language models.
  • GLUE Benchmark: Used for downstream testing (SST, MRPC, QNLI, etc.) to ensure that debiasing doesn't "break" the model's ability to perform sentiment analysis or natural language inference.

Key Insights and Ideas

  • Complexity Scales with Dimension: The authors found a direct relationship between embedding size and the required depth of the debiasing network. While a single residual block works for embeddings under 1024 dimensions, larger models (like Llama-3 or Gemma) require three blocks to achieve optimal results.
  • Information Preservation: Unlike methods based on Singular Value Decomposition (SVD), which can discard useful data, the neural approach preserves the full information of the original matrix while specifically targeting the bias components.
  • Architecture Agnostic: The method proved effective not just for standard Transformers (like BERT and RoBERTa) but also for newer State Space Models like Mamba.
  • The "Aha" Moment: Debiasing doesn't have to be a zero-sum game. In several cases, using debiased embeddings actually improved performance on downstream tasks like sentiment analysis, suggesting that removing "noise" from social bias can lead to cleaner semantic representations.

Key Results

DeepSoftDebias consistently outperformed existing state-of-the-art methods (like INLP and Sent-Debias) across multiple metrics:

  • Mean Average Cosine Similarity (MAC): As shown in the table below, DeepSoftDebias (DSD) pushed MAC scores significantly closer to 1.0 across gender, race, and religion, indicating a massive reduction in biased associations. For example, Bert-Large-Uncased jumped from a biased MAC of 0.343 to a DSD MAC of 0.917.
Comparison of MAC scores across different debiasing methods.
  • Stereotype Score (SS): On the StereoSet benchmark, where a score of 50 represents perfect parity (no bias), DeepSoftDebias hit exactly 50.00 for gender and 49.8 for race, outperforming all other tested methods.
StereoSet evaluation results showing DeepSoftDebias achieving near-perfect parity.
  • Downstream Stability: Testing on the GLUE benchmark showed that performance degradation was limited to a maximum of 2-3%, with some tasks even seeing slight gains.

Limitations and Future Work

Despite the strong results, the authors acknowledge several hurdles:

  • Monolingual Focus: The study was conducted exclusively on English datasets. Bias is deeply cultural and linguistic, so future work is needed to see if this translates to multilingual settings.
  • Compute Constraints: Due to GPU VRAM limitations, the authors could not test models larger than ~9B parameters (like Llama-65B).
  • API Barriers: The method requires access to the underlying embedding weights, making it currently impossible to apply to closed-source, API-only models like GPT-4.
  • Expanding Bias Types: While gender, race, and religion were covered, the authors are curious to see if the method can mitigate other forms of prejudice, such as ageism or ableism.

Summary updated

Abstract

Embeddings play a pivotal role in the efficacy of Large Language Models. They are the bedrock on which these models grasp contextual relationships and foster a more nuanced understanding of language and consequently perform remarkably on a plethora of complex tasks that require a fundamental understanding of human language. Given that these embeddings themselves often reflect or exhibit bias, it stands to reason that these models may also inadvertently learn this bias. In this work, we build on the seminal previous work and propose DeepSoftDebias, an algorithm that uses a neural network to perform 'soft debiasing'. We exhaustively evaluate this algorithm across a variety of SOTA datasets, accuracy metrics, and challenging NLP tasks. We find that DeepSoftDebias outperforms the current state-of-the-art methods at reducing bias across gender, race, and religion.
BibTeX
@inproceedings{rakshit2025from,
  author = {Aishik Rakshit and Smriti Singh and Shuvam Keshari and Arijit Ghosh Chowdhury and Vinija Jain and Aman Chadha},
  title = {{From Prejudice to Parity: A New Approach to Debiasing Large Language Model Word Embeddings}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=K9nIBET3m9},
}
Figure