Manuscript Offprint

arXiv:2609.05794

Bait-and-Recover: Poisoning Internal Refusal Signals to Defend LLMs against White-Box Editing Jailbreaks

Tian Gao, Zhipeng Xie, Yuhao Wu, Junhua Liu, Xin Fang

Abstract

Open-weight large language models face a low-cost white-box threat from representation engineering attacks. Attackers can estimate refusal directions and search for projection-matrix edits that suppress safety alignment while preserving general capabilities, within minutes on a single GPU and without gradient-based training. We propose Bait-and-Recover, a weight-level defense that places a bait adapter where attackers read activations and a paired recovery adapter at the subsequent layer. Trained via gradient routing, this decouples the observation path from the behavior path. By actively poisoning the residual signal used for measurement, Bait-and-Recover disrupts the attacker's edit search, while the recovery layer restores clean downstream computation. Across four open-weight models, our defense raises the minimum refusal rate against white-box edit searches from 16.25% to 71.75% under a strict behavior-preservation budget (KL ≤ 0.10), with negligible impact on general benchmarks. By invalidating the core measurement assumption of these attacks, observation-path poisoning offers a practical complement to behavior-level safety training.

1 Introduction

The public release of large language models (LLMs) (Yang et al., 2025; Gemma Team, 2025) provides direct transparency into safety alignment, but simultaneously exposes these models to adversarial weight editing (Meng et al., 2022, 2023). A recent family of white-box jailbreaks, exemplified by Heretic (Weidmann, 2025), treats safety-aligned refusal as a representation-engineering target (Zou et al., 2023a; Arditi et al., 2024): estimate the residual direction that separates harmful and harmless prompts, then search for weight edits that suppress that direction while preserving the model's general capabilities. Unlike prompt-level jailbreaks (Zou et al., 2023b; Ren et al., 2025), this white-box at-

tack requires no crafted suffix: the attacker reads the model's internal computation, edits projection matrices in place, and keeps the best edit found within a strict behavior-preservation budget.

This targeted editing method is a low-cost, broadly applicable threat to open-weight releases. Full-parameter or LoRA-based (Hu et al., 2022) fine-tuning attacks against safety alignment require substantially more compute and often degrade general capabilities if not carefully controlled. By contrast, a Heretic-style edit search executes in minutes on a single GPU and yields an edited checkpoint that suppresses refusal while retaining normal behavior on benign prompts. Once redistributed, such checkpoints are difficult for the original defender to recall or patch. The practical defense point therefore shifts to the released weights themselves: protection must be embedded directly in the checkpoint before distribution.

This attack also exposes a gap in existing safety mechanisms. Safety fine-tuning, preference optimization, runtime filters, and activation-level defenses (Ouyang et al., 2022; Rafailov et al., 2023; Zou et al., 2024) constrain the model's output behavior, but leave the internal refusal representations unprotected against measurement and editing. A white-box edit attack succeeds only when two conditions are met: the attacker must be able to observe an internal signal correlated with refusal, and editing against that signal must predictably alter the output behavior. Decoupling these two components is therefore a natural defense target: actively poison the internal signal to blind the attacker's measurement, while preserving the clean downstream computation and outputs.

We formalize this idea as observation–behavior path decoupling and implement it via Bait-and-Recover. Let ℓ\ell denote a selected bait layer, and index residual streams so that layer ℓ\ell writes to rℓ+1r_{\ell+1}. Our defense places a bait adapter inside layer ℓ\ell, making the poisoned signal visible at the attacker's readout rℓ+1r_{\ell+1}, and a paired recovery adapter inside the following layer ℓ+1\ell+1, repairing the downstream residual rℓ+2r_{\ell+2}. The intended state is deliberately asymmetric: the attacker's search uses a corrupted readout, while generation continues from a near-clean downstream residual.

Contributions. By invalidating the core measurement assumption of representation engineering attacks, our work offers a weight-level complement to behavior-level safety training. Concretely:

  1. We formulate observation–behavior path decoupling as an explicit defense objective for white-box jailbreaks, shifting the focus from constraining outputs to poisoning the attacker's internal measurement step.

  2. We propose a cross-layer bait/recovery design with a gradient-routing rule that successfully decouples the two paths during training, preventing recovery pressure from erasing the bait.

  3. Across four open-weight models, the defense raises the mean minimum refusal rate against Heretic searches spanning both global and per-layer direction scopes under a strict behavior-preservation budget (KL ≤\leq 0.10) from 16.25% to 71.75%, with negligible impact on general capability benchmarks.