Files
nexus/wiki/concepts/验证器模式.md

1.1 KiB
Raw Blame History

title, type, tags
title type tags
验证器模式 concept

Definition

多智能体系统中 Validator验证器检查 Worker 输出质量不合格则退回的机制。验证器可以是确定性代码单元测试、JSON Schema 验证)或 LLM 本身。

Validation Methods

  • 确定性代码验证单元测试、JSON Schema 验证、正则表达式匹配
  • LLM 验证:单独训练或提示的验证模型判断输出质量
  • 双模式:可单独验证每个 Worker 输出,或在汇总所有结果后整体验证

Placement in Multi-Agent Patterns

  • 层级结构HierarchyValidator 是关键角色,位于 Planner → Worker → Validator 链路的末端
  • 淘汰制Knock-outValidator 决定哪些 Agent 被淘汰
  • 对抗辩论Adversarial DebateWatchdog确定性代码打破辩论死循环

Best Practice

  • Validator 最好使用与 Generator/Worker 不同的模型(提高质量和客观性)
  • 验证器可以在同一 LLM 会话中与规划器协作PLAN → VALIDATION loop

Sources