Improving LLM safety alignment with dual-objective optimizationImproving LLM Safety Alignment with Dual-Objective Optimization
The researchers propose a safety alignment method with dual-objective optimization. Through gradient analysis, they point out that the widely deployed DPO loss function is unfavorable for refusal learning, and further decompose it into two objectives: robust refusal training and targeted forgetting of harmful knowledge, to improve robustness against jailbreak attacks, where robust refusal training also encourages refusal when the model has already generated some unsafe content. The method also introduces a reward-based token-level weighting mechanism to highlight key refusal tokens. The paper states that the approach significantly improves robustness against various jailbreak attacks such as prefilling, suffix, and multi-turn attacks in both in-distribution and out-of-distribution scenarios, and finds that jailbreak robustness is related to token distribution shift during training and to the internal representations of refusal and harmful tokens. Code is open-sourced at https://github.com/wicai24/DOOR-Alignment。