Abstract
Large language models (LLMs) have achieved remarkable performance in various natural language processing tasks, especially in dialogue systems. However, LLM may also pose security and moral threats, especially in multi round conversations where large models are more easily guided by contextual content, resulting in harmful or biased responses. In this paper, we present a novel method to attack LLMs in multi-turn dialogues, called CoA (Chain of Attack). CoA is a semantic-driven contextual multi-turn attack method that adaptively adjusts the attack policy through contextual feedback and semantic relevance during multi-turn of dialogue with a large model, resulting in the model producing unreasonable or harmful content. We evaluate CoA on different LLMs and datasets, and show that it can effectively expose the vulnerabilities of LLMs, and outperform existing attack methods. Our work provides a new perspective and tool for attacking and defending LLMs, and contributes to the security and ethical assessment of dialogue systems.
Introduction
While current safety measures like Reinforcement Learning from Human Feedback (RLHF) are effective at blocking direct, single-turn requests for harmful information, they often fail in the context of extended dialogues. This paper identifies a "contextual steering" vulnerability: as a conversation progresses, the model's immediate context begins to outweigh its underlying safety training.
The proposed "Chain of Attack" (CoA) method exploits this by gradually nudging the model from benign, academic topics toward prohibited outputs—a strategy analogous to "boiling the frog."
Methodology
The CoA framework utilizes a dynamic, semantic-driven pipeline to bypass alignment through three primary stages:
- Seed Attack Chain Generator: An attacker model (such as GPT-3.5 or Vicuna) generates an initial sequence of prompts with increasing semantic relevance to the target harmful task.
- Attack Chain Executor: These prompts are delivered sequentially to the target LLM.
- Attack Chain Updater: This core component uses semantic feedback (calculated via tools like SimCSE) to evaluate the target's response. It then adaptively adjusts the strategy:
- Next Walk: Proceed to the next prompt if the model is cooperative.
- Regen Walk: Regenerate the current prompt if the response is neutral or unpersuasive.
- Back Walk: Retreat to a previous safe state if a safety refusal is triggered, attempting a different path.
Experimental Evaluation
The researchers evaluated CoA against several popular models, including Vicuna-13b, Llama-2, ChatGLM-2, Baichuan-2, and GPT-3.5-turbo, using the PAIR and GCG50 benchmarks.
Key findings include:
- Superior Success Rates: CoA-Feedback achieved a 94% Attack Success Rate (ASR) on ChatGLM-2 and 90% on Baichuan-2, significantly outperforming baseline methods.
- Effectiveness on Closed Models: Against the heavily aligned GPT-3.5-turbo, CoA achieved a 68% ASR, whereas standard toxic prompts resulted in 0% success.
- Efficiency: Most successful attacks were completed within approximately 3 rounds of dialogue, demonstrating that steering does not require extensive conversation to be effective.
Conclusion
The effectiveness of CoA demonstrates that LLMs struggle to maintain safety boundaries when harmful intent is masked by a coherent narrative. The "semantic nudge" proves to be a potent tool for bypassing alignment. Future defense mechanisms must move beyond simple keyword filtering toward context-aware safety filters capable of recognizing multi-turn semantic steering and intent masking.
Summary updated