Claude Platform Docs
  • 消息
  • 托管智能体
  • 管理

Search...
⌘K
用例
概览工单路由客户支持智能体内容审核法律摘要
提示工程
概览提示最佳实践为 Claude Fable 5 编写提示为 Claude Opus 4.8 编写提示控制台提示工具
测试与评估
定义成功标准并构建评估在控制台中使用评估工具降低延迟
加强防护措施
减少幻觉提高输出一致性缓解越狱攻击减少提示泄露
参考
术语表

Log in
减少幻觉
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Claude Platform Docs

Solutions

  • AI agents
  • Code modernization
  • Coding
  • Customer support
  • Education
  • Financial services
  • Government
  • Life sciences

Partners

  • Claude on AWS
  • Claude on Google Cloud

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Company

  • Anthropic
  • Careers
  • Economic Futures
  • Research
  • News
  • Responsible Scaling Policy
  • Security and compliance
  • Transparency

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Help and security

  • Availability
  • Status
  • Support
  • Discord

Terms and policies

  • Privacy policy
  • Responsible disclosure policy
  • Terms of service: Commercial
  • Terms of service: Consumer
  • Usage policy
最佳实践/加强防护措施

减少幻觉

即使是最先进的语言模型(如 Claude),有时也会生成与事实不符或与给定上下文不一致的文本。这种现象被称为"hallucination"(幻觉),可能会削弱您的 AI 驱动解决方案的可靠性。 本指南将探讨最大限度减少幻觉的技术,确保 Claude 的输出准确且值得信赖。

基本的幻觉最小化策略

  • **允许 Claude 说"我不知道":**明确允许 Claude 承认不确定性。这个简单的技巧可以大幅减少错误信息。

  • **使用直接引用进行事实依据:**对于涉及长文档(超过 2 万个令牌)的任务,要求 Claude 在执行任务之前先逐字提取引文。这可以使其回答基于实际文本,从而减少幻觉。

  • 通过引用进行验证:让 Claude 为其每项主张引用引文和来源,使其回答具有可审核性。您还可以让 Claude 在生成回答后,通过查找支持性引文来验证每项主张。如果找不到引文,则必须撤回该主张。


高级技术

  • 思维链验证:要求 Claude 在给出最终答案之前逐步解释其推理过程。这可以揭示错误的逻辑或假设。

  • N 选优验证:使用相同的提示多次运行 Claude 并比较输出结果。输出之间的不一致可能表明存在幻觉。

  • 迭代优化:将 Claude 的输出作为后续提示的输入,要求其验证或扩展之前的陈述。这可以发现并纠正不一致之处。

  • 外部知识限制:明确指示 Claude 仅使用所提供文档中的信息,而不使用其通用知识。


请记住,虽然这些技术可以显著减少幻觉,但并不能完全消除幻觉。请始终验证关键信息,尤其是在做出高风险决策时。

Was this page helpful?

  • 基本的幻觉最小化策略
  • 高级技术