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 · OpenReview

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.

Introduction

Word embeddings serve as the mathematical "bedrock" of Large Language Models (LLMs), capturing the intricate contextual relationships between words. However, because these models are trained on massive datasets reflecting human history and discourse, they often inherit and amplify societal prejudices. Previous research has shown that these biases—such as associating specific professions with a particular gender—can lead to discriminatory outcomes in sensitive applications like healthcare, education, and legal tech.

Existing debiasing methods often struggle with a "trade-off" problem: they either fail to remove bias completely (leaving "residual" bias that can be recovered) or they strip away too much semantic information, making the embeddings less useful for actual NLP tasks. Furthermore, traditional methods designed for older, lower-dimensional models like GloVe struggle to scale to the massive, high-dimensional embedding spaces of modern LLMs.

Methodology: DeepSoftDebias

DeepSoftDebias builds upon the concept of "soft debiasing." Instead of a hard projection that deletes a dimension of the vector space, it seeks a transformation that makes word vectors orthogonal to a defined "bias subspace" while staying as close as possible to the original vectors.

The DeepSoftDebias pipeline, illustrating the flow from initial vector generation through the neural debiasing process to quantitative analysis.

The key innovations of this approach include:

  • Neural Transformation: Unlike previous methods that used a simple linear transformation matrix, DeepSoftDebias utilizes a neural network composed of Residual Blocks (RBs). This allows the model to learn more complex, non-linear mappings between biased and debiased spaces.
  • Dual-Loss Function: The network is trained using two competing objectives: Loss 1 ensures the debiased embeddings don't drift too far from the originals (preserving semantic meaning), while Loss 2 forces the embeddings to be orthogonal to the principal components of the bias subspace (removing the bias).
  • Dynamic Scaling: The authors found that the "depth" of the debiasing network must scale with the embedding dimension, recommending 1 RB for dimensions $\le$ 1024, and up to 3 RBs for larger models.
  • Optimization: Transitioning from standard Stochastic Gradient Descent (SGD) to the Adam optimizer resulted in faster convergence and higher optimization quality.

Experimental Setup and Datasets

The study utilizes several critical datasets for training and evaluation:

  • L2-Reddit Corpus: Used to derive the initial vocabulary for extracting LLM embeddings.
  • StereoSet & CrowS-Pairs: The primary benchmarks for measuring stereotypical bias, containing sentence pairs that contrast historically advantaged and disadvantaged groups.
  • GLUE Benchmark: Used for "Downstream Testing" to ensure the debiased embeddings still perform well on tasks like sentiment analysis (SST), natural language inference (QNLI, MNLI), and linguistic similarity (STS-B).
  • CrossNER: Used to evaluate performance on Named Entity Recognition tasks.

Results and Discussion

DeepSoftDebias consistently outperformed state-of-the-art methods like INLP and Sentence Debias across various architectures, including Mamba and Llama-3. On the Mean Average Cosine Similarity (MAC) metric, the method moved scores significantly closer to 1.0, indicating a successful increase in distance from the bias axis.

Comparison of MAC scores across different models and bias types, showing DeepSoftDebias (DSD) consistently achieving higher scores than other debiasing methods.

Key findings include:

  • Complexity Matters: As LLMs grow in size, linear debiasing becomes insufficient. The success of Residual Blocks suggests that bias in high-dimensional space is "tangled" in a way that requires non-linear intervention to unweave.
  • Architecture Agnostic: DeepSoftDebias proved effective not just on standard Transformer models (like BERT or Llama), but also on State-Space Models (SSMs) like Mamba.
  • Preserving Utility: The authors demonstrate that fairness and utility are not mutually exclusive, limiting downstream performance degradation to just 2-3% on the GLUE benchmark.

Limitations and Future Work

While promising, the study was conducted exclusively on English-language models. Future work will explore multilingual datasets and intersectional biases. Additionally, because the method requires access to internal word embeddings, it cannot currently be applied to "closed" API-based models without provider cooperation. The researchers also hope to scale the approach to "frontier" models (65B+ parameters) as more compute becomes available.

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