Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Safety Pretraining: Toward the Next Generation of Safe AI

About

As large language models (LLMs) are increasingly deployed in high-stakes settings, the risk of generating harmful or toxic content remains a central challenge. Post-hoc alignment methods are brittle: once unsafe patterns are learned during pretraining, they are hard to remove. In this work, we present a data-centric pretraining framework that builds safety into the model from the start. Our framework consists of four key steps: (i) Safety Filtering: building a safety classifier to classify webdata into safe and unsafe categories; (ii) Safety Rephrasing: we recontextualize unsafe webdata into safer narratives; (iii) Native Refusal: we develop RefuseWeb and Moral Education pretraining datasets that actively teach model to refuse on unsafe content and the moral reasoning behind it, and (iv) Harmfulness-Tag annotated pretraining: we flag unsafe content during pretraining using a special token, and use it to steer model away from unsafe generations at inference. Our safety-pretrained models reduce attack success rates from 38.8\% to 8.4\% on standard LLM safety benchmarks with no performance degradation on general tasks.

Pratyush Maini, Sachin Goyal, Dylan Sam, Alex Robey, Yash Savani, Yiding Jiang, Andy Zou, Matt Fredrikson, Zacharcy C. Lipton, J. Zico Kolter• 2025

Related benchmarks

TaskDatasetResultRank
Instruction FollowingAlpacaEval
Win Rate38
423
Attack Success RateDirectHarm4
Attack Success Rate79.45
54
Adversarial AttackAdvBench
Attack Success Rate (ASR)55.56
16
Finetuning attack successGSM8K (benign)
ASR56
9
Finetuning attack successHarmful HEx-PHI (adversarial)
ASR84.92
9
Prefill AttackHEx-PHI Harmful
Attack Success Rate95.76
6
AutoDANHarmBench
Attack Success Rate6.25
3
General Knowledge and Language ComprehensionGeneral Understanding ARC-Easy, ARC-Challenge, CommonsenseQA, HellaSwag, OpenBookQA, PIQA
Overall Score51.73
3
Instruction FollowingIFEval
Strict Score13.12
3
Showing 9 of 9 rows

Other info

Follow for update