Claude
减少幻觉
Checked 09/15/2026View original
AI translation, not an official translation. Refer to the original for technical details.
On this page
即使是最先进的语言模型(如 Claude),有时也会生成与事实不符或与给定上下文不一致的文本。这种现象被称为"幻觉",会损害您的 AI 驱动解决方案的可靠性。本指南将探讨最大限度减少幻觉的技术,确保 Claude 的输出准确可信。
减少幻觉的基本策略
- 允许 Claude 说"我不知道": 明确允许 Claude 承认不确定性。这一简单技巧可以大幅减少虚假信息。
重点关注财务预测、整合风险和监管障碍。如果您对任何方面不确定,或报告缺乏必要信息,请说"我没有足够的信息来自信地评估这一点。"
</Accordion>
* **Use direct quotes for factual grounding:** For tasks involving long documents (>20k tokens), ask Claude to extract word-for-word quotes first before performing its task. This grounds its responses in the actual text, reducing hallucinations.
<Accordion title="Example: Auditing a data privacy policy">
```text User wrap
As our Data Protection Officer, review this updated privacy policy for GDPR and CCPA compliance.
<policy>
{{POLICY}}
</policy>
1. Extract exact quotes from the policy that are most relevant to GDPR and CCPA compliance. If you can't find relevant quotes, state "No relevant quotes found."
2. Use the quotes to analyze the compliance of these policy sections, referencing the quotes by number. Only base your analysis on the extracted quotes.
- 通过引用进行验证:让 Claude 为其每项主张引用原文和来源,从而使其回复可供审查。您还可以让 Claude 在生成回复后,通过查找支持性引文来验证每项主张。如果找不到引文,则必须撤回该主张。
起草完成后,审查新闻稿中的每项主张。对于每项主张,从文件中找到一段直接支持该主张的引文。如果某项主张找不到支持性引文,请将该主张从新闻稿中删除,并用空的 [] 括号标记删除位置。
</Accordion>
***
## Advanced techniques
* **Chain-of-thought verification**: Ask Claude to explain its reasoning step-by-step before giving a final answer. This can reveal faulty logic or assumptions.
* **Best-of-N verification**: Run Claude through the same prompt multiple times and compare the outputs. Inconsistencies across outputs could indicate hallucinations.
* **Iterative refinement**: Use Claude's outputs as inputs for follow-up prompts, asking it to verify or expand on previous statements. This can catch and correct inconsistencies.
* **External knowledge restriction**: Explicitly instruct Claude to only use information from provided documents and not its general knowledge.
<Note>
Remember, while these techniques significantly reduce hallucinations, they don't eliminate them entirely. Always validate critical information, especially for high-stakes decisions.
</Note>