arXiv:2606.19168cs.AIcs.LG2026-06

在预训练阶段插入安全反思,让大模型学会自我监控。

Beyond Safe Data: Pretraining-Stage Alignment with Regular Safety Reflection

论文配图:Beyond Safe Data: Pretraining-Stage Alignment with Regular Safety Reflection
图 1 · 摘自论文原文
  • 在预训练数据中定期加入简短安全反思,嵌入自检能力。
  • 实测可提升安全分类准确率,大幅降低攻击成功率。
  • 适合关注模型内在安全机制的开发者与研究者。

为实现大语言模型更深层的安全对齐,现有方法多通过过滤或重写不安全数据将安全干预前置至预训练阶段。我们指出,预训练阶段对齐不应仅限于确保数据安全:模型可能从看似无害的知识中组合出不安全行为。为此,提出安全反思预训练(Safety Reflection Pretraining),在预训练语料中定期插入简短安全反思,将自我监控能力直接融入语言建模,为后续后训练阶段强化奠定基础。在基于FineWeb-Edu的17亿参数模型上实验表明,该方法显著提升安全分类准确率,并大幅降低推理阶段与微调攻击的成功率。此外,构建可控合成环境MedSafetyWorld,定义清晰安全边界与推理结构,使模型能从安全数据中泛化出不安全行为。消融实验进一步验证,相比数据过滤与重写,安全反思预训练在防止模型基于安全数据泛化出不安全行为方面具有明显优势。结果表明,预训练对齐不仅需确保数据安全,还需塑造模型从安全数据中可能习得的行为模式。

原文摘要 · Abstract (English)

To achieve deeper safety alignment for large language models (LLMs), recent efforts have studied how to push safety interventions earlier into the pretraining stage, primarily by filtering unsafe data or rewriting it into safer forms. We argue that pretraining-stage alignment should go beyond making the data safe: LLMs may compose seemingly benign knowledge and capabilities into unsafe behaviors. To this end, we propose Safety Reflection Pretraining, a pretraining-stage alignment method which regularly inserts short safety reflections into pretraining corpora to integrate self-monitoring directly into language modeling, establishing a foundational capability that is subsequently reinforced by compatible post-training. Our experiments with 1.7B models pretrained on FineWeb-Edu show that Safety Reflection Pretraining improves safety classification accuracy and substantially reduces the success rates of inference-stage and finetuning attacks. Complementary to our real-world experiments, we also introduce a fully controlled synthetic environment, MedSafetyWorld, with a clear definition of safety and a reasoning structure under which models can easily generalize unsafe behaviors from safe data. Ablations in MedSafetyWorld further demonstrate a clear advantage of Safety Reflection Pretraining in preventing models from acting on unsafe behaviors generalized from safe data, compared with data filtering and rewriting. Taken together, our findings suggest that pretraining alignment should not only make the training data safe, but also shape the behaviors that models are likely to acquire from safe data.

安全对齐预训练自检机制

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