arXiv:2606.00160cs.CRcs.AI2026-06被引 1

发现良性数据中隐藏的安全风险,高效识别有害样本。

DataShield: Safety-degrading Data Filtering for LLM Benign Instruction Fine-Tuning

论文配图:DataShield: Safety-degrading Data Filtering for LLM Benign Instruction Fine-Tuning
图 1 · 摘自论文原文
  • 通过模型响应一致性量化每条数据的安全风险得分。
  • 在多个大模型上验证,能准确区分高风险与低风险数据。
  • 适合关注数据安全的模型训练者和评测人员。

大型语言模型(LLMs)在使用良性数据集微调后仍会出现安全能力下降问题。现有方法在识别良性数据中的安全退化样本时存在计算成本高、噪声大等问题。本文提出DataShield,高效精准地识别潜在安全退化样本。核心思路是:良性微调会提升模型整体响应一致性,因此可将每条数据对模型一致性的影响作为其安全退化得分。方法包含三个部分:(1) 响应一致性向量提取,捕捉模型行为倾向;(2) 新型一致性感知评分(CAS),自动定位关键安全层;(3) 安全退化样本过滤,通过数据在一致性方向上的投影偏移量判断风险。在Llama3-8B、Llama3.1-8B和Qwen2.5-7B上使用Alpaca与Dolly数据集的实验表明,该方法可有效识别高风险与低风险数据子集。此外发现,开放式问答任务更易引发安全退化,相关回复也更长。代码已开源。

原文摘要 · Abstract (English)

Large language models (LLMs) suffer from degraded safety capabilities even when fine-tuned with benign datasets. However, existing methods for identifying safety-degrading samples in benign datasets suffer from high computational costs and significant noise issues. In this paper, we propose DataShield to efficiently and effectively identify potential safety-degrading samples. Our key intuition is based on the observation that benign fine-tuning increases the overall response compliance of LLMs. DataShield's key technical insight is to quantify each sample's contribution to the model's compliance behavior as its safety degradation score. DataShield consists of three core components: (1) Compliance Vector Extraction, which captures the LLM's compliance behavior tendency; (2) a novel Compliance-Aware Score (CAS), which automatically identifies the optimal safety-critical layer; and (3) Safety-degrading Sample Filtering, which quantifies the projection shift of training data along the compliance direction. Extensive experimental evaluation on Llama3-8B, Llama3.1-8B, and Qwen2.5-7B using the Alpaca and Dolly benign datasets validates our method's effectiveness in identifying high-risk and low-risk data subsets. We also observe that open-ended question answering is more likely to trigger safety degradation, and corresponding responses tend to be longer. We hope this work can provide new insights into data-centric defense methods. The source code is available at: https://github.com/ZJunBo/DataShield.

数据安全模型微调风险检测

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。