Debiased controllable text generation with classifier-guided rectified flow language model
摘要
Controllable text generation aims to generate texts that satisfy specific conditions. However, spurious correlations in the training data can lead to biased generation results. For instance, when generating toxic texts with the text generation models, race- or gender-related keywords often appear in the generated texts. While existing works mainly focus on improving the relevance between generated sentences and target conditions, such undesired biases can be problematic as they unintentionally reinforce harmful stereotypes. In light of this, we propose a novel controllable text generation method based on a latent rectified flow language model, tailored to mitigate the spurious correlations between target attributes and unwanted features. We first pretrain the latent rectified flow language model, consisting of a transformer encoder-decoder structure. Next, we adversarially train auxiliary classifiers in the latent space to remove the correlation between spurious features (e.g., the appearance of race- or gender-specific words) and true class semantics (e.g., toxicity of the text). Finally, using the trained classifiers, we conditionally generate samples by providing the classifier guidance to the rectified flow language model. Experiments on the CivilComments-WILDS and MultiNLI datasets demonstrate that our proposed method enables debiased generation and alleviates the attribute relevance while maintaining text quality.