Skip to main content
QUICK 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 Science被引用 3
一句话总结

本文提出了一种针对性的潜在对抗性训练(LAT)方法,通过扰动特定的潜在激活,在微调过程中诱发不良输出,从而增强大语言模型(LLM)对持续有害行为的鲁棒性。该方法在计算资源消耗极低的情况下,显著提升了对越狱攻击、后门移除和知识遗忘的防御能力,相较于R2D2和DPO等强基线方法,在多种设置下表现更优。

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.

研究动机与目标

  • 为解决大语言模型中持续存在的有害行为问题,这些行为对标准微调和对抗性训练具有抗性。
  • 在不牺牲标准任务性能的前提下,提升对越狱攻击、后门和 unwanted knowledge 的鲁棒性。
  • 通过针对性地作用于特定的潜在表征,更有效地移除负责有害行为的神经回路。
  • 证明针对性LAT可与现有最先进对齐与安全技术结合并加以增强。
  • 降低重新学习先前已遗忘知识的风险,从而提升长期鲁棒性。

提出的方法

  • 该方法在微调过程中对特定潜在空间扰动进行应用,以激活特定故障模式(例如有害响应、后门触发器)。
  • 扰动作用于大语言模型Transformer层的残差流,特别针对与不良行为相关的潜在表征。
  • 在这些对抗性潜在扰动下对模型进行微调,以最小化目标任务的损失,从而增强对特定故障模式的鲁棒性。
  • 该方法与现有技术(如拒绝训练、DPO、WHP、梯度上升和RMU知识遗忘)兼容,并能加以增强。
  • 采用低秩适应(LoRA)实现高效微调,并将攻击应用于RMU激活匹配层之前的层,以获得最佳性能。
  • 该方法在三个任务上进行了评估:越狱抵抗、无触发器访问条件下的后门清除,以及特定知识的遗忘。
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

实验结果

研究问题

  • RQ1与R2D2相比,针对性LAT是否能在显著更低的计算成本下更有效地提升对越狱攻击的抵抗能力?
  • RQ2当触发器未知且未明确提供触发模式时,针对性LAT是否能实现有效的后门清除?
  • RQ3针对性LAT是否能增强知识遗忘方法的鲁棒性,从而降低重新学习被抑制知识的可能性?
  • RQ4在缓解持续有害行为方面,针对性LAT与无差别LAT和标准对抗性训练相比,在性能和效率上表现如何?
  • RQ5针对性LAT是否在提升安全性的同时,保持了标准非对抗性任务上的模型性能?

主要发现

  • 与R2D2基线相比,针对性LAT在抵抗越狱攻击方面表现更优,且计算成本低一个数量级以上,展现出卓越的样本效率。
  • 该方法即使在触发器未知且仅以模糊方式描述的情况下,也能成功从大语言模型中清除后门,解决了先前工作中提出的“潜伏代理”(Sleeper Agent)问题。
  • 针对性LAT显著提升了WHP、梯度上升和RMU等知识遗忘方法的鲁棒性,大幅降低了重新学习先前已遗忘知识的样本效率。
  • 该方法在标准非对抗性任务上保持了强劲的性能,表明其与典型模型能力之间无显著权衡。
  • 在RMU激活匹配层之前的层应用潜在扰动可获得最大性能提升,表明层选择的优化至关重要。
  • 该方法与多种现有对齐技术兼容并能加以增强,展现出在安全与对齐任务中的广泛适用性。
Latent Adversarial Training Improves Robustness to Persistent Harmful Behaviors in LLMs

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。