Manuscript Offprint

arXiv:2610.24945

Robust Direct Preference Optimization under Preference Label-Flip Attacks

Chenye Yang, Weiyu Xu, Lifeng Lai

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Chenye Yang

Department of Electrical and Computer Engineering

University of California, Davis

Davis, CA 95616, USA

cyyyang@ucdavis.edu

Weiyu Xu

Department of Electrical and Computer Engineering

University of Iowa

Iowa City, IA 52242, USA

weiyu-xu@uiowa.edu

Lifeng Lai

Department of Electrical and Computer Engineering

University of California, Davis

Davis, CA 95616, USA

lflai@ucdavis.edu

ABSTRACT

Direct Preference Optimization (DPO) is widely used for offline Reinforcement Learning from Human Feedback. However, recent works have shown that DPO can be easily manipulated by adversarial preference label flip attacks, which are specifically designed to mislead the learner toward an attacker-chosen target policy. To address this issue, we design robust DPO methods that can defend against such attacks. Building on the property that lable flips induce parameter-independent gradient shifts in log-linear DPO, we propose Trim-K Robust-DPO, which removes the K highest-impact pairs, and Soft-Trim-K Robust-DPO, which smoothly downweights them. We establish deterministic gradient perturbation bounds uniformly over all attack sets containing at most K flips, explicitly separating defense-induced bias from surviving attack effects. Under bounded-region assumptions, these bounds yield time-uniform parameter and policy deviation guarantees. We further quantify how quadratic regularization improves curvature while introducing additional bias. Experiments on Stanford Human Preferences, HH-RLHF, and UltraFeedback-Binarized validate our analysis.

1 INTRODUCTION

Reinforcement Learning from Human Feedback (RLHF) is a central approach for aligning the output of modern large models with human preferences when an explicit reward function is difficult to specify (Christiano et al., 2017; Ziegler et al., 2019; Ouyang et al., 2022; Bai et al., 2022; Casper et al., 2023). In the offline RLHF setting, the learner trains on a pre-collected dataset of pairwise preference comparisons (Xiong et al., 2023; Zhu et al., 2023), and Direct Preference Optimization (DPO) (Rafailov et al., 2023) has become especially popular among these approaches. DPO avoids separate reward modeling and RL-based policy optimization, and directly optimizes a preference-based objective over the policy under the Bradley-Terry model (Bradley & Terry, 1952).

However, this dependence on preference pairs of RLHF and DPO also introduces a security risk: corrupted comparisons can systematically mislead the learned policy (Casper et al., 2023). In particular, several recent papers (Wu et al., 2024a; Rando & Tramèr, 2023; Baumgärtner et al., 2024; Pathmanathan et al., 2024; Nika et al., 2025; Fu et al., 2025; Pathmanathan et al., 2025; Wu et al., 2025) have introduced adversarial preference attacks on offline RLHF. Unlike random preference noise caused by annotation errors and limited expert knowledge (Casper et al., 2023; Yan et al., 2024), the targeted adversarial attacker can strategically flip preference labels or inject poisoned comparisons, to mislead the learner toward an attacker-chosen target output policy. The label flip attack is practically plausible because it does not require injecting a large number of new preference pairs (Nika et al., 2025). Yang et al. (2026) formalizes this threat on DPO and develops efficient adversarial targeted attacks. The above security issue is serious since RLHF is widely used in real-world applications like Large Language Models (LLMs) (Bai et al., 2022), and a misled output might be biased, toxic, or even harmful (Casper et al., 2023; Rando & Tramèr, 2023; Pathmanathan et al., 2025).

To address this serious issue, in this paper, we design DPO algorithms robust to adversarial preference flip attacks. Unlike attacks on bandits or standard RL that manipulate numerical rewards, actions, contexts, or transition dynamics (Jun et al., 2018; Ma et al., 2018; Garcelon et al., 2020; Rakhsha et al., 2020; 2021; Liu & Lai, 2021b; Xu et al., 2022), preference corruption changes the preference order and then the optimized DPO policy. Existing robust RLHF/DPO studies mainly address random noise or distribution shift in preferences (Yan et al., 2024; Cheng et al., 2024; Mandal et al., 2024; Chowdhury et al., 2024; Wu et al., 2024b; Zhou et al., 2025; Kim et al., 2025; Xu et al., 2025). Our challenge is instead to analyze and mitigate strategically chosen label flips and their effect on the learned policy. To the best of our knowledge, this is the first work to design DPO algorithms robust against such adversaries.

Our analysis focuses on the log-linear DPO policy class, which enables us to analyze the problem in gradient space by a key observation Yang et al. (2026) that, flipping one preference pair shifts its per-sample DPO gradient by a parameter-independent vector. This property makes attack-impact magnitudes pre-computable before training, without knowing the actual attack strategy. Based on this structure, we design robust DPO methods that reduce the influence of samples whose flips would have large impact in the gradient space.

We propose Trim-K Robust-DPO, which removes the K highest-impact preference pairs and optimizes DPO on the retained set, and Soft-Trim-K Robust-DPO, which retains all pairs while smoothly downweighting the high-impact region. Both methods use interpretable pre-computed impact-based rules, and control potential flip-induced gradient effects without attempting to identify attacked samples. Soft-Trim-K provides a continuous family between standard DPO and Trim-K. For both methods, we establish gradient-bias bounds relative to full-data clean DPO uniformly over all fixed attack sets of at most K flips, explicitly separating the bias introduced by trimming or reweighting from surviving attack effects. Under the practical assumption that training stays in a bounded region around the reference parameter, these bounds yield time-uniform parameter and policy deviation guarantees for full-batch gradient descent. We also analyze quadratically regularized variants, quantifying the trade-off between increased curvature and additional bias relative to unregularized clean DPO.

We evaluate the methods on Stanford Human Preferences (SHP) (Ethayarajh et al., 2022), HH-RLHF (Bai et al., 2022; Ganguli et al., 2022), and UltraFeedback-Binarized (Cui et al., 2023). The SHP experiments compare our methods and their regularized variants with standard and robust DPO baselines under different attacks (Appendices I and J). Further experiments examine datasets and budgets, matched regularization and score controls, budget misspecification (Appendices K–N), and small nonlinear policies (Appendix O). The results illustrate the trade-offs in our analysis: hard trimming is most helpful when flips concentrate on high-impact pairs, soft trimming offers a smoother robustness–retention trade-off, and regularization can limit attack-induced deviation while introducing bias relative to clean DPO.

Main contributions: (1) We propose Trim-K and Soft-Trim-K Robust-DPO without attempting to identify the attacked samples. (2) We establish deterministic gradient-bias bounds relative to full-data clean DPO, uniformly over all fixed attack sets of at most K flips. (3) Under the stated assumptions, we derive time-uniform parameter and policy deviation guarantees and quantify the curvature gain and bias introduced by quadratic regularization. (4) We evaluate the methods on three preference datasets, with matched controls, score-assignment ablations, and attack-budget and misspecification studies. We also conduct preliminary experiments with small nonlinear policies.

Additional related work: Appendix A summarizes prior works on adversarial attacks and robust learning in bandits, RL, and RLHF.

References (100)

Couldn't load all references. Reload the page to try again.