---
title: "LLM error mitigation — 减少 LLM 错误"
source: "https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF"
wiki: "systems-analysis.info/int"
article: "LLM_error_mitigation_—_减少_LLM_错误"
language: "zh"
categories:
  - "Category:Chinese"
  - "Category:Large language models"
  - "Category:Machine learning"
revision_id: 3616
wiki_created_at: 2026-09-06T23:23:28Z
wiki_modified_at: 2026-09-06T23:23:28Z
downloaded_at: 2026-09-07T22:57:54Z
---

# LLM error mitigation — 减少 LLM 错误

**减少大型语言模型 (LLM) 中的错误**是一套旨在提高基于 Transformer 架构的人工智能系统准确性、可靠性和安全性的方法与技术。错误问题，特别是幻觉，是 LLM 在关键领域广泛应用的主要障碍之一。根据 2024-2025 年的研究数据，公开可用的 LLM 产生幻觉的频率在 3% 到 16% 之间<sup>[\[1\]](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_note-vectara2024-1)</sup>。

## 错误类型学

现代 LLM 错误分类包括几个主要类别，每个类别都需要特定的缓解（mitigation）方法。

### 幻觉

**幻觉**指模型生成看似合理但实际上不正确的内容。根据 Huang 等人 (2023) 的研究，幻觉可分为两种主要类型<sup>[\[2\]](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_note-huang2023survey-2)</sup>：

- **事实性幻觉** — 与可验证事实不符，包括创造不存在的事实（捏造）。在 2024 年的一项研究中，斯坦福大学发现 LLM 捏造了超过 120 个不存在的法律案件<sup>[\[3\]](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_note-ai_index2024-3)</sup>。
- **逻辑性幻觉** — 推理过程中违反逻辑连贯性。

2024 年的统计数据显示，聊天机器人在 27% 的情况下会产生幻觉，并且 46% 的生成文本包含事实错误<sup>[\[3\]](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_note-ai_index2024-3)</sup>。

### 系统性偏见 (Bias)

LLM 中的偏见表现为社会偏见（例如，将特定职业与特定性别联系起来）和在不同人群中性能表现的差异。2024 年的研究表明，在 10 个被测试的模型中，不同人群群体的评分差异最高可达 4 分（满分 10 分）。

### 毒性

毒性内容被定义为生成冒犯性、有害或歧视性的内容。毒性指标根据模型和使用场景的不同而有很大差异。

## 减少错误的方法

减少错误的策略可分为两大类：修改模型和训练过程的方法，以及在推理（inference）阶段应用的方法。

### 模型与训练过程的修改

#### Fine-tuning and Instruction Tuning - 微调与指令调优

**监督微调 (Supervised Fine-Tuning, SFT)** 允许将预训练模型适配于特定任务。为降低计算成本，采用了**参数高效微调 (Parameter-Efficient Fine-Tuning, PEFT)** 等方法，例如 LoRA 和 QLoRA，这些方法可以在保持有效性的同时，将微调成本降低高达 99%。

#### 基于人类反馈的强化学习 (RLHF)

RLHF 是一个两阶段过程：首先，根据人类偏好训练一个奖励模型；然后，优化主 LLM 以生成能够最大化该奖励的响应。该方法在 InstructGPT 和 GPT-4 模型中证明了其有效性，显著提高了模型输出与用户期望的契合度<sup>[\[4\]](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_note-openai2024-4)</sup>。

#### Constitutional AI - 宪法 AI

由 Anthropic 公司开发的 **Constitutional AI** 方法是 RLHF 的一种替代方案。在该方法中，模型并非直接从人类反馈中学习，而是学习遵循一套原则（即“宪法”）。这使得对人类监督的需求减少了 80-90%，并能有效防止生成有害内容<sup>[\[5\]](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_note-anthropic_cai-5)</sup>。

#### 架构解决方案

- **专家混合 (Mixture of Experts, MoE)**: 一种稀疏激活架构，可以在不按比例增加计算成本的情况下显著增加模型容量。据推测，GPT-4 使用了 8 个专家模型，每个模型拥有 2200 亿参数。
- **注意力机制的修改**: **分组查询注意力 (Grouped Query Attention, GQA)**（应用于 Llama 3 模型）和**稀疏注意力 (Sparse Attention)** 等技术降低了计算复杂度和内存需求，从而能够处理更长的上下文。

### 推理阶段的方法

#### Retrieval-Augmented Generation (RAG) - 检索增强生成

RAG 是减少事实错误的最有效方法之一。在生成答案之前，系统会查询外部知识库（例如维基百科、企业文档、科学文章），检索相关信息，并将其与原始请求一同提供给模型。这使得模型的回答能够“基于”经过验证的事实。在 **TriviaQA** 基准测试中，RAG 系统实现了 56.8% 的*精确匹配 (exact match)*，在减少事实错误方面比传统模型高出 60-80%。

#### 高级提示技巧

- **思维链 (Chain-of-Thought, CoT)**: 这种提示技巧引导模型在给出最终答案前，生成一步步的推理过程。这显著提高了模型在需要逻辑和数学计算的任务上的表现。
- **草稿链 (Chain of Draft, CoD)**: 作为 CoT 的演进，该方法让模型迭代地编辑其答案草稿，从而在消耗显著更少 token 的情况下，达到与 CoT 相当的准确性。

#### 内在自我修正 (Intrinsic Self-Correction)

TACL 2024 年的研究表明，LLM 在没有外部信息的情况下进行自我修正的能力是有限的。有效的自我修正通常需要借助外部工具，例如用于验证计算的代码解释器或用于核实事实的搜索引擎<sup>[\[6\]](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_note-tacl2024-6)</sup>。

## 错误评估方法

为衡量在减少错误方面的进展，研究人员使用了专门的指标和基准测试。

- **传统指标**: Perplexity、BLEU 和 ROUGE。这些指标对于评估流畅度和 n-gram 匹配度很有用，但在评估事实准确性方面表现不佳。
- **现代方法**:
  - **FactScore** 将长文本分解为原子事实，并评估可由知识库支持的事实所占的百分比。
  - **SAFE (Search-Augmented Factuality Evaluator)** — 由 Google 开发的一种方法，它利用搜索来核实事实，与人类评估的一致性达到 72%，而成本仅为人类评估的二十分之一。
  - **TruthfulQA** — 一项专注于评估模型避免生成常见错误信息能力的基准测试。

## 文献资料

- Huang, L. et al. (2023). *A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questions*. <a href="https://arxiv.org/abs/2311.05232" class="external text" rel="nofollow">arXiv:2311.05232</a>.
- Min, S. et al. (2023). *FActScore: Fine-Grained Atomic Evaluation of Factual Precision in Long-Form Text Generation*. <a href="https://arxiv.org/abs/2305.14251" class="external text" rel="nofollow">arXiv:2305.14251</a>.
- Wei, J. et al. (2024). *Long-Form Factuality in Large Language Models (SAFE)*. <a href="https://arxiv.org/abs/2403.18802" class="external text" rel="nofollow">arXiv:2403.18802</a>.
- Lewis, P. et al. (2020). *Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks*. <a href="https://arxiv.org/abs/2005.11401" class="external text" rel="nofollow">arXiv:2005.11401</a>.
- Hu, E. et al. (2021). *LoRA: Low-Rank Adaptation of Large Language Models*. <a href="https://arxiv.org/abs/2106.09685" class="external text" rel="nofollow">arXiv:2106.09685</a>.
- Ouyang, L. et al. (2022). *Training Language Models to Follow Instructions with Human Feedback*. <a href="https://arxiv.org/abs/2203.02155" class="external text" rel="nofollow">arXiv:2203.02155</a>.
- Madaan, A. et al. (2023). *Self-Refine: Iterative Refinement with Self-Feedback*. <a href="https://arxiv.org/abs/2303.17651" class="external text" rel="nofollow">arXiv:2303.17651</a>.
- Wang, X. et al. (2022). *Self-Consistency Improves Chain-of-Thought Reasoning in Language Models*. <a href="https://arxiv.org/abs/2203.11171" class="external text" rel="nofollow">arXiv:2203.11171</a>.
- Anthropic (2024). *Constitutional AI: Harmlessness from AI Feedback*. <a href="https://arxiv.org/abs/2212.08073" class="external text" rel="nofollow">arXiv:2212.08073</a>.
- Maslej, N. et al. (2024). *Artificial Intelligence Index Report 2024*. <a href="https://arxiv.org/abs/2405.19522" class="external text" rel="nofollow">arXiv:2405.19522</a>.

## 注释

1.  <span id="cite_note-vectara2024-1">[↑](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_ref-vectara2024_1-0) “Hallucination Leaderboard”. *Vectara*. (2024-2025). 检索于 2025 年 7 月 4 日。</span>
2.  <span id="cite_note-huang2023survey-2">[↑](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_ref-huang2023survey_2-0) Huang, L., et al. (2023). “A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questions”. *arXiv:2311.05232*.</span>
3.  <span id="cite_note-ai_index2024-3">↑ <sup>[3.0](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_ref-ai_index2024_3-0)</sup> <sup>[3.1](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_ref-ai_index2024_3-1)</sup> Stanford Human-Centered AI (2024). “AI Index Report 2024”.</span>
4.  <span id="cite_note-openai2024-4">[↑](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_ref-openai2024_4-0) OpenAI (2024). “Learning to Reason with LLMs”. *Technical Blog*.</span>
5.  <span id="cite_note-anthropic_cai-5">[↑](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_ref-anthropic_cai_5-0) Anthropic (2024). “Constitutional AI: Harmlessness from AI Feedback”. *Research Paper*.</span>
6.  <span id="cite_note-tacl2024-6">[↑](https://systems-analysis.info/int/LLM_error_mitigation_%E2%80%94_%E5%87%8F%E5%B0%91_LLM_%E9%94%99%E8%AF%AF#cite_ref-tacl2024_6-0) “When Can LLMs Actually Correct Their Own Mistakes?”. *Transactions of the Association for Computational Linguistics*. (2024).</span>
