LLM 幻觉:是 Bug 还是特性?美国最高法院 2025 年案例实验
社区文章 发布于 2025 年 7 月 8 日
本实验展示了 LLM 在没有搜索访问权限的情况下回答有关近期事件的问题时如何产生幻觉。它使用 Hugging Face AISheets 和 Inference Providers 构建,比较了 2025 年最高法院案件在有/无搜索情况下的回应,创建了一个开放的数据集,以展示幻觉模式。
最近关于幻觉的争论(它们是特性还是 Bug?)很多,我想为社区贡献一些有价值的东西。
我看到的主要论点是 LLM 幻觉是一种特性,因为它们允许 LLM 给出创造性的答案并探索新的方向。但是如果你追求事实性呢?共识是你需要为 LLM 提供搜索访问权限。
Sundar Pichai 与 Verge 讨论 LLM 幻觉和搜索。
我的看法
如果你不知道它们的存在,并且你正在使用 AI 回答问题、解决现实世界的问题等,那么幻觉就不是一个特性。根据我的经验,大多数用户不知道这一点,并将 AI 用作新的 Google(只需与 AI 开发者/极客圈子之外的人交流)。
鉴于上述情况,我想为社区构建一个简单、可操作的资源,以了解幻觉的影响。一个能清楚地展示问题,并能被 AI 开发者用作示例、游乐场和思考的素材的东西。
既然我正在构建数据集工具和数据集,为什么不创建一个数据集呢?所以这个周末,我想到了以下想法:
下载最新信息:2025 年美国最高法院案例
使用 AISheets 和 Hugging Face Inference Providers 为每个案例生成 20 个问题。
使用不同的 LLM 生成回答,有实时搜索访问权限和无实时搜索访问权限。
使用 Llama 分析模型在没有搜索访问权限的情况下回答的真实性。
使用 AISheets 生成实时搜索结果的回答。
使用 AISheets 生成实时搜索结果的回答。
数据集
结果呢?
一个Hub 数据集,包含:
在真实世界情境中测试幻觉的问题。
不同类型虚构信息和事实的示例。我尝试过的所有模型在未提供上下文时,100% 的时间都用虚假事实进行回复。
幻觉分析示例
附录:提示词
以下是我在 AISheets 中用于构建数据集的主要提示词(无需任何设置和代码)
用于生成摘要和问题的 AISheets 配置
columns:
AI_Summary:
modelName: meta-llama/Llama-3.3-70B-Instruct
modelProvider: nebius
userPrompt: >-
Find news and analyses and provide a short summary of the impact in plain
English:
{{Case_Name}} / {{Docket_Number}} / {{Court}}
prompt: "
You are a rigorous, intelligent data-processing engine. Generate only the
requested response format, with no explanations following the user
instruction. You might be provided with positive, accurate examples of how
the user instruction must be completed.
# User instruction
Find news and analyses and provide a short summary of the impact in plain
English:
{{Case_Name}} / {{Docket_Number}} / {{Court}}
# Your response
\ "
searchEnabled: true
columnsReferences:
- Case_Name
- Docket_Number
- Court
questions:
modelName: meta-llama/Llama-3.3-70B-Instruct
modelProvider: nebius
userPrompt: >
Craft a list of 20 questions about this case, for someone that really
knows the case and its impact:
{{Case_Name}}
{{Summary}}
{{Column 8}}
prompt: "
You are a rigorous, intelligent data-processing engine. Generate only the
requested response format, with no explanations following the user
instruction. You might be provided with positive, accurate examples of how
the user instruction must be completed.
# User instruction
Craft a list of 20 questions about this case, for someone that really
knows the case and its impact:
{{Case_Name}}
{{Summary}}
# Your response
\ "
searchEnabled: false
columnsReferences:
- Case_Name
- AI_Summary
- Summary
幻觉评估
# Hallucination Classification Guide
Given the context, question, incorrect answer and grounded answer, identify which types of hallucination appear in the incorrect answer.
## Input Format:
**Question:** {{question}}
**Context:** {{AI_Summary}}
**Incorrect answer:** {{llama70B-no-search}}
**Grounded answer:** {{llama70B-search}}
---
## Hallucination Categories:
**Factual Inconsistency**
- The answer states facts that are objectively wrong
- Example: Claiming Paris is the capital of Germany
- Check: Does the incorrect answer contradict established real-world knowledge?
**Factual Fabrication**
- The answer invents completely non-existent information
- Example: Creating fake historical events, people, or statistics
- Check: Does the incorrect answer contain entirely made-up facts that don't exist?
**Logical Inconsistency**
- The answer contains internal contradictions or logical errors
- Example: Mathematical calculations with wrong results
- Check: Does the incorrect answer contradict itself or contain logical flaws?
**Intrinsic Hallucination**
- The answer directly contradicts the provided context/source
- Example: Context says "FDA approved the vaccine" but answer says "FDA rejected it"
- Check: Does the incorrect answer directly contradict the context?
**Extrinsic Hallucination**
- The answer adds information that cannot be verified from the context
- Example: Context discusses a meeting but answer adds specific attendee names not mentioned
- Check: Does the incorrect answer add unverifiable information beyond the context?
---
## Instructions:
1. Compare the incorrect answer to the context and grounded answer
2. Identify which categories apply (multiple categories may apply to the same answer)
3. Provide your response as a comma-separated list
## Output Format:
comma-separated list of applicable categories with reason in () for each category