> For the complete documentation index, see [llms.txt](https://elwood.gitbook.io/foundation-model-sec/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://elwood.gitbook.io/foundation-model-sec/llm-attack/drattack-prompt-decomposition-and-reconstruction-makes-powerful-llm-jailbreakers.md).

# DrAttack: Prompt Decomposition and Reconstruction Makes Powerful LLM Jailbreakers

<figure><img src="/files/nNGXZxKhz8mOV6Q47AZu" alt=""><figcaption></figcaption></figure>

## 阅读总结报告

### 1. 研究背景

随着大型语言模型（LLMs）在各种任务中的成功应用，它们的安全性问题也日益凸显。LLMs容易受到越狱攻击，这种攻击能够诱使模型输出有害内容。现有的越狱攻击方法通常通过优化整个有害提示来隐藏恶意意图，但这些方法容易被良好对齐的LLMs识别和拒绝。

### 2. 过去方案和缺点

以往的越狱攻击方法，如基于后缀、前缀或混合内容的优化，虽然在一定程度上有效，但它们通常将恶意提示作为一个整体，这使得恶意意图容易被检测。此外，这些方法在搜索空间上效率不高，且可能需要大量的查询才能成功越狱。

<figure><img src="/files/zUo6e3bP2NuLRMmzFDOJ" alt=""><figcaption></figcaption></figure>

### 3. 本文方案和步骤

本文提出了一种名为DrAttack的自动越狱攻击框架，它通过以下三个关键步骤来分解和重构提示：

* **分解（Decomposition）**：使用语义解析将原始恶意提示分解为看似中性的子提示。
* **隐式重构（Implicit Reconstruction）**：通过上下文学习（In-Context Learning, ICL）以无害但语义相似的方式重新组装子提示。
* **同义词搜索（Synonym Search）**：寻找子提示的同义词，以保持原始意图的同时越狱LLMs。

<figure><img src="/files/nC13bF0kifjInf0htWEZ" alt=""><figcaption></figcaption></figure>

### 4. 本文创新点与贡献

* 提出了一种新的基于分解的越狱攻击方法，通过分解提示来隐藏恶意意图。
* 引入了一种新的攻击策略，通过减少搜索空间来提高搜索效率。
* 在多个开源和闭源LLMs上进行了广泛的实验研究，证明了DrAttack在越狱攻击中的有效性和效率。

### 5. 本文实验

实验使用了AdvBench基准测试中的“有害行为”部分，包括520个恶意提示。通过GPT评估和人类评估来衡量攻击成功率（ASR）。实验结果表明，DrAttack在GPT-4上以仅15个查询的成功率达到了78.0%，显著超过了先前的SOTA（State of the Art）攻击方法。

### 6. 实验结论

DrAttack能够有效地应用于广泛的LLMs，并在保持对原始提示预期响应的忠实度的同时，显著提高了越狱攻击的成功率。此外，DrAttack在面对防御策略时表现出了较强的鲁棒性。

### 7. 全文结论

本文成功地展示了一种通过提示分解和重构来自动化越狱攻击的新方法。研究发现，通过将恶意内容嵌入短语中，DrAttack显著降低了迭代时间开销，并实现了更高的攻击成功率。这些发现揭示了LLMs的新漏洞，这些漏洞应在未来的防御策略开发中予以考虑。

### 阅读总结

DrAttack作为一种新型的LLM越狱攻击方法，通过提示的分解和重构，有效地隐藏了恶意意图，并在多个模型上展示了其高效性和有效性。这种方法不仅提高了攻击的成功率，而且减少了所需的查询次数，这对于实际应用中的红队工具来说是非常重要的。然而，这种攻击方法的潜在滥用风险也不容忽视，需要开发更强大的防御策略来保护LLMs的安全。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://elwood.gitbook.io/foundation-model-sec/llm-attack/drattack-prompt-decomposition-and-reconstruction-makes-powerful-llm-jailbreakers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
