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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhang, Junbo, Zhou, Qianli, Deng, Xinyang, Jiang, Wen, Pan, Jie, Zhu, Jinbiao
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914619482701824
author Zhang, Junbo
Zhou, Qianli
Deng, Xinyang
Jiang, Wen
Pan, Jie
Zhu, Jinbiao
author_facet Zhang, Junbo
Zhou, Qianli
Deng, Xinyang
Jiang, Wen
Pan, Jie
Zhu, Jinbiao
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2606_00160
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle DataShield: Safety-degrading Data Filtering for LLM Benign Instruction Fine-Tuning
Zhang, Junbo
Zhou, Qianli
Deng, Xinyang
Jiang, Wen
Pan, Jie
Zhu, Jinbiao
Cryptography and Security
Artificial Intelligence
Computation and Language
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.
title DataShield: Safety-degrading Data Filtering for LLM Benign Instruction Fine-Tuning
topic Cryptography and Security
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2606.00160