Manuscript Offprint

arXiv:2610.06670

Reward Stealing Attack on Large Language Models

Jiaming Qian, Pengyang Zhou, Jiahe Xu, Chaochao Chen

Abstract

Adversarial attacks on Large Language Models (LLMs) aim to induce harmful content. However, existing methods suffer from high computational costs or strict model-pairing dependencies, limiting their scalability and transferability. We propose Reward Stealing Attack (ReSA), an adversarial attack framework that targets the latent safety reward underlying LLM alignment. ReSA employs maximum entropy inverse reinforcement learning to recover a proxy reward model solely from the aligned model's behavior. The extracted reward is then reversed at inference time to derive an adversarial policy, efficiently implemented via a reward-guided decoding mechanism. Experiments demonstrate that a single recovered reward generalizes across prompts and diverse models to reveal a fundamental alignment vulnerability, enabling ReSA to significantly outperform existing attacks in effectiveness and transferability. The code is available at https://github.com/GarminQ/ReSA.

1 Introduction

Large Language Models (LLMs) have demonstrated remarkable capabilities, yet their potential misuse for generating harmful or unethical content has raised serious concerns [1, 2]. To mitigate such risks, alignment techniques such as Reinforcement Learning from Human Feedback (RLHF) [3] and Reinforcement Learning with Verifiable Rewards (RLVR) [4] are widely adopted to constrain unsafe behaviors. Nevertheless, extensive red-teaming studies [5, 6] consistently show that even aligned LLMs remain vulnerable to advanced adversarial attacks. Consequently, red-teaming is essential to uncover LLM vulnerabilities and inform mitigation strategies for safer deployment.

Existing red-teaming strategies primarily follow two paradigms, including prompt manipulation attacks and contrastive decoding attacks (see Figure 1). Firstly, prompt manipulation attacks [5, 7, 8] craft adversarial prompts to exploit aligned LLMs' sensitivity to prompt phrasing. However, they are computationally expensive, requiring either intensive query-level optimization or exorbitant offline training to derive universal suffixes. Secondly, contrastive decoding attacks [9, 10] modify aligned LLM's token logits using logit contrasts between matched safe and unsafe models. However, they are model-pair dependent, requiring identical tokenizers and vocabularies. Taken together, these two paradigms either suffer from high computational costs or rely on strict model pairings, limiting their scalability and universality.

Figure

Figure 1: Comparison of LLM adversarial attacks. (a) Prompt manipulation attacks rely on computationally expensive iterative refinement for specific query. (b) Contrastive decoding attacks depend on logit contrasts between strictly matched safe and unsafe model pairs. (c) Reward Stealing Attack recovers the latent safety reward from an aligned LLM to derive a universal adversarial signal.

To address these limitations, we propose a paradigm shift that targets the latent reward mechanism underlying safety alignment in LLMs. Prevailing alignment methodologies, such as RLHF and RLVR, reshape the LLM output probability distribution [11], which can be viewed as being regulated by an underlying latent safety reward. While this reward is never explicitly exposed, it consistently governs output behavior across prompts and models. Recovering this latent safety reward would provide a universal attack signal, enabling adversarial manipulation without per-prompt optimization or matched model-pair dependence. This insight leads to our central research question: Can we recover the latent safety reward from an aligned LLM and exploit it as a universal primitive for adversarial manipulation?

In response to this question, we propose the Reward Stealing Attack (ReSA), an adversarial attack framework that first recovers the latent safety reward encoded in an aligned LLM and then reverses it to induce harmful generations. ReSA consists of two key stages. (1) Reward Extraction. We treat the safety-aligned LLM as an expert policy and collect trajectories by sampling its responses to harmful prompts. Using Maximum Entropy Inverse Reinforcement Learning (IRL) [12, 13], we recover a proxy safety reward that approximates the latent safety reward, without any access to the original reward model. (2) Adversarial Generation. Once the proxy safety reward is obtained, ReSA reverses the alignment objective to induce harmful generations. We formulate the attack as a constrained optimization problem and derive a closed-form adversarial policy that maximizes the negative safety reward. This policy is realized through a reward-guided decoding mechanism, which balances attack strength with linguistic coherence at inference time.

The key contributions of our work are as follows: (1) We are the first to propose a reward-stealing perspective on LLM red-teaming, where safety alignment reveals a latent safety reward in the model's output distribution, which can be recovered from model behavior. (2) We instantiate this perspective via ReSA, a two-stage framework that first recovers a proxy safety reward using Maximum Entropy IRL and then reverses it to drive adversarial generation through a reward-guided decoding mechanism. (3) We empirically demonstrate that this approach yields a transferable and effective attack primitive, consistently outperforming prompt manipulation attacks and contrastive decoding attacks across various models and alignment settings.

References (37)