Causal-Guided Active Learning for Debiasing Large Language Models (2024)

Abstract: Although achieving promising performance, recent analyses show that current generative large language models (LLMs) may still capture dataset biases and utilize them for generation, leading to poor generalizability and harmfulness of LLMs. However, due to the diversity of dataset biases and the over-optimization problem, previous prior-knowledge-based debiasing methods and fine-tuning-based debiasing methods may not be suitable for current LLMs.To address this issue, we explore combining active learning with the causal mechanisms and propose a casual-guided active learning (CAL) framework, which utilizes LLMs itself to automatically and autonomously identify informative biased samples and induce the bias patterns. Then a cost-effective and efficient in-context learning based method is employed to prevent LLMs from utilizing dataset biases during generation.Experimental results show that CAL can effectively recognize typical biased instances and induce various bias patterns for debiasing LLMs.

## introduction large language models (llms) are growing to be the foundation of natural language processing. through the generative pretraining process upon a large-scale corpus, the llms have demonstrated impressive performance in understanding the language and conducting complex reasoning tasks @xcite , demonstrating immense potential in real-world applications. however, the generative pretraining process is a double-edged sword, as it would also inevitably incur dataset bias into the llms such as position bias and stereotype bias @xcite @xcite . this is because, the llms only passively * equal contribution. listing order is random. hence, there is an urgent need for methods to automatically identify biases of generative llms. however, previous automatic debiasing methods are mainly designed for discriminative models and are hard to adapt to generative llms. moreover, these methods generally rely on a fine-tuningbased process on certain dataset(s) to regularize the model. the finetuning-based debiasing process would lead to over-optimization and undermine the generalizability of llms on other tasks @xcite . to address these issues, considering the powerful pattern recognition and inductive ability of llms, we explore combining active learning with the causal mechanisms and propose a casualguided active learning (cal) framework, which utilizes llms themselves to automatically and autonomously identify biased samples and induce the bias patterns. active learning aims at selecting the most informative instances, and then querying external information source(s) to label these data points. in the debiasing scenario, cal identifies the biased instances by finding instances where the llms fail to model causal invariant semantic relationship among context, then selects the most informative biased instances by finding the instances on which dataset biases have the most influence on the generation of llms. the causal invariance can be employed to disentangle the semantic information with dataset biases, as the content of the subsequent text is decided by the semantics of the preceding text (i.e., "causal"), and such relationship exists in all corpora (i.e., "invariant"); on the contrary, although the subsequent text would be correlative to dataset bias, such correlation changes upon different datasets. given the biased instances, a set of explainable bias patterns is further induced, and we devise a cost-effective and efficient in-context learning (icl) based method to regularize llms using the explainable bias patterns. based on the method of this paper, we construct a python package to facilitate the automatic identification of dataset bias on instruct tuning datasets. we attempt to discover biased instances and explainable biased patterns from several commonly used instruct-tuning datasets. the code is publicly available at https://github.com/spirit-moonfly/cal. experimental results show that our approach can automatically induce various explainable bias patterns (some of them may be unreported), and improve the generalizability and safety of llms by using the icl-based debiasing method based on the bias patterns and biased instances. ## methodology as figure 1 (b) shows, cal contains two main components: (i) causal invariance-based biased instance identification; (ii) typical biased instances selection and bias pattern induction. given the recognized bias patterns, we propose an in context learning-based debiasing method for regularizing llms. ## related work previous analyses demonstrate that llms still suffer from biases such as position bias @xcite and stereotyping bias @xcite . to mitigate the llms' biases, one line of methods relies on researchers' prior knowledge to artificially recognize the potential dataset biases, followed by debiasing through prompt-based regularization or aligning with human through instruct tuning @xcite @xcite . however, these methods are limited by the dependence on researchers' prior. moreover, due to the diversity of dataset biases @xcite @xcite , it is unrealistic to identify them one by one manually. to tackle these issues, automatic debiasing methods are proposed. they automatically extract bias features characterizing the dataset biases by training certain biased models @xcite @xcite for regularizing the main model. how-ever, such methods are designed for discriminative models and are hard to adapt to generative llms. in this paper, we propose a causal-guided active learning framework for automatically debiasing generative llms. we borrow the idea from active learning @xcite by first automatically identifying the potentially biased instances using the causal invariance mechanism, then automatically selecting the informative biased instances using the typical criterion and influential criterion. based on such biased instances, the llms are regularized using the icl-based method to prevent them from utilizing the bias patterns. ## conclusion in this paper, we propose a causal-guided active learning framework. depending on the difference between the dataset biases and semantics in causal invariance, we can automatically identify counter example pairs that contain bias. then we utilize an influential and a typical criterion to select counter example pairs that are more informative for inducing bias patterns. finally, a cost-saving yet effective icl-based debiasing method is proposed to prevent the llm from utilizing biases for generation. experimental results show that our approach can effectively recognize various bias patterns automatically, and debias llms to enhance their generalizability and unharmfulness.