STAIR: Improving Safety Alignment with Introspective Reasoning

Yichi Zhang, Siyuan Zhang, Yao Huang, Zeyu Xia, Zhengwei Fang +5 more
2/14/2026

No official code found. Best implementation: thu-ml/STAIR (89 stars, MIT, last commit 2025-02-26).

Abstract

Ensuring the safety and harmlessness of Large Language Models (LLMs) has become equally critical as their performance in applications. However, existing safety alignment methods typically suffer from safety-performance trade-offs and the susceptibility to jailbreak attacks, primarily due to their reliance on direct refusals for malicious queries. In this paper, we propose STAIR, a novel framework that integrates SafeTy Alignment with Itrospective Reasoning. We enable LLMs to identify safety risks through step-by-step analysis by self-improving chain-of-thought (CoT) reasoning with safety awareness. STAIR first equips the model with a structured reasoning capability and then advances safety alignment via iterative preference optimization on step-level reasoning data generated using our newly proposed Safety-Informed Monte Carlo Tree Search (SI-MCTS). We further train a process reward model on this data to guide test-time searches for improved responses. Extensive experiments show that STAIR effectively mitigates harmful outputs while better preserving helpfulness, compared to instinctive alignment strategies. With test-time scaling, STAIR achieves a safety performance comparable to Claude-3.5 against popular jailbreak attacks. Relevant resources in this work are available at https://github.com/thu-ml/STAIR.

View on arXivView PDF

Code Implementations(1)

thu-ml/STAIRCommunity100%
MIT

Official codebase for "STAIR: Improving Safety Alignment with Introspective Reasoning"

897Shell, PythonFeb 4, 20251 years agoMIT

Similar Papers

Cite this paper

@article{zhang2026stair,
  title  = {STAIR: Improving Safety Alignment with Introspective Reasoning},
  author = {Yichi Zhang and Siyuan Zhang and Yao Huang and Zeyu Xia and Zhengwei Fang and Xiao Yang and Ranjie Duan and Dong Yan and Yinpeng Dong and Jun Zhu},
  year   = {2026},
  eprint = {2502.02384},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2502.02384},
  journal = {ICML 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.02384.svg)](https://codeofpaper.com/paper/2502.02384)

Discussion