无需标注数据,自动识别并消除微调时的虚假关联。
Unsupervised Identification and Removal of Spurious Correlations During Fine-Tuning
- 通过LoRA微调权重分析,无监督识别隐藏的虚假关联因素。
- 在代码安全与医疗建议任务中,误判减少超5倍,保留原任务性能。
- 适合关注模型公平性与泛化能力的研究者和工程师。
在预训练语言模型上使用精心筛选的数据集进行微调时,可能会产生目标任务与无关潜在因素(如错误人格或政治倾向)之间的虚假关联,导致模型产生偏差并降低跨分布泛化能力。本文证明,在合理假设下,可通过朴素的LoRA微调权重,无监督地识别这些潜在因素。现有方法如激活引导仅从残差流中移除相关因素,但可能破坏真实任务信号。为此,本文提出GRASP(梯度投影虚假模式),在不破坏预训练内容的前提下,阻止模型对已识别因素的新依赖。在三个任务上验证:前两个涉及由窄任务微调引发的意外偏差(生成不安全代码、给出错误医疗建议),本方法完全消除代码安全问题中的偏差,医疗建议任务中偏差减少约5倍;第三个为新型政治偏见实验,用右倾Reddit金融建议数据微调后,模型在无关话题上出现政治倾向漂移,本方法使漂移减少超过一半,同时提升金融任务表现,优于所有基线。
原文摘要 · Abstract (English)
Fine-tuning a pretrained language model on a curated dataset can produce spurious correlations between the fine-tuning task and unintended latent factors -- such as misaligned personas or political slant -- that the curation procedure has entangled with the task. The model can latch onto these spurious correlations, leading to bias and reduced out-of-distribution generalisation. We prove that under reasonable assumptions on task complexity and the spurious correlation, such latent factors can be identified, without supervision, from the weights of a naive LoRA fine-tune. Existing approaches to removing bias, such as activation steering, remove identified factors from residual-stream activations, either at inference or during training. We argue, however, that the goal should be to remove the spurious correlation, not the latent factor itself, as the pretrained model may rely on it for genuine task signal. To enable this, we propose GRASP, GRadient projection of Associated Spurious Patterns, which prevents the model from acquiring new reliance on the identified latent factor while preserving any pretrained content along it. We validate on three fine-tuning tasks. The first two involve emergent misalignment, where fine-tuning on a narrow task -- in our case, writing insecure code and giving bad medical advice -- leads to misaligned responses on unrelated topics. Here our method completely removes misalignment in the insecure code case and reduces them by ~5x in the bad medical advice case, beating all baselines in the trade-off between misalignment-reduction and task-preservation. The last is a novel political-bias experiment, where fine-tuning on right-skewed Reddit financial-advice data causes political-lean drift on unrelated topics. Here our method reduces drift by more than half, while improving financial task performance, beating all baselines.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。