The Art of (Mis)alignment: How Fine-Tuning Methods Effectively Misalign and Realign LLMs in Post-Training

Rui Zhang, Hongwei Li, Yun Shen, Xinyue Shen, Wenbo Jiang, Guowen Xu, Yang Liu, Michael Backes, Yang Zhang

TL;DR

This paper explores the adversarial dynamics of LLM safety by evaluating how different fine-tuning methods can be used to deliberately "misalign" (make unsafe) and subsequently "realign" (restore safety) open-source models. The authors reveal a striking mechanism asymmetry between attack and defense: Odds Ratio Preference Optimization (ORPO) is the most potent method for stripping safety guardrails, while Direct Preference Optimization (DPO) excels at restoring them.

What Problem Does This Paper Address?

Modern large language models (LLMs) undergo extensive safety alignment before release to ensure they refuse harmful requests. However, the exact same post-training fine-tuning techniques used to make models safe can be exploited by adversaries to inject malicious behaviors—a process known as misalignment. These compromised models can then be distributed on open platforms, posing severe supply-chain risks.

To counter this, defenders and service providers must perform realignment on untrusted third-party models before deployment. This paper addresses the dual-use nature of alignment techniques, answering two pivotal questions: Which fine-tuning methods are most effective for malicious misalignment, and what is their subsequent impact on defensive realignment?

Methods

The authors design a comprehensive evaluation workflow to simulate a multi-round game between attackers and defenders:

Figure 1: Overview of evaluation workflow.

They evaluate four popular safety-aligned open-source LLMs: Llama-3.1-8B-Instruct, GLM-4-9B-Chat, Gemma-2-9B-it, and Mistral-7B-Instruct-v0.3.

The study compares six fine-tuning techniques split into two paradigms:

  1. Supervised Fine-Tuning (SFT): LoRA, QLoRA, AdaLoRA, and IA3.
  2. Preference Fine-Tuning (PFT): DPO and ORPO.

To understand the internal mechanics of how these methods alter model behavior, the authors employ the Logit Lens technique, visualizing intermediate token decoding trajectories across the hidden layers of the models.

Datasets

  • MisQA (New Dataset): Introduced specifically for safety misalignment, containing 390 unsafe questions across 13 categories. Each question is paired with an unsafe response (synthesized via jailbreak prompts on ChatGPT) and a safe refusal response.
  • safe-rlhf & hh-rlhf: Standard open-source preference datasets downsampled to balanced subsets (950 and 500 samples, respectively) to simulate the defender's realignment data.
  • Evaluation Dataset: A clean test set of 1,900 unsafe questions compiled from benchmarks like XSTEST, AdvBench, SafeBench, and Do-Not-Answer, deduplicated against the training data to prevent contamination.

Key Insights and Ideas

  • Asymmetry of Attack and Defense: The best method for attacking a model is not the best method for defending it. ORPO is exceptionally potent for misalignment because its joint SFT/PFT objective actively overwrites safety guardrails with harmful concepts. Conversely, DPO shines in realignment because its margin-based pairwise objective optimizes for general harmlessness without forcing strict token imitation, making it more robust across diverse prompts.
  • Gemma2’s Selective Resistance: Gemma-2-9B-it proved highly resilient against all SFT-based misalignment attacks. However, it remained completely vulnerable to ORPO, proving that robust base safeguards can still be bypassed by advanced preference-based optimization.
  • Extreme Data Efficiency in Attacks: For models like Llama3.1 and GLM4, LoRA requires shockingly little data to break safety. Using just 1 sample per category (13 total samples) was enough to successfully misalign the models.
  • The Attrition of Continuous Warfare: When models undergo iterative cycles of misalignment and realignment, general model utility steadily degrades. Over successive rounds, it becomes progressively harder for both attackers to misalign and defenders to realign the model.
  • Mechanistic Differences (Logit Lens): Logit Lens analysis showed that ORPO fundamentally reconfigures the model's internal processing path, decoding explicit unsafe tokens (e.g., strangle, rope) early in the deep layers. DPO, on the other hand, merely suppresses refusal intensity, shifting outputs from explicit apologies to hesitation tokens (e.g., not, sure).

Key Results

  • Misalignment Potency: ORPO achieved the highest average unsafety score of 0.75 across all models (up from a baseline average of 0.28), effectively compromising even the highly resistant Gemma2 model.
Figure 2: Model unsafety scores following misalignment.
  • Utility Trade-offs: While LoRA and QLoRA successfully misaligned models, they caused a noticeable drop in general model utility due to a degradation in instruction-following capabilities. ORPO and DPO preserved utility much better during the attack phase.
  • Realignment Success: During defensive realignment, DPO achieved the strongest safety recovery across most models. However, this defense came at a high cost to model utility, causing a notable decline in general capabilities for Llama3.1.
Figure 3: Unsafety scores across 10 categories. We use grey (filled) and red (outlined) polygons to indicate unsafety levels of baseline and misaligned LLMs. A larger occupied area indicates lower model safety.

Limitations and Future Work

  • Exclusion of RLHF (PPO): The authors did not explore Reinforcement Learning with Human Feedback due to its massive computational overhead and the high cost of gathering human preference data.
  • LLM-as-a-Judge Constraints: Safety evaluation relied on a majority-vote consensus from three guard models (Llama-Guard-2, Llama-Guard-3, GPT-4o-mini), which inherits the systematic classification biases of those models.
  • Simplified Adversarial Dynamics: The study assumes a clean, alternating turn-based interaction between a single attacker and defender, whereas real-world open-source environments involve multiple chaotic actors.
  • Proprietary Models: Due to legal and API restrictions, the interplay could not be tested on closed-source commercial models.

Summary updated

BibTeX
@inproceedings{zhang2026art,
  author = {Rui Zhang and Hongwei Li and Yun Shen and Xinyue Shen and Wenbo Jiang and Guowen Xu and Yang Liu and Michael Backes and Yang Zhang},
  title = {{The Art of (Mis)alignment: How Fine-Tuning Methods Effectively Misalign and Realign LLMs in Post-Training}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.findings-acl.164},
}
Figure