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.