TL;DR
This paper introduces EXPOSED, a novel method to reduce toxic and biased outputs from large language models (LLMs) without requiring extensive fine-tuning or large, clean datasets. EXPOSED uses a specialized "debiasing expert" model trained on toxic content to identify and suppress harmful tokens during the LLM's generation process, achieving significant improvements in fairness while maintaining generation quality.
What Problem Does This Paper Address?
Large language models (LLMs) are powerful tools for text generation, but they often inherit and amplify societal biases present in their training data. This can lead to the generation of toxic, stereotypical, or prejudiced content, especially when prompted with sensitive or leading inputs. Existing methods to mitigate these biases, such as fine-tuning LLMs on curated datasets or using complex prompting strategies, face challenges: fine-tuning requires massive, unbiased datasets that are difficult to create and can still introduce annotator bias, while multi-turn prompting increases computational cost and inference latency. The paper aims to provide an efficient, scalable, and effective solution to debias LLM generations without these drawbacks.
Methods
The core of EXPOSED is a two-stage process:
- Debiasing Expert: Continued Pre-Training: A smaller language model is trained on a large corpus of toxic and biased text (e.g., hate speech, offensive language). This "debiasing expert" learns to identify and predict tokens that are likely to contribute to harmful outputs. The goal is for this expert to become highly sensitive to toxic content.
- Distributional Reconstruction: Expose and Extinct Toxic Tokens: During the generation process of the main LLM, EXPOSED uses the debiasing expert to influence the output.
- Both the main LLM and the debiasing expert predict the probability distribution of the next token.
- The difference between these distributions is calculated. A positive difference indicates that the debiasing expert strongly favors a token that the main LLM might not, suggesting it's a potentially toxic candidate.
- A novel decay function (specifically, an exponential decay) is applied to these differences. This function attenuates the probability of the identified toxic tokens and, by extension, amplifies the probabilities of safer tokens.
- The main LLM's output distribution is then re-scaled and finalized, effectively "extinguishing" the toxic tokens. This approach is model-agnostic and can be plugged into existing LLM decoding pipelines.
Datasets
The paper utilizes several datasets for training the debiasing expert:
- HateSpeech [6]
- OLID [46]
- RedditBias [2]
- MeTooMA [12]
These datasets consist of text labeled for various forms of toxicity, including hate speech, offense, and sarcasm.
For evaluation, the following benchmarks are used:
- RealToxicityPrompts [13]: Used for open-ended text generation to measure toxicity.
- Bias Benchmark for Q&A (BBQ) [31]: Used for reading comprehension to assess stereotypical bias.
- Winogender benchmark [33]: Used for cloze tests to examine gender bias in occupations.
Key Insights and Ideas
- Leveraging Toxic Data for Debiasing: Counter-intuitively, the paper shows that training a "debiasing expert" on abundant toxic data can be more effective for debiasing than trying to curate a massive unbiased dataset. The expert learns to recognize toxicity by being exposed to it.
- Post-Generation Intervention: EXPOSED acts as a post-processing step during decoding, meaning it doesn't require retraining the entire LLM. This makes it more efficient and adaptable.
- Model-Agnostic Approach: The method is designed to be plug-and-play, working with different LLM families (GPT-Neo, FLAN-T5, LLaMA2) and sizes, which is a significant advantage for practical deployment.
- Decay Function Importance: The choice of decay function is crucial. The paper finds that an exponential decay function, combined with a bias threshold, effectively balances debiasing and generation quality.
Key Results
- Significant Toxicity Reduction: EXPOSED consistently reduced toxic attributes across various LLM families and benchmarks. For instance, on open-ended generation with GPT-Neo, toxicity scores were reduced from 61.1% to as low as 27.3% with higher decay constants.
- Improved Fairness: The method also showed strong performance on reading comprehension and cloze tests, significantly reducing stereotypical and gender biases compared to baselines. For example, on the BBQ benchmark with GPT-Neo, the bias score dropped from 0.21 to 0.07.
- Balanced Performance: While increasing the debiasing strength (higher decay constant λ) led to lower toxicity, it also slightly increased perplexity, indicating a trade-off. However, EXPOSED generally maintained competitive generation fluency.
- Efficiency: Compared to methods like moral self-correction, which involves multiple generation turns, EXPOSED demonstrated comparable or lower inference latency, making it suitable for real-time applications.
Limitations and Future Work
- Decay Function Sensitivity: The paper notes that while the exponential decay function works well, the optimal parameters (λ and τ) need careful tuning. An increase in λ can lead to a generation-fairness trade-off, and a very large τ might not effectively filter dangerous tokens.
- Undesired Token Suppression: The decay function might suppress desired tokens along with undesired ones, potentially impacting generation quality in some cases.
- Training Corpus Requirement: The debiasing expert requires a biased corpus for training, which might not be available in all scenarios.
- Future Work: The authors suggest exploring more sophisticated decay functions and investigating the impact of different training corpora on debiasing performance. They also acknowledge that the method might not capture all complex relationships between tokens and could struggle with nuanced biases.
Summary updated