Skip to main content
QUICK REVIEW

[Paper Review] Defending Against Alignment-Breaking Attacks via Robustly Aligned LLM

Bochuan Cao, Yuanpu Cao|arXiv (Cornell University)|Sep 18, 2023
Natural Language Processing TechniquesComputer Science6 citations
TL;DR

This paper proposes Robustly Aligned LLM (RA-LLM), a defense mechanism that enhances existing aligned LLMs against alignment-breaking attacks by applying Monte Carlo sampling with random token dropping to test input robustness. The method reduces attack success rates from nearly 100% to under 10% without retraining, leveraging the model's inherent alignment while improving resilience to adversarial prompts.

ABSTRACT

Recently, Large Language Models (LLMs) have made significant advancements and are now widely used across various domains. Unfortunately, there has been a rising concern that LLMs can be misused to generate harmful or malicious content. Though a line of research has focused on aligning LLMs with human values and preventing them from producing inappropriate content, such alignments are usually vulnerable and can be bypassed by alignment-breaking attacks via adversarially optimized or handcrafted jailbreaking prompts. In this work, we introduce a Robustly Aligned LLM (RA-LLM) to defend against potential alignment-breaking attacks. RA-LLM can be directly constructed upon an existing aligned LLM with a robust alignment checking function, without requiring any expensive retraining or fine-tuning process of the original LLM. Furthermore, we also provide a theoretical analysis for RA-LLM to verify its effectiveness in defending against alignment-breaking attacks. Through real-world experiments on open-source large language models, we demonstrate that RA-LLM can successfully defend against both state-of-the-art adversarial prompts and popular handcrafted jailbreaking prompts by reducing their attack success rates from nearly 100% to around 10% or less.

Motivation & Objective

  • To address the vulnerability of aligned LLMs to alignment-breaking attacks using adversarial or handcrafted jailbreaking prompts.
  • To design a defense mechanism that enhances robustness of existing aligned LLMs without requiring retraining or fine-tuning.
  • To ensure the defense is effective across diverse alignment types (e.g., harmful, ethical, privacy-related) beyond just harmful content.
  • To provide a theoretically grounded and computationally feasible method for real-world deployment.

Proposed method

  • RA-LLM operates by applying Monte Carlo sampling to the input prompt, where a random subset of tokens is dropped in each sample.
  • The model's response is evaluated across multiple sampled inputs to determine if it consistently rejects harmful requests.
  • A request is classified as benign only if the model rejects it in the majority of sampled inputs, ensuring robustness to small perturbations.
  • The defense uses a threshold-based decision rule: if the model rejects the request in at least t out of n trials, it is considered safe.
  • The method does not require external harmful content detectors, relying solely on the model’s internal alignment capabilities.
  • Hyperparameters such as the dropout rate (p), number of Monte Carlo trials (n), and rejection threshold (t) are tuned to balance performance and computational cost.

Experimental results

Research questions

  • RQ1Can a defense mechanism be designed to robustify existing aligned LLMs against alignment-breaking attacks without retraining or fine-tuning?
  • RQ2How effective is random token dropping in improving model robustness against adversarial and handcrafted jailbreaking prompts?
  • RQ3To what extent does the proposed method reduce attack success rates while preserving benign request handling?
  • RQ4What is the computational overhead of the defense mechanism, and can it be optimized for practical deployment?
  • RQ5Is the defense robust to gradient-based attack methods due to the non-differentiable nature of the random dropping process?

Key findings

  • The attack success rate of state-of-the-art adversarial prompts dropped from nearly 100% to below 10% when defended by RA-LLM.
  • Handcrafted jailbreaking prompts also saw a significant reduction in success rate, confirming robustness across attack types.
  • With as few as 10 Monte Carlo trials, RA-LLM maintained a benign response rate above 95% and attack success rate below 15%.
  • The method achieved a computational cost increase of approximately 1.25x (GPT-4) and 1.5x (GPT-3.5 Turbo), which is considered reasonable for the defense gain.
  • The defense is robust to gradient-based attacks due to the non-differentiable random dropping mechanism, limiting the effectiveness of optimization-based attack generation.
  • Ablation studies confirmed that adjusting hyperparameters like p, t, and n allows for trade-offs between performance and computational cost.

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.