GeDi: Generative Discriminator Guided Sequence Generation
By Ben Krause, Akhilesh Deepak Gotmare, Bryan McCann, Nitish Shirish Keskar, Shafiq R. Joty, Richard Socher, Nazneen Rajani. 2020
516 citations recorded by the source corpus.
While large-scale language models (LMs) are able to imitate the distribution of natural language well enough to generate realistic text, it is difficult to control which regions of the distribution they generate. This is especially problematic because datasets used for training large LMs usually contain significant toxicity, hate, bias, and negativity. We propose GeDi as an efficient method for using smaller LMs as generative discriminators to guide generation from large LMs to make them safer and more controllable. GeDi guides generation at each step by computing classification probabilities for all possible next tokens via Bayes rule by normalizing over two class-conditional distributions; one conditioned on the desired attribute, or control code, and another conditioned on the undesired attribute, or anti control code. We find that GeDi gives stronger controllability than the state of the art method while also achieving generation speeds more than 30 times faster. Additionally, training GeDi on only four topics allows us to controllably generate new topics zero-shot from just a keyword, unlocking a new capability that previous controllable generation methods do not have. Lastly, we show that GeDi can make GPT-2 (1.5B parameters) significantly less toxic without sacrificing linguistic quality, making it by far the most practical existing method for detoxifying large language models while maintaining a fast generation speed.
Subfields: Artificial Intelligence, Natural Language Processing, Prompting & Reasoning
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Yejin Choi
- Mohit Bansal
- Luke S. Zettlemoyer
- Percy Liang
- Hannaneh Hajishirzi
- Noah A. Smith
- Jianfeng Gao
- Graham Neubig
In Natural Language Processing
- Yejin Choi
- Jason Aaron Edward Weston
- Mohit Bansal
- Luke S. Zettlemoyer
- Noah A. Smith
- Hannaneh Hajishirzi
- Graham Neubig
- Yulia Tsvetkov
In Prompting & Reasoning
- Luke S. Zettlemoyer
- Yejin Choi
- Hinrich Schütze
- Hannaneh Hajishirzi
- Timo Schick
- Daniel Klein
- Minlie Huang
- Daniel Khashabi
Citations in the corpus
- Using DeepSpeed and Megatron to Train Megatron-Turing NLG 530B, A Large-Scale Generative Language Model (2022, neutral): “d) Fine tuning – where the trained model is retrained to unlearn biased tendencies [19, 20, 28].”
- Challenges in Detoxifying Language Models (2021, background): “Automatic evaluation can give a first, low-cost indication of toxicity and is useful for particular types of research, such as narrowly focused steering methods (Dathathri et al., 2020; Krause et al., 2021).”
- Detoxifying Language Models Risks Marginalizing Minority Voices (2021, methodology): “This occurs for all detoxification techniques, for example, in Figure 2 we vary a parameter in GeDi that increases the degree of detoxification ( ω ).”
- Societal Biases in Language Generation: Progress and Challenges (2021, methodology): “, 2019), GeDi (Krause et al., 2020)), there is potential for extending these methods to bias mitigation.”
- Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigm (2021, background): “Recent work in the literature has focused on controlling natural language generation using traditional approaches from machine learning like novel architectures which condition outputs [15, 16], more advanced sampling techniques [6, 11], gradient-based”
- OPT: Open Pre-trained Transformer Language Models (2022, background): “There has been a great deal of work on mitigations for toxicity and biases (Dathathri et al., 2019; Dinan et al., 2019a; Sheng et al., 2019; Dinan et al., 2020a; Liu et al., 2019a; Krause et al., 2020; Xu et al., 2020; Liang et al., 2021; Dinan et al., 2021; Xu et al., 2021a; Dhamala et al., 2021; S”
- Towards Safer Generative Language Models: A Survey on Safety Risks, Evaluations, and Improvements (2023, methodology): “DExperts (Liu et al., 2021) achieve detoxification by adopting two generative models (expert and anti-expert models) to replace the original discriminator, inspired by Bayes theorem and GeDi (Krause et al., 2021).”
- Language Generation Models Can Cause Harm: So What Can We Do About It? An Actionable Survey (2022, background): “1, such as toxicity/bias classifiers (Dathathri et al., 2019; Krause et al., 2021; Liu et al., 2021a), factuality metrics (Kryscinski et al.”
- Recipes for Safety in Open-domain Chatbots (2020, methodology): “Krause et al. (2020) use controlled generation techniques to guide a more powerful language generator, and show how this technique can be used to detoxify a language model while being computationally much less costly than Dathathri et al. (2019).”
- Prefix-Tuning: Optimizing Continuous Prompts for Generation (2021, neutral): “The control can also happen at decoding time, by weighted decoding (GeDi, Krause et al., 2020) or iteratively updating the past activations (PPLM, Dathathri et al., 2020).”
- Constructing Highly Inductive Contexts for Dialogue Safety through Controllable Reverse Generation (2022, background): “, 2021), while others explicitly change the token distribution during generation (Dathathri et al., 2019; Krause et al., 2021; Liu et al., 2021).”
- Generating Training Data with Language Models: Towards Zero-Shot Language Understanding (2022, background): “Adapting PLMs to generate texts of specific attributes can also be realized at inference time without any further training of the PLMs [10, 26, 27, 32, 47, 75].”
- Self-Diagnosis and Self-Debiasing: A Proposal for Reducing Corpus-Based Bias in NLP (2021, methodology): “For contextualized embeddings, similar methods to alleviate the issue of undesirable biases and toxicity have been proposed (Dev et al., 2020; Nangia et al., 2020; Nadeem et al., 2020; Krause et al., 2020; Liang et al., 2020; Kaneko and Bollegala, 2021a).”
- Aligning AI With Shared Human Values (2020, background): “To make algorithms prosocial, researchers have proposed imitating temperamental traits such as empathy (Rashkin et al., 2019; Roller et al., 2020), but these have been limited to specific character traits in particular application areas such as chatbots (Krause et al., 2020).”
- Unsolved Problems in ML Safety (2021, background): “Research on steerable and controllable text generation [103, 98] could help chatbots exhibit virtues such as friendliness and honesty.”
- DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Experts (2021, methodology): “Generative discriminators (GeDi; Krause et al., 2020) GeDi uses a class-conditioned LM to provide classification probabilities for all possible next tokens via Bayes’ rule.”
- Quark: Controllable Text Generation with Reinforced Unlearning (2022, methodology): “We include previously reported baselines from [40], including GPT-2 (i.e., the p 0 model), PPLM [12], G E D I [32], DAPT [21], and DE XPERTS [40].”