Robustifying Safety-Aligned Large Language Models through Clean Data Curation
Open accessThe DOI matches its DataCite record; 10 of the 10 references it cites were found in a registry or an index.
Abstract
Large language models (LLMs) are vulnerable when trained on datasets containing harmful content, which leads to potential jailbreaking attacks in two scenarios: the integration of harmful texts within crowdsourced data used for pre-training and direct tampering with LLMs through fine-tuning. In both scenarios, adversaries can compromise the safety alignment of LLMs, exacerbating malfunctions. Motivated by the need to mitigate these adversarial influences, our research aims to enhance safety alignment by either neutralizing the impact of malicious texts in pre-training datasets or increasing the difficulty of jailbreaking during downstream fine-tuning. In this paper, we propose a data curation framework designed to counter adversarial impacts in both scenarios. Our method operates under the assumption that we have no prior knowledge of attack details, focusing solely on curating clean texts. We introduce an iterative process aimed at revising texts to reduce their perplexity as perceived by LLMs, while simultaneously preserving their text quality. By pre-training or fine-tuning LLMs with curated clean texts, we observe a notable improvement in LLM robustness regarding safety alignment against harmful queries. For instance, when pre-training LLMs using a crowdsourced dataset containing 5\% harmful instances, adding an equivalent amount of curated texts significantly mitigates the likelihood of providing harmful responses in LLMs and reduces the attack success rate by 71\%. Our study represents a significant step towards mitigating the risks associated with training-based jailbreaking and fortifying the secure utilization of LLMs.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
In the citing paper
“One effective approach is to conduct curation during LLMs' pre-training process (Liu et al. 2024); another approach is to add safety filters in LLMs' API (Li et al. 2024, p. 24).”
From Content moderation by LLM: from accuracy to legitimacy (2025) · cites this paper as Liu et al. 2024
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
LLaMA: Open and Efficient Foundation Language Models
Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., Azhar, F., et al. (2023) · arXiv · doi:10.48550/arxiv.2302.13971 · Cited by 4,602
AUTOVC: Zero-Shot Voice Style Transfer with Only Autoencoder Loss
Qian, K., Zhang, Y., Chang, S., Yang, X., & Hasegawa-Johnson, M. (2019) · arXiv · doi:10.48550/arxiv.1905.05879 · Cited by 336 · cited 1×
“However, unlike tasks such as machine translation [45, 53] and style transfer [36, 38, 40], it is infeasible for us to train an end-to-end generator with a lack of supervision regarding the characteristics of low-perplexity texts.”
BackgroundLeveraging large language models for decision support in personalized oncology
Benary, M., Wang, X. D., Schmidt, M., Soll, D., Hilfenhaus, G., Nassir, M., Sigler, C., Knödler, M., Keller, U., Beule, D., et al. (2023) · JAMA Network Open · doi:10.1001/jamanetworkopen.2023.43689 · Cited by 306 · cited 1×
“…training-based jailbreaking could impact the development of LLMs: Scenario I: Integration of Harmful Texts in Pre-training In domains requiring expert knowledge, such as clinical decision-making [7, 48], LLMs are pre-trained with crowdsourced data to enhance their proficiency in complex tasks.”
BackgroundInferFix: End-to-End Program Repair with LLMs
Jin, M., Shahriar, S., Tufano, M., Shi, X., Lu, S., Sundaresan, N., & Svyatkovskiy, A. (2023) · Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering · doi:10.1145/3611643.3613892 · Cited by 191
(2024) · doi:10.1145/3704435 · Cited by 184
A General Language Assistant as a Laboratory for Alignment
Askell, A., Bai, Y., Chen, A., Drain, D., Ganguli, D., Henighan, T., Jones, A., Joseph, N., Mann, B., DasSarma, N., et al. (2021) · arXiv · doi:10.48550/arxiv.2112.00861 · Cited by 146 · cited 1×
“One approach involves incorporating aligning prompts, which inject helpful, honest, and harmless prompts into the model to enhance alignment [6].”
BackgroundExamining Zero-Shot Vulnerability Repair with Large Language Models
Pearce, H., Tan, B., Ahmad, B., Karri, R., & Dolan-Gavitt, B. (2023) · 2023 IEEE Symposium on Security and Privacy (SP) · doi:10.1109/sp46215.2023.10179324 · Cited by 131 · cited 3×
“…e r p l ex it y Figure 4: Perplexity variation with changes in temperature and top-p, measured on a randomly selected (query, response) pair using Llama-3-8B. decision-making process of LLMs, impacting their word generation capabilities and their ability to tackle more intricate tasks [37, 59, 11].”
BackgroundMethodChatGPT, Bard, and large language models for biomedical research: opportunities and pitfalls
Thapa, S., & Adhikari, S. (2023) · Annals of Biomedical Engineering · doi:10.1007/s10439-023-03284-0 · Cited by 111 · cited 1×
“…training-based jailbreaking could impact the development of LLMs: Scenario I: Integration of Harmful Texts in Pre-training In domains requiring expert knowledge, such as clinical decision-making [7, 48], LLMs are pre-trained with crowdsourced data to enhance their proficiency in complex tasks.”
BackgroundBeaverTails: Towards Improved Safety Alignment of LLM via a Human-Preference Dataset
Ji, J., Liu, M., Dai, J., Pan, X., Zhang, C., Bian, C., Zhang, C., Sun, R., Wang, Y., & Yang, Y. (2023) · arXiv · doi:10.48550/arxiv.2307.04657 · Cited by 88
RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Models
Gehman, S., Gururangan, S., Sap, M., Choi, Y., & Smith, N. A. (2020) · arXiv · doi:10.48550/arxiv.2009.11462 · cited 1×
“Previous research has underscored the significance of filtering and cleaning training data [8, 16], as well as the necessity of controlling biases and preventing harmful outputs [21, 19].”
Background
Cited by
Content moderation by LLM: from accuracy to legitimacy
Huang, T. (2025) · Artificial Intelligence Review · doi:10.1007/s10462-025-11328-1 · Cited by 24
“One effective approach is to conduct curation during LLM’s pretraining process ([71]); another approach is to add safety filters in LLM’s API ([70], 24).”
BackgroundOpen technical problems in open-weight ai model risk management
Casper, S., O'Brien, K., Longpre, S., Seger, E., Klyman, K., Bommasani, R., Nrusimha, A., Shumailov, I., Mindermann, S., Basart, S., et al. (2025) · doi:10.2139/ssrn.5705186 · Cited by 3
Metadata
- Authors
- Liu, X., Liang, J., Ye, M., & Xi, Z.
- Affiliations
- Stony Brook University (US)
- University of Iowa (US)
- Binghamton University (US)
- Venue
- arXiv
- Publisher
- arXiv
- Published
- 2024
- ISSN
- 2331-8422 (ISSN-L)
- arXiv
- 2405.19358
- OpenAlex
- W4399251489
- Semantic Scholar
- c443c05601c91ab9bbe45283846eccee3eb80d74
- Cited by
- 1
- References
- 10
- Citations by year
- 2024: 1
- Type
- posted content
- Language
- en
- Open access
- green
- arxiv.org
- Licence
- Locations
- arXiv (Cornell University) (submittedVersion, cc-by)
- arXiv (Cornell University) (cc-by)
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Adversarial Robustness in Machine Learning
- Physical Sciences › Computer Science › Artificial Intelligence › Hate Speech and Cyberbullying Detection
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Keywords
- large language models, safety alignment, data curation, jailbreak attacks, fine-tuning, LLM robustness, perplexity reduction
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.