HyperAIHyperAI

Command Palette

Search for a command to run...

LLM
توليد النص

التعلُّم النشط الموجَّه سببيًا لإزالة الانحياز من النماذج اللغوية الكبيرة

Zhouhao Sun Li Du Xiao Ding Yixuan Ma Yang Zhao Kaitao Qiu Ting Liu Bing Qin

الملخص

على الرغم من تحقيق أداء واعد، تُظهر التحليلات الحديثة أن النماذج اللغوية التوليدية الكبيرة (LLMs) قد لا تزال تلتقط انحيازات مجموعة البيانات وتستغلها أثناء التوليد، مما يؤدي إلى ضعف القدرة على التعميم وخطورة هذه النماذج. ومع ذلك، بسبب تنوع انحيازات مجموعة البيانات ومشكلة الإفراط في التحسين، قد لا تكون طرق إزالة الانحياز المعتمدة على المعرفة القبلية وطرق إزالة الانحياز المعتمدة على الضبط الدقيق مناسبة للنماذج اللغوية الكبيرة الحالية. لمعالجة هذه المشكلة، نستكشف الجمع بين التعلُّم النشط والآليات السببية، ونقترح إطار التعلُّم النشط الموجَّه سببيًا (CAL)، الذي يستخدم النماذج اللغوية الكبيرة نفسها لتحديد العينات المنحازة الغنية بالمعلومات بشكل آلي ومستقل، واستنتاج أنماط الانحياز. ثم يُستخدَم طريقة فعّالة من حيث التكلفة قائمة على التعلُّم في السياق لمنع النماذج اللغوية الكبيرة من استغلال انحيازات مجموعة البيانات أثناء التوليد. تُظهر النتائج التجريبية أن إطار CAL يستطيع التعرف بفعالية على الأمثلة المنحازة النموذجية واستنتاج أنماط انحياز متنوعة لإزالة الانحياز من النماذج اللغوية الكبيرة.

One-sentence Summary

Researchers from Harbin Institute of Technology and Beijing Academy of Artificial Intelligence propose a causal-guided active learning (CAL) framework that leverages LLMs themselves to autonomously identify biased samples and induce bias patterns through causal mechanisms, and employs in-context learning to prevent LLMs from exploiting dataset biases during generation, thereby improving generalizability and reducing harmfulness.

Key Contributions

  • This paper proposes a causal-guided active learning framework that identifies counterexample pairs containing dataset biases by using causal-invariance distinctions between invariant semantic relationships and correlative biased patterns in generative large language models.
  • The framework applies active-learning-inspired selection criteria to choose informative biased instances based on the influence of dataset biases on model generation and their typicality for bias-pattern induction, enabling automatic discovery of bias patterns without relying on manually predefined bias priors.
  • A cost-effective in-context learning based debiasing method uses the selected instances to regularize LLMs and prevent them from utilizing biased patterns during generation; experiments show effective recognition of biased instances, induction of bias patterns, and improved generalizability and reduced harmfulness.

Introduction

Large language models are now central to natural language processing, but their generative pretraining can absorb dataset biases such as position bias and stereotype bias, reducing reliability, generalizability, and safety. Prior debiasing methods often depend on manually identified biases and can be difficult to scale, while automatic methods are mainly designed for discriminative models or rely on fine-tuning that may over-optimize and harm broader performance. The authors leverage causal invariance to separate genuine semantic relationships from superficial dataset correlations, using active learning to identify counterexample pairs and select the most informative biased instances. They then induce explainable bias patterns and regularize LLMs through in-context learning to improve generalizability and safety.

Method

The authors organize the method as a three-stage pipeline: first identify dataset-biased instances through causal invariance, then select informative bias cases and induce explicit bias patterns, and finally suppress the discovered biases through prompt-level regularization. Refer to the framework diagram below to see the overall flow from biased instance identification to bias pattern induction and in-context learning based bias suppression.

The first module identifies biased instances by testing whether the model obtains invariant predictive representations. The framework treats each input text XiX_iXi​ as containing two latent components: semantic information SiS_iSi​ and dataset bias BiB_iBi​. For two instances (Xi,Yi)(X_i,Y_i)(Xi​,Yi​) and (Xj,Yj)(X_j,Y_j)(Xj​,Yj​), the method looks for cases where the underlying bias is similar while the semantics differ, i.e.

Bi=Bj,Si≠Sj.B_i = B_j, \quad S_i \neq S_j.Bi​=Bj​,Si​=Sj​.

Under causal invariance, if the model primarily captures semantic information, similar semantic structure should lead to similar generations. Therefore, when the model representations of two inputs are close but their gold subsequent texts are clearly different, the shared predictive information is likely to be spurious bias rather than robust semantics. The authors formalize this with a counter example pair definition. For a dataset D\mathcal{D}D, a pair ⟨(Xi,Yi),(Xj,Yj)⟩\langle (X_i,Y_i), (X_j,Y_j) \rangle⟨(Xi​,Yi​),(Xj​,Yj​)⟩ is regarded as a counter example pair when

Sim⁡(HiM,HjM)>τ,s.t.Sim⁡(Yi,Yj)<α,\operatorname{Sim}(H_i^{\mathcal{M}}, H_j^{\mathcal{M}}) > \tau, \quad \text{s.t.} \quad \operatorname{Sim}(Y_i, Y_j) < \alpha,Sim(HiM​,HjM​)>τ,s.t.Sim(Yi​,Yj​)<α,

where HiMH_i^{\mathcal{M}}HiM​ and HjMH_j^{\mathcal{M}}HjM​ are model representations produced from XiX_iXi​ and XjX_jXj​, Sim⁡(⋅,⋅)\operatorname{Sim}(\cdot,\cdot)Sim(⋅,⋅) is a similarity score, τ\tauτ controls how close the representations must be, and α\alphaα ensures that the target texts are sufficiently different. These counter example pairs indicate that the model may be relying on non-invariant biased cues.

To avoid treating ambiguous or poorly understood instances as bias cases, the pipeline adds a predictive filtering condition. The model should at least generate a reasonably valid continuation for one of the two inputs, otherwise the close representations may reflect a lack of predictive capability rather than the use of bias. This filtering criterion is written as

Sim⁡(Y^i,Yi)>β∨Sim⁡(Y^j,Yj)>β,\operatorname{Sim}(\hat{Y}_i, Y_i) > \beta \quad \vee \quad \operatorname{Sim}(\hat{Y}_j, Y_j) > \beta,Sim(Y^i​,Yi​)>β∨Sim(Y^j​,Yj​)>β,

where Y^i\hat{Y}_iY^i​ and Y^j\hat{Y}_jY^j​ are generated outputs and β\betaβ is a threshold. Thus, the retained pairs are cases where the model has captured some predictive information, but that predictive information violates causal invariance.

The second module selects the most informative biased instances from the detected counter example pairs. Selection follows two principles. First, a pair is more influential if the model has low probability of producing the correct subsequent text, because this suggests that biased information strongly interferes with generation. The influential criterion can be expressed as

p^j,lj<τp,s.t.Sim⁡(Y^j,Yj)<α,\hat{p}_{j,l_j} < \tau_p, \quad \text{s.t.} \quad \operatorname{Sim}(\hat{Y}_j, Y_j) < \alpha,p^​j,lj​​<τp​,s.t.Sim(Y^j​,Yj​)<α,

where p^j,lj\hat{p}_{j,l_j}p^​j,lj​​ is the model probability assigned to the gold subsequent text ljl_jlj​, and τp\tau_pτp​ is a probability threshold. Second, a pair is more typical if the model’s improper generations for the two examples are similar. Similar erroneous outputs imply that the same kind of bias influences both cases, making the bias pattern easier to summarize. The typical criterion is written as

Sim⁡(Y^i,Y^j)>β.\operatorname{Sim}(\hat{Y}_i, \hat{Y}_j) > \beta.Sim(Y^i​,Y^j​)>β.

After selecting informative counter example pairs, the authors induce explainable bias patterns. For each pair, the shared component of HiMH_i^{\mathcal{M}}HiM​ and HjMH_j^{\mathcal{M}}HjM​ is treated as a bias representation vector, because the two inputs differ semantically but induce similar model representations through the same dataset bias. These bias vectors are reduced to a low-dimensional space with Principal Component Analysis, and clustering is performed with a density-based clustering method. Each resulting cluster contains counter example pairs that likely share a common bias mechanism. The examples in each cluster are then provided to a language model to summarize a human-readable bias pattern, such as position bias or verbosity bias.

The third module uses the induced bias patterns to regularize the LLM at inference time without fine-tuning. In the zero-shot setting, the detected patterns are directly appended to the original prompt. The prompt instruction explicitly tells the model not to use the identified cue, for example by adding a sentence of the form: “[bias xxx] is not related to [the goal of the task].” This makes the bias constraint explicit and discourages the model from applying the correlated but non-causal signal.

In the few-shot setting, the authors construct counterfactual in-context examples from the selected biased instances. For a counter example pair, if the model makes an incorrect generation because it follows the dataset bias, that instance becomes a counterfactual example: relying on the bias leads away from the desired output. Such examples are placed in the prompt together with an explicit note, for example:

“<EXAMPLES>. Note that you should not utilize biased information to make generations.”\text{“<EXAMPLES>. Note that you should not utilize biased information to make generations.”}“<EXAMPLES>. Note that you should not utilize biased information to make generations.”

Here, the examples demonstrate cases where biased cues should not determine the answer, while the appended instruction reinforces the intended semantic decision rule. The prompt-level design allows the method to correct bias behavior while avoiding the cost and side effects of fine-tuning.

Experiment

The experiments evaluate the proposed CAL method on two LLMs across tasks involving in-distribution and transferred bias settings, including response preference, natural language inference, and stereotype detection, while comparing vanilla prompting, few-shot prompting, and prior knowledge debiasing baselines. Results show that CAL consistently improves generalizability and reduces harmful stereotype reliance, while also identifying explainable bias patterns such as position, verbosity, format, and stereotype-related biases. Additional analyses indicate that the discovered patterns can transfer across models, remain useful when induced by open-source models or limited data, and highlight the potential of autonomous LLM debiasing.

Across the reported LLaMA evaluations, both prior-knowledge zero-shot methods and CAL variants generally improve over vanilla zero-shot performance, showing that bias-aware prompting can reduce bias-related errors. CAL is particularly strong in zero-shot settings, where it increases unharmfulness scores and exceeds some few-shot baselines, while few-shot CAL gives broader gains though it slightly lowers MNLI. Zero-shot CAL improves all reported LLaMA metrics relative to vanilla zero-shot evaluation. Few-shot CAL improves most reported LLaMA metrics over the few-shot baseline, with a small decline on one generalization metric.

The experiments test whether bias patterns discovered from one LLM can debias another by applying them to GPT-4. Across most evaluation tasks, ZS-CAL outperforms vanilla zero-shot, indicating that transferred bias patterns can help reduce biased behavior. The exception on HANS suggests cross-model transfer is not uniformly beneficial. Bias patterns from Llama2-13B-Chat can be transferred to debias GPT-4. ZS-CAL gives higher zero-shot performance on most datasets, with a notable gain on UQ. HANS shows a small accuracy drop under ZS-CAL, indicating partial transfer.

Using an open-source large language model to induce bias patterns improves task performance over zero-shot baselines across the evaluated datasets. The induced patterns remain effective, though performance is slightly lower than when patterns are induced by a stronger proprietary model. These results suggest that debiasing with automatically learned bias patterns can generalize across induction models and is not limited to a specific large language model. Bias patterns induced by Qwen-72b-chat yield gains over zero-shot inference across the evaluated tasks. Open-source induction still improves performance, but it trails GPT-4 induction slightly. The framework appears generalizable because debiasing benefits persist with a different bias-pattern induction model.

Using a 20% subset for bias pattern induction keeps CAL performance close to the full-data setting across both MNLI and HANS evaluations. CAL still improves over its corresponding zero-shot and few-shot baselines, with especially strong gains on HANS. This suggests that the debiasing approach remains effective when less labeled data is available. CAL performance remains stable when bias pattern induction uses only 20% of the data CAL preserves strong advantages over baseline methods on HANS under reduced data

Experiments on LLaMA compare vanilla prompting, bias-aware prompting, and CAL in zero-shot and few-shot settings, showing that bias-aware prompting generally reduces bias-related errors, with zero-shot CAL especially effective and few-shot CAL broadly improving results despite a small generalization drop. Cross-model tests transfer bias patterns from LLaMA2-13B-Chat to GPT-4, where most tasks improve but HANS reveals that transfer is not uniformly beneficial. Additional results with Qwen induction and a 20% data subset show that the method remains effective with weaker models and less labeled data, although proprietary induction can still be slightly stronger.


بناء الذكاء الاصطناعي بالذكاء الاصطناعي

من الفكرة إلى الإطلاق — سرّع تطوير الذكاء الاصطناعي الخاص بك مع المساعدة البرمجية المجانية بالذكاء الاصطناعي، وبيئة جاهزة للاستخدام، وأفضل أسعار لوحدات معالجة الرسومات.

البرمجة التعاونية باستخدام الذكاء الاصطناعي
وحدات GPU جاهزة للعمل
أفضل الأسعار

HyperAI Newsletters

اشترك في آخر تحديثاتنا
سنرسل لك أحدث التحديثات الأسبوعية إلى بريدك الإلكتروني في الساعة التاسعة من صباح كل يوم اثنين
مدعوم بواسطة MailChimp