Claude Platform Docs
  • Messages
  • Managed Agents
  • 管理

Search...
⌘K
使用案例
概覽工單路由客戶支援代理內容審核法律摘要
提示工程
概覽提示最佳實務Claude Fable 5 提示技巧Claude Opus 4.8 提示技巧Console 提示工具
測試與評估
定義成功並建構評估在 Console 中使用評估工具降低延遲
強化防護措施
減少幻覺提高輸出一致性緩解越獄減少提示洩漏
參考
詞彙表

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 承認不確定性。這個簡單的技巧可以大幅減少錯誤資訊。

  • **使用直接引用作為事實依據:**對於涉及長文件(超過 20k tokens)的任務,請要求 Claude 在執行任務之前先逐字提取引文。這能使其回應以實際文本為基礎,從而減少幻覺。

  • **透過引用進行驗證:**讓 Claude 為其每項主張引用引文和來源,使其回應可供審核。您也可以讓 Claude 在生成回應後,透過尋找支持性引文來驗證每項主張。如果找不到引文,則必須撤回該主張。


進階技術

  • **思維鏈驗證:**要求 Claude 在給出最終答案之前逐步解釋其推理過程。這可以揭示錯誤的邏輯或假設。

  • **N 選最佳驗證:**使用相同的提示多次執行 Claude,並比較輸出結果。輸出之間的不一致可能表示存在幻覺。

  • **迭代優化:**將 Claude 的輸出作為後續提示的輸入,要求其驗證或擴展先前的陳述。這可以發現並修正不一致之處。

  • **外部知識限制:**明確指示 Claude 僅使用所提供文件中的資訊,而非其一般知識。


請記住,雖然這些技術能顯著減少幻覺,但無法完全消除幻覺。請務必驗證關鍵資訊,尤其是在做出高風險決策時。

Was this page helpful?

  • 基本幻覺最小化策略
  • 進階技術