Skip to main content
QUICK REVIEW

[Paper Review] Latent Adversarial Training Improves Robustness to Persistent Harmful Behaviors in LLMs

Abhay Sheshadri, Aidan Ewart|arXiv (Cornell University)|Jul 22, 2024
Adversarial Robustness in Machine LearningComputer Science3 citations
TL;DR

This paper introduces targeted latent adversarial training (LAT), a method that enhances LLM robustness against persistent harmful behaviors by perturbing specific latent activations to elicit undesirable outputs during fine-tuning. It significantly improves defense against jailbreaks, backdoor removal, and knowledge unlearning with minimal compute trade-offs, outperforming strong baselines like R2D2 and DPO in multiple settings.

ABSTRACT

Large language models (LLMs) can often be made to behave in undesirable ways that they are explicitly fine-tuned not to. For example, the LLM red-teaming literature has produced a wide variety of 'jailbreaking' techniques to elicit harmful text from models that were fine-tuned to be harmless. Recent work on red-teaming, model editing, and interpretability suggests that this challenge stems from how (adversarial) fine-tuning largely serves to suppress rather than remove undesirable capabilities from LLMs. Prior work has introduced latent adversarial training (LAT) as a way to improve robustness to broad classes of failures. These prior works have considered untargeted latent space attacks where the adversary perturbs latent activations to maximize loss on examples of desirable behavior. Untargeted LAT can provide a generic type of robustness but does not leverage information about specific failure modes. Here, we experiment with targeted LAT where the adversary seeks to minimize loss on a specific competing task. We find that it can augment a wide variety of state-of-the-art methods. First, we use targeted LAT to improve robustness to jailbreaks, outperforming a strong R2D2 baseline with orders of magnitude less compute. Second, we use it to more effectively remove backdoors with no knowledge of the trigger. Finally, we use it to more effectively unlearn knowledge for specific undesirable tasks in a way that is also more robust to re-learning. Overall, our results suggest that targeted LAT can be an effective tool for defending against harmful behaviors from LLMs.

Motivation & Objective

  • To address the persistent challenge of harmful behaviors in LLMs that resist standard fine-tuning and adversarial training.
  • To improve robustness to jailbreaks, backdoors, and unwanted knowledge without sacrificing performance on standard tasks.
  • To develop a method that more effectively removes neural circuitry responsible for harmful behaviors by targeting specific latent representations.
  • To demonstrate that targeted LAT can be combined with and enhance existing state-of-the-art techniques in alignment and safety.
  • To reduce the risk of re-learning previously unlearned knowledge, improving long-term robustness.

Proposed method

  • The method applies targeted latent-space perturbations to activate specific failure modes (e.g., harmful responses, backdoor triggers) during fine-tuning.
  • Perturbations are applied to the residual stream of the LLM’s transformer layers, specifically targeting the latent representations associated with undesirable behaviors.
  • The model is fine-tuned under these adversarial latent perturbations to minimize loss on the target task, thereby strengthening robustness to the specific failure mode.
  • The approach is compatible with and enhances existing methods such as refusal training, DPO, WHP, gradient ascent, and RMU for unlearning.
  • It uses low-rank adaptation (LoRA) for efficient fine-tuning and applies attacks to layers just before the RMU activation matching layer for optimal performance.
  • The method is evaluated across three tasks: jailbreak resistance, backdoor removal without trigger access, and unlearning of specific knowledge.
Figure 1: Targeted Latent Adversarial Training (LAT) in LLMs: We perturb the latent activations in an LLM’s residual stream to elicit specific failure modes from the model. Then, we fine-tune LLMs on the target task under these perturbations. We use this approach to improve robustness to jailbreaks
Figure 1: Targeted Latent Adversarial Training (LAT) in LLMs: We perturb the latent activations in an LLM’s residual stream to elicit specific failure modes from the model. Then, we fine-tune LLMs on the target task under these perturbations. We use this approach to improve robustness to jailbreaks

Experimental results

Research questions

  • RQ1Can targeted LAT improve robustness to jailbreaks more effectively than existing methods like R2D2 with significantly less compute?
  • RQ2Can targeted LAT enable effective backdoor removal when the trigger is unknown and the trigger pattern is not explicitly provided?
  • RQ3Can targeted LAT enhance the robustness of knowledge unlearning methods, reducing the likelihood of re-learning suppressed knowledge?
  • RQ4How does targeted LAT compare in performance and efficiency to untargeted LAT and standard adversarial training in mitigating persistent harmful behaviors?
  • RQ5Does targeted LAT preserve model performance on standard, non-adversarial tasks while improving safety?

Key findings

  • Targeted LAT outperforms the R2D2 baseline in resisting jailbreaks with orders of magnitude less compute, demonstrating superior sample efficiency.
  • The method successfully removes backdoors from LLMs even when the trigger is unknown and only vaguely specified, solving the 'Sleeper Agent' problem identified in prior work.
  • Targeted LAT improves the robustness of knowledge unlearning methods such as WHP, gradient ascent, and RMU, significantly reducing the sample efficiency of re-learning previously unlearned knowledge.
  • The approach maintains strong performance on standard, non-adversarial tasks, indicating no significant trade-off with typical model capabilities.
  • Applying latent perturbations to the layer just before the RMU activation matching layer yields the greatest improvement, suggesting optimal layer selection is critical.
  • The method is compatible with and enhances multiple existing alignment techniques, demonstrating broad applicability across safety and alignment tasks.
Latent Adversarial Training Improves Robustness to Persistent Harmful Behaviors in LLMs

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.