Stepwise Alignment for Constrained Language Model Policy Optimization

Akifumi Wachi, Thien Q. Tran, Rei Sato, Takumi Tanabe, Youhei Akimoto

Introduction

Aligning Large Language Models (LLMs) with human values is a dual-objective task: models must be helpful (maximizing reward) while remaining safe (adhering to constraints). Traditionally, this has been approached through "Safe RLHF," a complex process that attempts to optimize both objectives simultaneously. However, this simultaneity often leads to instability and "exaggerated safety," where models refuse benign prompts.

The Challenge of Safe RLHF

The current state-of-the-art, Safe RLHF, treats alignment as a constrained optimization problem. It typically involves training separate reward and safety models, followed by PPO-Lagrangian optimization. This iterative loop is computationally expensive, highly sensitive to hyperparameters, and prone to training instabilities.

Comparison between the iterative Safe RLHF pipeline and the simplified, sequential SACPO approach.

The SACPO Methodology

SACPO (Stepwise Alignment for Constrained Policy Optimization) simplifies this process by decomposing the constrained problem into a sequence of simpler, unconstrained alignment steps.

Stepwise Alignment

Instead of balancing reward and safety in a single training run, SACPO performs alignment sequentially. A common pipeline involves:

  1. Helpfulness Alignment: Starting from a reference LM policy, the model is first aligned using reward data.
  2. Safety Alignment: The reward-aligned model then undergoes a second alignment phase using safety-specific data.

Algorithm Flexibility

A key advantage of SACPO is its compatibility with RL-free algorithms like Direct Preference Optimization (DPO) and Kahneman-Tversky Optimization (KTO). Because the steps are decoupled, researchers can choose the best algorithm for the available data. For instance, DPO can be used for paired preference data, while KTO can handle binary safety labels (Safe vs. Unsafe).

The SACPO workflow: sequential alignment for helpfulness and safety using RL-free algorithms.

Practical SACPO (P-SACPO)

To address the "scalarization fallacy"—the difficulty of picking a single weight for the reward-safety trade-off—the authors propose P-SACPO. This variant involves training a reward-aligned model and a safety-aligned model separately, then using linear weight averaging (model merging) to navigate the Pareto front. This allows for fine-tuning the safety-helpfulness balance without additional training.

Theoretical Foundations

SACPO is grounded in the "Commutative Property of Alignment." Theoretically, the order of alignment (reward then safety, or vice versa) should lead to the same optimal policy. While practical implementation shows minor differences due to model capacity, this insight justifies the sequential approach. Furthermore, the paper establishes mathematical upper bounds on safety violations and reward loss, proving that RL-free, stepwise methods are theoretically sound for constrained optimization.

Experimental Results

The authors evaluated SACPO using the Alpaca-7B model across several benchmarks, including PKU-SafeRLHF, AlpacaEval, and specialized red-teaming prompts.

  • Performance: SACPO variants consistently outperformed the Safe RLHF "Beaver" models. The DPO(H) → DPO(S) pipeline achieved higher win rates in both helpfulness and harmlessness.
  • Efficiency: Each alignment step required only about one hour on 8x A100 GPUs, significantly reducing the computational overhead compared to PPO-based methods.
  • Safety Calibration: SACPO models demonstrated a better balance, avoiding the "exaggerated safety" common in Safe RLHF. They were more likely to provide helpful answers to benign questions that other models might reflexively refuse.

Conclusion

By transforming a complex multi-objective optimization into a series of stable, single-objective tasks, SACPO provides a robust and accessible framework for LLM alignment. It demonstrates that Reinforcement Learning is not strictly necessary for handling constraints, paving the way for more efficient and reliable safety tuning in large-scale models. Future research will focus on scaling these findings to 70B+ parameter models and integrating the supervised fine-tuning (SFT) stage directly into the stepwise process.

Summary updated

BibTeX
@inproceedings{wachi2024stepwise,
  author = {Akifumi Wachi and Thien Q. Tran and Rei Sato and Takumi Tanabe and Youhei Akimoto},
  title = {{Stepwise Alignment for Constrained Language Model Policy Optimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=VrVx83BkQX},
}
Figure