Phi-3 Safety Post-Training: Aligning Language Models with a "Break-Fix" Cycle

Emman Haider, Daniel Perez-Becker, Thomas Portet, Piyush Madan, Amit Garg, David Majercak, Wen Wen, Dongwoo Kim, Ziyi Yang, Jianwen Zhang, Hiteshi Sharma, Blake Bullwinkel, Martin Pouliot, Amanda J. Minnich, Shiven Chawla, Solianna Herrera, Shahed Warreth, Maggie Engler, Gary Lopez, Nina Chikanov, Raja Sekhar Rao Dheekonda, Bolor-Erdene Jagdagdorj, Roman Lutz, Richard Lundeen, Tori Westerhoff, Pete Bryan, Christian Seifert, Ram Shankar Siva Kumar, Andrew Berkley, Alex Kessler · DOI

Abstract

Microsoft researchers detail the safety alignment process for the Phi-3 family of Small Language Models (SLMs). By employing an iterative "break-fix" cycle—alternating between aggressive red teaming and targeted post-training—they demonstrate that compact models (as small as 3.8B parameters) can achieve safety profiles comparable to or better than much larger models like Llama-3 and Mistral.

Introduction

As Small Language Models (SLMs) become capable enough to run locally on edge devices, ensuring their safety is paramount. Traditionally, the limited parameter count of SLMs suggested a "capability-safety tradeoff," where hardening a model against adversarial attacks might significantly degrade its utility. This work addresses the challenge of hardening models against jailbreaks, toxic content, and hallucinations through a systematic, multi-round approach to identify and patch vulnerabilities that only emerge after initial training.

Methodology: The "Break-Fix" Cycle

The core of the alignment strategy is the "Break-Fix" Cycle, an iterative five-stage framework designed to continuously improve the model's safety posture.

The iterative five-stage "Break-Fix" safety cycle framework.
  1. Safety Dataset Curation: Mixing public datasets with in-house synthetic data (refined by GPT-4) to cover specific harm areas.
  2. Safety Post-Training: Utilizing Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO) to instill safe behaviors.
  3. RAI Evaluations: Running Responsible AI benchmarks to select viable release candidates.
  4. AI Red Teaming (AIRT): Independent adversarial probing using tools like the Python Risk Identification Toolkit (PyRIT).
  5. Vulnerability Identification: Analyzing failures to inform the subsequent round of data curation.

Evaluation and Datasets

The researchers utilized a diverse suite of benchmarks to measure safety without sacrificing helpfulness:

  • XSTest: Evaluates the tension between IPRR (Inappropriate Prompt Refusal Rate) and VPRR (Valid Prompt Refusal Rate) to ensure the model doesn't become "over-aligned" (e.g., refusing to explain how to "kill" a computer process).
  • ToxiGen: A large-scale dataset for detecting implicit hate speech.
  • DecodingTrust: A comprehensive suite for toxicity, bias, and robustness.

For the Phi-3.5 models, the team expanded testing to multilingual contexts, specifically targeting Chinese, Spanish, and Dutch to ensure safety guardrails transferred across linguistic boundaries.

Key Results

The iterative cycle proved highly effective, demonstrating that parameter count is not the sole determinant of safety performance. On average, the cycle led to a 75% reduction in harmful content generation across categories such as hate speech, cyber attacks, and sexual content.

Impact of the red teaming and post-training cycle on high-risk response rates across various harm categories.

Notably, the 3.8B Phi-3-mini matched or exceeded the safety performance of the 8B Llama-3-Instruct and 7B Mistral models. All Phi-3 variants outperformed Mistral-7B and Gemma-7B on the ToxiGen benchmark, showing a superior ability to detect and avoid toxic generations.

Discussion and Limitations

Despite these advancements, the researchers identified ongoing challenges. Models remain susceptible to "Crescendo-like" attacks—long, multi-turn conversations that gradually lead the model into a jailbroken state. Furthermore, while safety training in English provides a baseline for other languages, cultural nuances and linguistic gaps remain. Future research will focus on automated red teaming and developing better metrics for monitoring drift in long-form conversations.

Summary updated

BibTeX
@misc{haider2024phi,
  author = {Emman Haider and Daniel Perez-Becker and Thomas Portet and Piyush Madan and Amit Garg and David Majercak and Wen Wen and Dongwoo Kim and Ziyi Yang and Jianwen Zhang and Hiteshi Sharma and Blake Bullwinkel and Martin Pouliot and Amanda J. Minnich and Shiven Chawla and Solianna Herrera and Shahed Warreth and Maggie Engler and Gary Lopez and Nina Chikanov and Raja Sekhar Rao Dheekonda and Bolor-Erdene Jagdagdorj and Roman Lutz and Richard Lundeen and Tori Westerhoff and Pete Bryan and Christian Seifert and Ram Shankar Siva Kumar and Andrew Berkley and Alex Kessler},
  title = {{Phi-3 Safety Post-Training: Aligning Language Models with a "Break-Fix" Cycle}},
  year = {2024},
  eprint = {2407.13833},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.13833},
}
Figure