Combating Adversarial Attacks with Multi-Agent Debate

Steffi Chern, Zhen Fan, Andy LiuarXiv 2024 · DOI

Abstract

Large Language Models (LLMs) remain susceptible to adversarial "jailbreaks" despite rigorous safety alignment. This paper explores an inference-time multi-agent debate framework where multiple LLM instances critique and refine responses. Results indicate that this collaborative process significantly reduces output toxicity and enhances robustness compared to single-agent generation or simple self-reflection.

Introduction: The Challenge of Inference-Time Robustness

Despite safety alignment via Reinforcement Learning from Human Feedback (RLHF), state-of-the-art LLMs are vulnerable to adversarial prompts that bypass safety filters. Red-teaming efforts frequently uncover inputs that elicit toxic or harmful content. This research shifts focus from training-time alignment to inference-time robustness, investigating whether a model's own reasoning and social-interaction capabilities can be leveraged to police its outputs.

Methodology

The study implements a multi-agent debate framework where agents engage in structured discussion to refine responses to adversarial prompts. The workflow consists of:

  1. Initial Response: Agents generate zero-shot responses to an adversarial prompt.
  2. Discussion Rounds: Agents review peer responses and provide updated opinions, revising their answers over multiple rounds.
  3. Agent Intentions: Agents are assigned specific roles—harmless, neutral, or harmful—to test the system's resilience against "poisoned" or jailbroken participants.

Performance was evaluated using the Anthropic Red Teaming Dataset and the Bot Adversarial Dialogue (BAD) Dataset, with toxicity measured via the Perspective API and a custom Llama-2-7b-chat classifier.

Key Insights and Results

The Safety "Wisdom of the Crowd"

A primary finding is that multi-agent debate acts as a powerful filter. Even when a model is "poisoned" or uncensored, interaction with a safety-aligned agent (such as GPT-3.5-Turbo) pulls the final response toward a less toxic state.

Toxicity trends over debate rounds for Llama-chat-uncensored under different feedback conditions.

As shown in the figure above, toxicity scores for the "Llama-2-7b-chat-uncensored" model drop significantly within the first two rounds of debate when paired with a harmless agent. Conversely, harmless agents demonstrate resilience when exposed to toxic feedback, maintaining relatively stable toxicity levels. Most of the "de-toxification" happens in the first 1–2 rounds of debate; beyond that, increasing context length can lead to stagnation.

Model-Specific Vulnerabilities

The study revealed that different models possess unique "Achilles' heels." For instance, Llama-2-7b was found to be significantly more susceptible to prompts involving privacy violations compared to other harm categories like physical violence.

Mean toxicity scores across different harm categories for Text-Davinci-003 and Llama-2-7b.

Comparing the two models, Text-Davinci-003 shows higher sensitivity to insults and emotional harm, while Llama-2-7b's toxicity is dominated by privacy-related prompts. This suggests that safety alignment is not uniform across model architectures or training sets.

Performance Summary

  • Toxicity Reduction: A 2-round debate reduced the toxicity score of an uncensored Llama model from 0.621 to 0.426.
  • Classifier Efficacy: The custom Llama-based classifier achieved an F1 score of 0.803, significantly outperforming the Perspective API (F1: 0.475) on multi-turn adversarial data.
  • GPT-3.5 Robustness: GPT-3.5-Turbo proved to be the most resilient model, maintaining very low toxicity scores even when prompted with harmful intentions.

Limitations and Future Directions

While effective, multi-agent debate faces hurdles for real-world deployment:

  • Computational Cost: Multiple rounds of inference increase latency and API expenses.
  • Capability Floor: The framework requires agents with sufficient reasoning capabilities; smaller models often fail to provide meaningful updates.
  • Structural Simplicity: Future work could explore more sophisticated architectures, such as dedicated "referee" agents or cross-provider debates (e.g., Llama vs. GPT) to mitigate shared training biases.

Summary updated

BibTeX
@misc{chern2024combating,
  author = {Steffi Chern and Zhen Fan and Andy Liu},
  title = {{Combating Adversarial Attacks with Multi-Agent Debate}},
  year = {2024},
  eprint = {2401.05998},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.05998},
}
Figure