---
title: "Multi-agent prompting — 多智能体提示"
source: "https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA"
wiki: "systems-analysis.info/int"
article: "Multi-agent_prompting_—_多智能体提示"
language: "zh"
categories:
  - "Category:Chinese"
  - "Category:Large language models"
  - "Category:Machine learning"
  - "Category:Prompt engineering"
revision_id: 4689
wiki_created_at: 2026-09-06T23:38:33Z
wiki_modified_at: 2026-09-06T23:38:33Z
downloaded_at: 2026-09-07T23:04:02Z
---

# Multi-agent prompting — 多智能体提示

**多智能体提示**（英语：*multi-agent prompting*）是提示工程和人工智能系统中的一种方法，其中多个基于大型语言模型 (LLM)的自主智能体通过结构化的指令和响应交换进行交互，以解决复杂问题<sup>[\[1\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-comm_paper-1)</sup>。

换言之，多智能体系统由多个 LLM 智能体组成，它们协同处理用户的复杂请求，将推理阶段（*subtasks*）分配给具有不同“角色”和能力的智能体。该方法的主要目标是通过集体解决问题的方式，克服单一模型在复杂任务上的局限性。使用多个交互式智能体旨在提高推理质量、事实准确性和响应的可靠性<sup>[\[2\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-anthropic-mas-2)</sup>。一个重要特点是严格的指令性：在整体解决方案的框架内，为每个 LLM 分配特定的角色或任务。

## 方法与架构模式

研究人员提出了多种多智能体提示方案，它们在智能体的交互性质和角色上有所不同。

### 基于角色的专家建模

一个或多个智能体被指定为具有狭窄专业领域的领域专家。例如，在一个多智能体小组中，不同的智能体可以代表不同的知识领域（物理学家、化学家、生物学家），或任务解决的不同阶段（规划者、执行者、批评者）<sup>[\[1\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-comm_paper-1)</sup>。这种方法可以实现高效的 *few-shot* 提示，其中每个专家智能体都会收到其领域内的示例演示，从而提高整体性能。

### 自我修正与批判 (Self-reflection)

智能体可以扮演“批评者”的角色，或者反思另一个智能体或自己先前回答的决策。*self-reflection*（自我反思）或 *self-refinement*（自我完善）策略在于，LLM 首先生成一个答案，然后由它自己或另一个模型分析并纠正该答案中的错误<sup>[\[1\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-comm_paper-1)</sup>。这有助于迭代式地改进最终结果。

### 智能体之间的辩论

这是多智能体提示的一种竞争性变体，通过组织多个 LLM 之间的讨论或辩论来实现。在 **LLM-Debate** 方案中，两个或更多智能体就任务（例如数学问题）的正确答案进行辩论，并相互批判对方的论点<sup>[\[3\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-more_agents_all_you_need-3)</sup>。与单一解决方案相比，这种辩论形式提高了模型的逻辑推理能力和答案的事实准确性。

### 规划与任务分解

一个智能体担任规划者的角色，将复杂的请求分解为一系列步骤或子任务，然后由它自己或其他智能体来解决。诸如 *ReAct* 和 *Reflexion* 之类的方法实现了类似的带有反馈的迭代规划原则。LLM 在开始执行之前首先生成一个解决方案计划，这有助于处理长推理链<sup>[\[1\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-comm_paper-1)</sup>。

### 多角色协作

除了使用不同的模型，还可以使用同一个 LLM，让它“扮演”多个具有不同人设或观点的智能体。在 *multi-persona self-collaboration*（多角色自我协作）方法中，一个模型在对话过程中相继扮演多个角色，仿佛在与自己进行讨论。尽管研究表明，独立的智能体可以提供更高的效率，但这种方法允许在单个 LLM 内部模拟一个专家团队<sup>[\[1\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-comm_paper-1)</sup>。

## 应用与成果

多智能体提示方法在一些单一 LLM 曾遇到困难的领域显示出其有效性。

### 数学与逻辑推理

使用多个智能体显著提高了需要多步推导的任务（复杂算术、数学证明、逻辑谜题）的准确性。在 Du 等人 (2023) 的工作中，多智能体“辩论”方法比单一智能体的结果有所改进。分析表明，随着参与讨论的智能体数量增加，答案的准确性也随之提高<sup>[\[3\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-more_agents_all_you_need-3)</sup>。

### 科学与技术任务

针对复杂的学科问题（物理、化学），研究人员提出了 **CoMM** (*Collaborative Multi-Agent, Multi-Reasoning-Path Prompting*) 方法，其中多个具有不同角色（专家）的 LLM 智能体并行应用不同的推理策略。在大学水平物理任务的测试中，CoMM 明显优于像 *chain-of-thought* 这样的基线方法，在公式和计算方面的错误更少<sup>[\[1\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-comm_paper-1)</sup>。

### 代码生成与调试

在编程领域，多智能体系统被用于提高代码质量并减少错误数量。**PromptV** 系统使用多个智能体来顺序编写、检查和修正 Verilog 代码。角色分配（生成、审查、测试）提高了模型发现和修复错误的能力，在一个基准测试中，成功编译的解决方案比例高达 **96.5%**<sup>[\[4\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-promptv_paper-4)</sup>。

### 信息搜索与分析

多智能体系统对于开放式、结构不良的查询特别有用。**Anthropic** 公司为 **Claude** 模型开发了一种多智能体模式，专门用于网络研究。在该系统中，主智能体分析查询并生成多个并行的子任务智能体，每个智能体从不同方面搜索主题。与单个 Claude 模型相比，这种架构在处理复杂搜索问题上的效率高出 **90%**<sup>[\[2\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-anthropic-mas-2)</sup>。

### 文本分类与 NLP 任务

针对 NLP 任务，研究人员开发了**基于原则的提示**（*Principle-Based Prompting*）。在这种方法中，LLM 智能体首先生成一组“原则”（解决方法），然后一个最终智能体从中挑选出最佳原则，另一个智能体基于这些原则进行分类。与基线方法相比，该方法将 macro-F1 指标提高了 **1.5–19%**，在质量上接近经典的样本学习（*few-shot*）<sup>[\[5\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-principle_based_paper-5)</sup>。

## 局限与问题

### 计算复杂性与成本

主要缺点是计算负载急剧增加。每个智能体都需要自己的生成会话，这导致 token 和资源的大量消耗。根据 Anthropic 的数据，其系统平均每次对话消耗的 token **是原来的 4 倍**，在某些情况下甚至高达 15 倍<sup>[\[2\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-anthropic-mas-2)</sup>。这使得该方法仅适用于高价值任务。

### 设计与协调的复杂性

为了成功运行，需要进行仔细的**提示工程调优**：必须明确定义每个智能体的角色、消息交换格式和停止标准。否则，智能体可能会重复工作、陷入无限循环的搜索或创建无用的子任务<sup>[\[2\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-anthropic-mas-2)</sup>。

### 安全性与可靠性

出现了新的攻击向量。研究人员展示了 **Prompt Infection**（提示词感染）现象，即来自一个智能体的恶意指令片段被传递给另一个智能体，像病毒一样在整个推理链中传播。这种 *LLM-to-LLM* 攻击显示了多智能体系统对隐藏注入和操纵的脆弱性，需要开发特殊的保护措施，例如标记每个智能体的输出（*LLM Tagging*）<sup>[\[6\]](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_note-prompt_infection_paper-6)</sup>。

## 外部链接

- <a href="https://www.anthropic.com/engineering/built-multi-agent-research-system" class="external text" rel="nofollow">«我们如何构建多智能体研究系统» — Anthropic 的详细分析</a>
- <a href="https://ar5iv.labs.arxiv.org/html/2402.05120" class="external text" rel="nofollow">«More Agents Is All You Need» — 关于智能体集成有效性的科学论文</a>

## 参考文献

- Chen, P. et al. (2024). *CoMM: Collaborative Multi-Agent, Multi-Reasoning-Path Prompting for Complex Problem Solving*. <a href="https://arxiv.org/abs/2404.17729" class="external text" rel="nofollow">arXiv:2404.17729</a>.
- Li, J. et al. (2024). *More Agents Is All You Need*. <a href="https://arxiv.org/abs/2402.05120" class="external text" rel="nofollow">arXiv:2402.05120</a>.
- Mi, Y. et al. (2024). *PromptV: Leveraging LLM-Powered Multi-Agent Prompting for High-Quality Verilog Generation*. <a href="https://arxiv.org/abs/2412.11014" class="external text" rel="nofollow">arXiv:2412.11014</a>.
- Wei, P. et al. (2024). *Don’t Just Demo, Teach Me the Principles: A Principle-Based Multi-Agent Prompting Strategy for Text Classification*. <a href="https://arxiv.org/abs/2502.07165" class="external text" rel="nofollow">arXiv:2502.07165</a>.
- Lee, D.; Tiwari, A. (2024). *Prompt Infection: LLM-to-LLM Prompt Injection within Multi-Agent Systems*. <a href="https://arxiv.org/abs/2410.07283" class="external text" rel="nofollow">arXiv:2410.07283</a>.
- Fernando, C. et al. (2023). *PromptBreeder: Self-Referential Self-Improvement via Prompt Evolution*. <a href="https://arxiv.org/abs/2309.16797" class="external text" rel="nofollow">arXiv:2309.16797</a>.
- Wu, Q. et al. (2023). *AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation*. <a href="https://arxiv.org/abs/2308.08155" class="external text" rel="nofollow">arXiv:2308.08155</a>.
- Liu, X. et al. (2023). *AgentBench: Evaluating LLMs as Agents*. <a href="https://arxiv.org/abs/2308.03688" class="external text" rel="nofollow">arXiv:2308.03688</a>.
- Li, G. et al. (2024). *Multi-LLM Debate: Framework, Principles, and Interventions*. <a href="https://proceedings.neurips.cc/paper_files/paper/2024/file/32e07a110c6c6acf1afbf2bf82b614ad-Paper-Conference.pdf" class="external text" rel="nofollow">PDF</a>.
- Du, N. et al. (2023). *Improving Factuality and Reasoning in Language Models through Multi-Agent Debate*. <a href="https://arxiv.org/abs/2305.14325" class="external text" rel="nofollow">arXiv:2305.14325</a>.

## 注释

1.  <span id="cite_note-comm_paper-1">↑ <sup>[1.0](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-comm_paper_1-0)</sup> <sup>[1.1](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-comm_paper_1-1)</sup> <sup>[1.2](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-comm_paper_1-2)</sup> <sup>[1.3](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-comm_paper_1-3)</sup> <sup>[1.4](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-comm_paper_1-4)</sup> <sup>[1.5](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-comm_paper_1-5)</sup> Chen, Y. et al. «CoMM: Collaborative Multi-Agent, Multi-Reasoning-Path Prompting for Complex Problem Solving». *arXiv*, 2024. <a href="https://arxiv.org/html/2404.17729v1" class="external autonumber" rel="nofollow">[1]</a></span>
2.  <span id="cite_note-anthropic-mas-2">↑ <sup>[2.0](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-anthropic-mas_2-0)</sup> <sup>[2.1](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-anthropic-mas_2-1)</sup> <sup>[2.2](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-anthropic-mas_2-2)</sup> <sup>[2.3](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-anthropic-mas_2-3)</sup> «How we built our multi-agent research system». *Anthropic*. <a href="https://www.anthropic.com/engineering/built-multi-agent-research-system" class="external autonumber" rel="nofollow">[2]</a></span>
3.  <span id="cite_note-more_agents_all_you_need-3">↑ <sup>[3.0](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-more_agents_all_you_need_3-0)</sup> <sup>[3.1](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-more_agents_all_you_need_3-1)</sup> Li, G. et al. «More Agents Is All You Need». *arXiv*, 2024. <a href="https://ar5iv.labs.arxiv.org/html/2402.05120" class="external autonumber" rel="nofollow">[3]</a></span>
4.  <span id="cite_note-promptv_paper-4">[↑](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-promptv_paper_4-0) Mi, Y. et al. «PromptV: Leveraging LLM-powered Multi-Agent Prompting for High-quality Verilog Generation». *ResearchGate*, 2024. <a href="https://www.researchgate.net/publication/387105472_PromptV_Leveraging_LLM-powered_Multi-Agent_Prompting_for_High-quality_Verilog_Generation" class="external autonumber" rel="nofollow">[4]</a></span>
5.  <span id="cite_note-principle_based_paper-5">[↑](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-principle_based_paper_5-0) Wei, J. et al. «Don't Just Demo, Teach Me the Principles: A Principle-Based Multi-Agent Prompting Strategy for Text Classification». *arXiv*, 2024. <a href="https://arxiv.org/html/2502.07165v1" class="external autonumber" rel="nofollow">[5]</a></span>
6.  <span id="cite_note-prompt_infection_paper-6">[↑](https://systems-analysis.info/int/Multi-agent_prompting_%E2%80%94_%E5%A4%9A%E6%99%BA%E8%83%BD%E4%BD%93%E6%8F%90%E7%A4%BA#cite_ref-prompt_infection_paper_6-0) Lee, K. & Tiwari, A. «Prompt Infection: LLM-to-LLM Prompt Injection within Multi-Agent Systems». *OpenReview*, 2024. <a href="https://openreview.net/forum?id=NAbqM2cMjD" class="external autonumber" rel="nofollow">[6]</a></span>
