72 / 90

第 72 天:故障归因、定性错误分类学与模型对比报告

将模型失效模式严谨划分为幻觉、格式违规、过度拒答与灾难性遗忘,撰写兼顾指标、误差与权衡的诚实模型对比报告。

自学方法与 Python 工程基础 480 分钟有效研习(8 小时)
01 120 分钟

定性错误分类学:幻觉、格式违规与过度拒答

Agent 辅助工程检查

前置要求

第 71 天定量评测指标与错误分析基本准则。

学习目标

将大语言模型的失效输出精确归类至 4 类错误分类学体系(内在/外在幻觉、结构格式违规、安全过度拒绝、推理链断裂)并定位根因。

操作指引

1. 学习 Ji et al.(2023)NLG 幻觉分类体系:严格区分“内在幻觉”(Intrinsic,直接违背 Prompt 给定的上下文事实或前提条件)与“外在幻觉”(Extrinsic,生成无法依据输入事实验证、凭空捏造的陈述)。
2. 形式化定义格式违规(Format Violations):JSON 语法损坏、缺少指定字段、Markdown 标记符泄露(如要求纯 JSON 字符串却包裹 ```json 代码块)以及 Token 长度截断。
3. 分析安全性过度拒答(Röttger et al. 2023 XSTest):安全分类对齐导致模型误判良性但包含敏感词汇的问题(如拒答“如何在 Linux 中杀死一个进程”)。
4. 辨析逻辑推理断裂:算术计算偏差、前提混淆与循环论证。
5. 建立归因排查决策树:区分错误源于预训练知识盲区、指令微调偏置、还是解码采样随机性。

自主演练与记录

编写 Python 错误分类器 categorize_failure(output_record),接收模型生成结果与上下文,自动将其打标至对应分类学桶,并输出针对性的工程修复建议。

独立掌握标准

熟练将各类复杂错误归纳至 4 大分类学维度,并给出明确可落地的工程归因改进方案。

权威源资源与权利证明

linking Open Access / CC BY 4.0

Survey of Hallucination in Natural Language Generation

作者 / 机构: Ziwei Ji, Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Ye Jin Bang, Andrea Madotto, Pascale Fung | 原始出处链接 ↗

对应章节 / 时间戳: Section 2.1 Categorization (intrinsic and extrinsic hallucination)

验证版本与日期: ACM Computing Surveys 2023 / arXiv:2202.03629v4 (Verified: 2026-10-30)

入选理由:

Primary taxonomy of hallucinations in NLG, formalizing the critical distinction between intrinsic hallucinations (contradicting source input context) and extrinsic hallucinations (asserting unverifiable external facts).

来源前置条件:

Natural language generation, factuality evaluation, intrinsic vs extrinsic hallucination.

安全回退方案(离线弹性):

The intrinsic/extrinsic taxonomy, fact-verification prompt protocols, and error attribution workflows are completely developed in lesson modules.

对比候选资源与选型分析 (2)

Focuses on abstractive summarization faithfulness; Ji et al. provides the overarching taxonomy across dialogue, QA, and generation.

Follow-up survey on LLMs; Ji et al. sets out the taxonomy distinctions utilized across evaluation literature.

linking Open Access / CC BY 4.0

XSTest: A Test Suite for Identifying Exaggerated Safety Behaviors in Large Language Models

作者 / 机构: Paul Röttger, Hannah Rose Kirk, Bertie Vidgen, Giuseppe Attanasio, Federico Bianchi, Dirk Hovy | 原始出处链接 ↗

对应章节 / 时间戳: Section 4.4 Results on Unsafe Prompts and Appendix D Details on Automated Evaluation

验证版本与日期: NAACL 2024 / arXiv:2308.01263v2 (Verified: 2026-10-30)

入选理由:

Groundbreaking benchmark identifying exaggerated safety behaviors and false-positive refusals, formalizing test suites that contrast real unsafe prompts against benign prompts with sensitive lexical overlap.

来源前置条件:

Safety alignment, refusal classifiers, false-positive safety evaluation.

安全回退方案(离线弹性):

The 10 refusal prompt categories, refusal detection regex/heuristics, and over-refusal error quantification are implemented in lesson exercises.

对比候选资源与选型分析 (2)

Shows that zero-shot chain-of-thought increases biased and toxic outputs on harmful prompts; XSTest provides an explicit, quantitative evaluation dataset for measuring unnecessary refusal rates.

Safety fine-tuning methodology; XSTest isolates the diagnostic metric for detecting exaggerated refusal side effects.

02 120 分钟

灾难性遗忘与通用能力退化分析

独立掌握检查(无 AI 辅助)

前置要求

第 72 天活动 1 及微调参数动态变化原理。

学习目标

审计与量化领域微调后基座模型在通用语言、逻辑推理与代码任务上的灾难性遗忘现象。

操作指引

1. 学习 Kirkpatrick et al.(2017)与 Luo et al.(2023)前沿理论:针对专业领域分布的微调往往会导致模型权重偏离预训练流形,引发通用能力灾难性遗忘。
2. 认识对齐税(Alignment Tax)与专业化惩罚:特定专业问答可能带来 +15% 的领域得分,却同时导致 GSM8K 通用数学下降 -25% 或丧失多轮对话协调性。
3. 制定灾难性遗忘审计规程:在微调前后,统一在冻结的通用基准集(MMLU STEM、GSM8K、HumanEval、ARC)上运行自动化测试。
4. 计算通用能力保留率(Retention Ratio):Retention = Metric_post / Metric_pre。设定上线警戒红线(例如通用能力衰退不得超过 5%)。
5. 对比治理策略的权衡:经验回放(在领域数据中混入 10~15% 的通用指令数据)、轻量化 LoRA 适配器(仅作用于注意力层,冻结全量 MLP)以及 KL 散度约束。

自主演练与记录

审计某金融微调模型:微调前 MMLU 为 64.2%,GSM8K 为 52.0%;微调后金融准确率达 84.0%,但 MMLU 骤降至 48.1%,GSM8K 骤降至 31.5%。计算通用能力退化百分比并制定 3 步治理方案。

独立掌握标准

能够量化评估领域微调中的灾难性遗忘比例,并设计对应的数据配比与架构级缓解策略。

权威源资源与权利证明

linking Open Access / PNAS Open Access

Overcoming Catastrophic Forgetting in Neural Networks

作者 / 机构: James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A. Rusu, et al. | 原始出处链接 ↗

对应章节 / 时间戳: Section 2 Elastic weight consolidation

验证版本与日期: PNAS 2017 / arXiv:1612.00796v2 (Verified: 2026-10-30)

入选理由:

Foundational paper formalizing catastrophic forgetting during continual fine-tuning, explaining why updating parameters on domain distributions causes dramatic capability loss on pretraining tasks.

来源前置条件:

Neural network weight drift, Fisher information matrix, continual learning.

安全回退方案(离线弹性):

Mathematical explanation of weight trajectory divergence, Fisher regularized objectives, and forgetting audit protocols are integrated into the lesson.

对比候选资源与选型分析 (2)

Cognitive science perspective; Kirkpatrick et al. provides the modern deep neural network gradient formulation (EWC).

Online path integral regularization; Kirkpatrick introduces the benchmark standard for evaluating catastrophic forgetting.

linking Open Access / CC BY 4.0

An Empirical Study of Catastrophic Forgetting in Large Language Models During Continual Fine-tuning

作者 / 机构: Yun Luo, Zhen Yang, Fandong Meng, Yingxue Liu, Jie Zhou, Yue Zhang | 原始出处链接 ↗

对应章节 / 时间戳: Section 3 Method (3.1 Continual Tasks, 3.3 Evaluation Metric) and Section 5.1 Main Results

验证版本与日期: arXiv:2308.08747v2 (Verified: 2026-10-30)

入选理由:

Rigorous empirical investigation demonstrating how domain fine-tuning degrades foundation LLMs across reasoning, coding, and general instruction following, comparing full fine-tuning against parameter-efficient adapters.

来源前置条件:

Instruction fine-tuning, general capability retention, LoRA vs full fine-tuning degradation.

安全回退方案(离线弹性):

General benchmark regression tests, forgetting audit templates, and pre/post radar chart analysis are completely provided.

对比候选资源与选型分析 (2)

Focuses on QA domain transfers; Luo et al. comprehensively assesses broad LLM capability collapse across multiple benchmark domains.

Studies forgetting after fine-tuning multimodal LLMs; Luo et al. targets text-only LLM continual fine-tuning and compares adapter-based with full-parameter tuning.

03 120 分钟

微调前后产物对比分析与多维权衡决策矩阵

Agent 辅助工程检查

前置要求

第 72 天活动 1 至 2 及工程部署资源核算。

学习目标

构建兼顾任务效果、推理延迟、显存占用与服务成本的多维权衡矩阵,完成落地选型论证。

操作指引

1. 树立工程选型观:真实业务落地绝非唯准确率论,单 Token 推理时延、显存硬约束与服务器硬件成本往往是决定性瓶颈。
2. 确立 5 大权衡维度:(a) 任务表现(EM、F1、ROUGE-L)、(b) 推理时延(首 Token 延迟 TTFT、生成吞吐 TPS)、(c) 显存开销(权重体积、KV 缓存、适配器额外开销)、(d) 研发运维成本(训练 GPU 工时、检查点存储体积)、(e) 业务鲁棒性(JSON 结构合规率、拒答率)。
3. 产物全面对比:Base 基座零样本、通用对齐 Chat 模型、领域特化 LoRA 适配器。
4. 适配器合并部署权衡:权重融合部署(零延迟增量、单模型固化)对比动态热插拔 LoRA(基座显存复用、微秒级内核路由延迟)。
5. 拒绝事后因果倒置:在审视评测指标前,必须书面敲定生产级可用性服务等级协议(SLA)。

自主演练与记录

构建 3 款候选架构(Base 7B、Chat 7B、Domain LoRA 7B)在准确率、P99 延迟、显存占用与 JSON 合规率上的对比表格,并依据 SLA 给出推荐选型。

独立掌握标准

熟练将模型评测数据与硬件成本约束融合为多维权衡矩阵,产出经得起推敲的选型决策。

权威源资源与权利证明

linking Open Access

Llama 2: Open Foundation and Fine-Tuned Chat Models

作者 / 机构: Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, et al. | 原始出处链接 ↗

对应章节 / 时间戳: Section 3.4 RLHF Results and Section 4.4 Safety Evaluation of Llama 2-Chat

验证版本与日期: arXiv:2307.09288v2 (Verified: 2026-10-30)

入选理由:

Defines the standard LLaMA-2 instruction format ([INST] <<SYS>> ... <</SYS>> [/INST]) and analyzes token boundary alignment impact on generation stability.

来源前置条件:

Transformer architecture, RLHF/SFT pipelines.

安全回退方案(离线弹性):

The LLaMA-2 prompt structure, token boundary rules, and comparative analysis are fully worked out in curriculum lessons.

对比候选资源与选型分析 (2)

Original foundation model paper without conversational chat tuning details; LLaMA-2 formalizes dialogue formatting.

Jiang et al. Mistral 7B ↗ compared_alternative [Open Access]

Adopts similar [INST] formatting; LLaMA-2 provides the foundational ablation on system prompt integration.

linking Open Access

Training language models to follow instructions with human feedback

作者 / 机构: Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, et al. | 原始出处链接 ↗

对应章节 / 时间戳: Section 4.2 Results on public NLP datasets ('alignment tax') and Appendix E.1

验证版本与日期: arXiv:2203.02155v1 (Verified: 2026-10-30)

入选理由:

Foundational InstructGPT paper defining the SFT objective: maximizing log-likelihood of demonstrator completions conditioned on prompts.

来源前置条件:

Supervised fine-tuning, conditional autoregressive generation.

安全回退方案(离线弹性):

The conditional likelihood objective and prompt-conditioning derivations are completely formulated in the review.

对比候选资源与选型分析 (2)

Earlier RLHF formulation on summarization; InstructGPT standardizes the prompt-response SFT training phase.

Focuses on massive multi-task scaling; InstructGPT details the exact prompt-conditioned loss setup.

04 120 分钟

综合评估:撰写严谨、可复现的诚实模型对比评估报告

独立掌握检查(无 AI 辅助)

前置要求

第 72 天活动 1 至活动 3。

学习目标

撰写符合工业规范的模型对比评估报告,全面披露 95% Bootstrap 置信区间、定性错误内译、消极结果与复现清单。

操作指引

学习来源:在本活动现有的阅读与练习时段内,参考 Hugging Face LLM Evaluation Guidebook (legacy edition) 的 contents/model-as-a-judge/evaluating-your-evaluator.md; contents/troubleshooting/troubleshooting-reproducibility.md,用自己的话解释一处与本地任务的联系。保留现有练习与验收检查;若外部资料无法访问,使用课程自写的解释。1. 遵循 Mitchell et al.(2019)Model Cards 与 Gebru et al.(2021)Datasheets 国际透明度标准。
2. 规范报告核心章节:(1) 执行摘要与决策建议、(2) 预声明评估协议与实验假设、(3) 附带 95% Bootstrap 置信区间的定量评分卡、(4) 定性错误分类学统计(幻觉、格式、拒答、遗忘)、(5) 软硬件权衡矩阵、(6) 负面结果与性能衰退点、(7) 可复现性附录(随机种子、提示词确切签名、推理温度)。
3. 坚持学术与工程诚实:当指标提升处于统计误差范围内时,必须公开承认无显著差异,严禁夸大宣传。
4. 落实数据版权、模型使用协议与开源可审计要求。

自主演练与记录

在一份基于 100 条小样本切片的评测中,Model Alpha 比 Model Beta 准确率高出 3.2%。请为该对比报告撰写执行摘要章节,并对该差异的统计显著性做出客观真实的专业论断。

独立掌握标准

独立产出包含置信区间、错误归因透视与负面结果披露的工业级诚实模型对比报告。

权威源资源与权利证明

linking CC BY-NC-SA 4.0 noncommercial share-alike

Hugging Face LLM Evaluation Guidebook (legacy edition)

作者 / 机构: Hugging Face evaluation-guidebook contributors | 原始出处链接 ↗

对应章节 / 时间戳: contents/model-as-a-judge/evaluating-your-evaluator.md; contents/troubleshooting/troubleshooting-reproducibility.md

验证版本与日期: Public edition checked 2026-11-01; moving pages may change

入选理由:

Teaching-oriented evaluation design and reproducibility guidance complements the benchmark papers. Stable methodological chapters only; not a current tooling/version reference.

来源前置条件:

Held-out data, basic language-model metrics and experimental comparisons.

安全回退方案(离线弹性):

Use the original localized explanations, exercises and checks already present in this activity; no external account or purchase is required for that fallback.

对比候选资源与选型分析 (2)
HELM ↗ compared_alternative [Open Access / CC BY 4.0]

Retained for the multi-metric framework; the guidebook makes practical choices easier to teach.

LM Evaluation Harness ↗ compared_alternative [MIT]

Useful implementation cross-check; tool configuration alone does not teach metric choice or evaluator limitations.

linking arXiv non-exclusive license / Open Access

Model Cards for Model Reporting

作者 / 机构: Margaret Mitchell, Simone Wu, Andrew Zaldivar, Parker Barnes, Lucy Vasserman, Ben Hutchinson, Elena Spitzer, Inioluwa Deborah Raji, Timnit Gebru | 原始出处链接 ↗

对应章节 / 时间戳: Section 4 Model Card Sections (4.1-4.9)

验证版本与日期: FAT* 2019 / arXiv:1810.03993v2 (Verified: 2026-10-30)

入选理由:

Primary standard for structured, transparent model reporting, mandating explicit disclosure of intended uses, evaluation slices, out-of-scope tasks, ethical considerations, and negative results.

来源前置条件:

Evaluation reporting, demographic and performance slicing, model limitations and caveats.

安全回退方案(离线弹性):

Complete Model Card Markdown templates, section schemas, and evaluation disclosure checklists are provided in the curriculum.

对比候选资源与选型分析 (2)

Corporate transparency audit index; Mitchell et al. provides the concrete technical artifact specification for individual model releases.

Dataset documentation focus; Mitchell et al. provides the required specification for trained model artifact reporting.

linking arXiv non-exclusive license / Open Access

Datasheets for Datasets

作者 / 机构: Timnit Gebru, Jamie Morgenstern, Briana Vecchione, Jennifer Wortman Vaughan, Hanna Wallach, Hal Daumé III, Kate Crawford | 原始出处链接 ↗

对应章节 / 时间戳: Section 3 Questions and Workflow (3.1 Motivation through 3.7 Maintenance)

验证版本与日期: Communications of the ACM 2021 / arXiv:1803.09010v8 (Verified: 2026-10-30)

入选理由:

Foundational literature introducing standardized documentation for machine learning datasets, specifying questions on dataset composition, collection mechanisms, preprocessing, and distribution rights.

来源前置条件:

Dataset provenance, curation motivation, preprocessing transparency, maintenance lifecycle.

安全回退方案(离线弹性):

Datasheet questionnaires, provenance schemas, and dataset auditing checklists are completely integrated into lesson materials.

对比候选资源与选型分析 (2)

Linguistic demographic documentation focus; Gebru et al. provides the universal engineering datasheet framework adopted across AI.

Nutrition label metaphor; Gebru et al. is a widely cited framework for dataset documentation in both academic and industrial practice.