1.6 KiB
1.6 KiB
title, type, tags
| title | type | tags |
|---|---|---|
| 多Agent可靠性模式 | concept |
Definition
多智能体系统中用于克服 LLM 不可靠性(幻觉、逻辑谬误、上下文漂移)的四大架构模式:层级结构、共识、 adversarial debate 和淘汰制。
Four Patterns
1. 层级结构(Hierarchy)
- 角色:Planner(规划器)+ Worker(工作者)+ Validator(验证器)
- 依赖图强制协作:Worker 必须等待 Planner 分配任务,且无法作弊(Validator 会发现)
- 适用场景:需要将上下文分开的复杂工作流程
2. 共识(Consensus / Voting)
- 机制:N 个 LLM 独立生成同一任务答案,取多数票
- 数学基础:3 个模型同时产生相同幻觉的概率 = 0.2³ = 0.8%(假设单模型幻觉率 20%)
- 适用场景:事实核查、分类任务
3. 对抗辩论(Adversarial Debate)
- 角色:Generator → Critic(反对) → Judge(裁决)
- 机制:Truth survives the fight,真理越辩越明
- 适用场景:安全分析、代码审查、高风险内容审核
4. 淘汰制(Knock-out)
- 类比:SRE 中服务器是"cattle"(可替换)而非"pets"(独一无二)
- 机制:N 个 Agent 执行任务,最差者被淘汰;可选择用获胜者特征替换已淘汰者
- 适用场景:迭代式 Agent 工程、开发调试
Core Insight
"Stop treating LLMs like magic chatbots. Start treating them like unreliable components in a distributed system."