Safety Alignment Depth in Large Language Models: A Markov Chain Perspective
Ching-Chia Kao, Chia-Mu Yu, Chun-Shien Lu, Chu-Song Chen
TL;DR
This work reframes LLM safety as a Markov-chain problem by introducing safety depth, the designated refusal state at which generation of harmful content is prevented. It shows that iterative fine-tuning with a structured bias can render refusal states arbitrarily close to absorbing, providing formal guarantees for safe behavior. By incorporating cyclic group actions for data augmentation, the authors prove that safety depth bounds can be maintained under symmetry-induced perturbations, and that broader ensembles can compensate for shallower alignments. The combination of a theoretical foundation and empirical validation on toy chains and open-source LLMs offers a practical blueprint for designing scalable, robust safety mechanisms that complement existing alignment methods.
Abstract
Large Language Models (LLMs) are increasingly adopted in high-stakes scenarios, yet their safety mechanisms often remain fragile. Simple jailbreak prompts or even benign fine-tuning can bypass these protocols, underscoring the need to understand where and how they fail. Recent findings suggest that vulnerabilities emerge when alignment is confined to only the initial output tokens. Unfortunately, even with the introduction of deep safety alignment, determining the optimal safety depth remains an unresolved challenge. By leveraging the equivalence between autoregressive language models and Markov chains, this paper offers the first theoretical result on how to identify the ideal depth for safety alignment, and demonstrates how permutation-based data augmentation can tighten these bounds. Crucially, we reveal a fundamental interaction between alignment depth and ensemble width-indicating that broader ensembles can compensate for shallower alignments. These insights provide a theoretical foundation for designing more robust, scalable safety strategies that complement existing alignment approaches, opening new avenues for research into safer, more reliable LLMs.
