Constrained Language Model Policy Optimization via Risk-aware Stepwise Alignment

Lijun Zhang, Lin Li, Wei Wei, Yajie Qi, Huizhong Song, Jun Wang, Yaodong Yang, Jiye LiangarXiv 2025 · DOI

Abstract

Aligning large language models (LLMs) with human values often involves a trade-off between helpfulness and harmlessness. Traditional methods typically optimize for average-case safety, potentially ignoring rare but catastrophic "tail risks." This paper introduces Risk-aware Stepwise Alignment (RSA), a framework that incorporates nested risk measures like Conditional Value-at-Risk (CVaR) into token-level training. By treating generation as a constrained optimization problem and employing a stepwise alignment process, RSA achieves a superior balance between utility and safety, effectively mitigating high-impact harmful behaviors without the typical pitfalls of over-refusal or performance degradation.

Introduction

Aligning Large Language Models (LLMs) with human values typically involves a tug-of-war between helpfulness—answering user prompts effectively—and harmlessness—refusing to generate dangerous content. Current state-of-the-art methods, such as Reinforcement Learning from Human Feedback (RLHF) or Direct Preference Optimization (DPO), are generally risk-neutral. They optimize for the expected (average) reward or safety.

However, a risk-neutral approach faces two significant challenges:

  1. Tail Risks: A model might be safe in most instances but occasionally produce "catastrophic" responses. Risk-neutral objectives often overlook these rare but high-impact outliers.
  2. Model Drift: Aggressive safety fine-tuning can lead to "model drift," where the model loses underlying reasoning capabilities or becomes prone to "over-refusal," rejecting even benign prompts.

The authors argue that safety is not just about the average case; it is about controlling worst-case scenarios.

Methodology: Risk-aware Stepwise Alignment (RSA)

The core innovation of this work is Risk-aware Stepwise Alignment (RSA), which embeds risk measures directly into the token-level training process.

Nested Risk Measures

Instead of optimizing for simple expected values, RSA utilizes "nested risk measures" such as Conditional Value-at-Risk (CVaR) or the Entropic Risk Measure (ERM). These mathematical tools allow the model to weigh the potential for high-impact negative outcomes more heavily during training, specifically targeting the "tail" of the distribution.

Token-Level Constrained Optimization

RSA treats the generation of each token as an action in a Constrained Markov Decision Process (CMDP). This enables the model to evaluate risk step-by-step as it constructs a response, rather than relying solely on a final, global safety score.

Stepwise Alignment

To avoid the "scalarization fallacy"—the assumption that reward and safety can be collapsed into a single scalar value—RSA employs a two-step process. It first aligns the model for reward (helpfulness) and subsequently performs a safety realignment. This sequential approach ensures the model maintains high utility while adhering to safety constraints.

Experimental Setup

The researchers evaluated RSA using several prominent benchmarks:

  • PKU-SafeRLHF-30K: 30,000 expert evaluations of helpfulness and harmlessness for training and testing.
  • AlpacaEval: Testing helpfulness on 129 non-harmful prompts.
  • Safe RLHF Red-Teaming: 83 prompts designed to trigger unsafe responses.
  • R-Judge: A multi-turn dialogue benchmark (569 interactions) testing safety in complex, adversarial conversations.

Results and Discussion

RSA demonstrates a significant improvement in the trade-off between helpfulness and harmlessness compared to existing baselines.

The Pareto frontier of helpfulness vs. harmlessness shows that RSA (labeled as RSCPO) achieves superior performance compared to Safe RLHF and SACPO.

Superior Pareto Frontier

In head-to-head win-rate tests, RSA consistently outperformed Safe RLHF and SACPO. As shown in the Pareto frontier analysis, RSA achieves higher helpfulness scores at equivalent levels of harmlessness compared to its competitors.

Tighter Safety Distributions

In red-teaming tests across various categories (e.g., crime, physical harm), RSA exhibited much tighter score distributions. This indicates that the model is not just "safer on average" but more consistent at avoiding high-risk failures.

Box plots of harmlessness scores across safety categories demonstrate that RSA provides tighter distributions and higher median safety scores compared to SFT and SACPO.

Multi-turn Success and Over-Refusal Mitigation

On the R-Judge benchmark, RSA (using CVaR) doubled the specificity of previous methods like SACPO. It proved far better at identifying actual attacks while reducing "false alarms" (refusing safe prompts). Because RSA is "stepwise," it learns how to be safe without sacrificing the reasoning capabilities required for helpfulness.

Conclusion

RSA addresses the critical need for risk-aware alignment in LLMs. By focusing on tail risks and employing a stepwise optimization strategy, it provides a robust framework for building safer, more reliable AI systems. Future work will explore scaling RSA to handle more complex, context-dependent, and conflicting safety constraints across larger model architectures.

Summary updated

BibTeX
@misc{zhang2025constrained,
  author = {Lijun Zhang and Lin Li and Wei Wei and Yajie Qi and Huizhong Song and Jun Wang and Yaodong Yang and Jiye Liang},
  title = {{Constrained Language Model Policy Optimization via Risk-aware Stepwise Alignment}},
  year = {2025},
  eprint = {2512.24263},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.24263},
}
Figure