69 / 90

第 69 天:微調訓後歸因分析:增量測算、遺忘回歸審計與徹底銷毀

測算微調前後真實能力增量(Delta)、審計災難性遺忘衰退、財務逐項對賬並物理銷毀資產。

模型與預訓練 480 分鐘有效研習(8 小時)
01 120 分鐘

微調後垂直領域評測與基準對照增量(Delta)測算

Agent 輔助工程檢查

前置要求

第 68 天 LoRA 訓練收斂成果與第 67 天基準測試數據。

學習目標

在第 67 天完全相同的留出 Prompt 測試集上評估微調後適配器,精確核算相比基準基準的準確率增量(Delta)、格式遵從度提升與成對相對勝率。

操作指引

學習來源:在本活動現有的閱讀與練習時段內,參考 Hugging Face LLM Course: Fine-tuning LLMs 的 Chapter 11.5: Custom Evaluation; Example Evaluation Pipeline,用自己的話解釋一處與本地任務的聯繫。保留現有練習與驗收檢查;若外部資料無法存取,使用課程自寫的解釋。1. 將訓練收斂的 LoRA 適配器安全掛載至凍結基座模型之上。
2. 採用與第 67 天基線測試記錄的完全相同的解碼超參數(如 temperature=0.1, max_new_tokens=256)運行同樣的 50 道留出測試題。
3. 測算微調後多項硬指標:垂直任務準確率(如由基準的 15% 躍升至 75%)、結構化格式遵從率(如由基準的 30% 提升至 96%)。
4. 嚴格計算絕對增量指標:Delta_acc = Acc_finetuned - Acc_baseline。
5. 展開逐題並排對照(Side-by-Side Review):觀察基座原有的無序閒聊客套話如何被精準、結構化的專業回復徹底替代。

自主實作與記錄

運行 post_eval.py 評測腳本。核算微調適配器相比第 67 天基線的準確率淨增量(+XX%)與格式遵從率淨增量(+YY%),並驗證 delta_acc > 0.30。

獨立掌握標準

能準確給出微調成效的實測淨增量(Delta)統計,並基於對照法則論證有效性。

權威來源資源與權利證明

linking Apache-2.0

Hugging Face LLM Course: Fine-tuning LLMs

作者 / 機構: Hugging Face course contributors | 原始出處連結 ↗

對應章節 / 時間戳: Chapter 11.5: Custom Evaluation; Example Evaluation Pipeline

驗證版本與日期: Public edition checked 2026-11-01; moving pages may change

入選理由:

Sequenced templates, supervised fine-tuning and evaluation teaching with exercises/quizzes. LoRA method and memory claims are checked against the original paper, PEFT and the local parameter ledger, not accepted wholesale from Chapter 11.4.

來源前置條件:

Python, PyTorch, language-model training and the preceding chat-format lessons.

安全回退方案(離線彈性):

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

對比候選資源與選型分析 (2)
LoRA original paper ↗ compared_alternative [arXiv.org perpetual non-exclusive license / Open Access]

Retained for initialization and the low-rank method, not a beginner teaching sequence.

Hugging Face PEFT ↗ compared_alternative [Apache-2.0]

Retained for actual API and implementation defaults; reference documentation is not a complete teaching course.

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 3.6 Evaluation and Section 4.1 Results on the API distribution

驗證版本與日期: 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.

linking Copyright Stanford CRFM (blog post; no open license stated)

Stanford Alpaca: An Instruction-following LLaMA Model

作者 / 機構: Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, Tatsunori B. Hashimoto | 原始出處連結 ↗

對應章節 / 時間戳: Preliminary evaluation

驗證版本與日期: Stanford CRFM Release (Verified: 2026-10-30)

入選理由:

Original open recipe demonstrating lightweight instruction fine-tuning of open models, establishing prompt/response templates, batch scheduling, and learning rate ranges.

來源前置條件:

Supervised fine-tuning, instruction formatting, and LoRA fundamentals.

安全回退方案(離線彈性):

Complete instruction templates, JSONL formatting scripts, and learning rate schedules are self-contained in curriculum materials.

對比候選資源與選型分析 (2)

Multi-turn ShareGPT tuning recipe; Alpaca provides simpler, single-turn clarity ideal for foundational instruction tuning study.

Databricks Dolly 15k Dataset & Training Recipe ↗ compared_alternative [CC-BY-SA 3.0]

Commercially permissive crowdsourced dataset; Alpaca established the academic instruction tuning standard.

02 120 分鐘

災難性遺忘回歸審計與定性錯誤分類學(Taxonomy)

獨立掌握檢查(無 AI 輔助)

前置要求

第 69 天活動 1 與大模型安全及認知邊界分析準則。

學習目標

全面審計模型在非目標通用常識任務上的能力退化(災難性遺忘,Catastrophic Forgetting),將剩餘失誤歸入標準化錯誤分類學體系,並誠實公示未見顯著改善的指標項。

操作指引

1. 抽檢通用領域對比測試集(如基礎代碼補全、基礎四則運算、開放常識問答)。
2. 量化災難性遺忘程度:核算特定指令微調是否導致模型原本具備的通用推理泛化能力發生坍塌。
3. 建立四維定性錯誤分類學(Taxonomy):
- Schema 格式違規:漏寫必填字段、數值類型錯誤或 JSON 截斷。
- 事實性幻覺(Hallucination):無中生有編造虛假實體或扭曲事實。
- 過度拒絕(Over-refusal):對正常請求產生過敏性防禦拒絕。
- 語義不完全(Truncation):因長度限制導致關鍵推導中途截斷。
4. 堅守學術與工程誠實原則:對未達成預期的指標項保持顯式暴露,嚴禁因片面迎合驗收而修飾或篡改評測準則。

自主實作與記錄

對所有未完全答對的測試用例進行歸因聚類,輸出錯誤分類賬本 error_taxonomy.json,並計算通用常識領域的能力保留率(Retention Rate)。

獨立掌握標準

能準確審計災難性遺忘風險,構建嚴謹的錯誤歸因分類學,客觀展現未改善指標。

權威來源資源與權利證明

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.

linking arXiv non-exclusive license / Open Access

LoRA: Low-Rank Adaptation of Large Language Models

作者 / 機構: Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, Weizhu Chen | 原始出處連結 ↗

對應章節 / 時間戳: N/A

驗證版本與日期: ICLR 2022 / arXiv:2106.09685v2 (Verified: 2026-10-30)

入選理由:

Primary literature introducing Low-Rank Adaptation, establishing parameter decomposition W = W0 + (alpha/r)*BA, initialization strategies, and zero inference latency merging.

來源前置條件:

Matrix factorization, rank, linear layers, and transformer attention.

安全回退方案(離線彈性):

Complete matrix derivations, tensor dimensions, and pure PyTorch LoRALinear modules are implemented directly in lesson code.

對比候選資源與選型分析 (2)

Introduces bottleneck adapter layers in series, which introduces unavoidable inference latency overhead; LoRA's parallel formulation merges with zero latency.

Prepends virtual prompt tokens; reduces available context length, unlike LoRA which preserves full sequence capacity.

03 120 分鐘

雲端賬單財務對賬、Safetensors 資產打包與徹底物理下線

Agent 輔助工程檢查

前置要求

第 69 天活動 1 與 2,Safetensors 規範及雲資源註銷物理下線流程。

學習目標

對照 $10.00 預算上限逐項對賬 GPU 工時與存儲開銷(實際約 $1.86),將收斂適配器轉換為安全的 Safetensors 格式並同步本地,執行不可逆的雲端資產全量註銷。

操作指引

1. 匯出實際帳單對帳明細:GPU 計費工時(如 1.2 小時 * $1.50 = $1.80)、雲端硬碟儲存費($0.05)與出網流量費($0.01)。
2. 核驗總消費嚴格低於預檢設定的 $10.00 安全紅線(實測約 $1.86)。
3. 將最優檢查點提煉打包為 adapter_model.safetensors 及配套的 adapter_config.json。
4. 通過 scp 將約 30MB 的輕量增量資產無損同步至本地代碼庫。
5. 執行徹底物理下線清單:終止計算實例並顯式註銷掛載雲硬盤,驗證活動資產數量歸零,杜絕一切隱形扣費可能。

自主實作與記錄

生成終審財務對賬單與資源下線核驗單。核實總開銷未超標,且雲端實例與存儲卷狀態確認完全銷毀(teardown_status == 'COMPLETED')。

獨立掌握標準

完成嚴密的微調財務賬單對賬,將輕量增量資產安全歸檔並徹底物理下線雲端基礎設施。

權威來源資源與權利證明

linking arXiv non-exclusive license / Open Access

LoRA: Low-Rank Adaptation of Large Language Models

作者 / 機構: Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, Weizhu Chen | 原始出處連結 ↗

對應章節 / 時間戳: N/A

驗證版本與日期: ICLR 2022 / arXiv:2106.09685v2 (Verified: 2026-10-30)

入選理由:

Primary literature introducing Low-Rank Adaptation, establishing parameter decomposition W = W0 + (alpha/r)*BA, initialization strategies, and zero inference latency merging.

來源前置條件:

Matrix factorization, rank, linear layers, and transformer attention.

安全回退方案(離線彈性):

Complete matrix derivations, tensor dimensions, and pure PyTorch LoRALinear modules are implemented directly in lesson code.

對比候選資源與選型分析 (2)

Introduces bottleneck adapter layers in series, which introduces unavoidable inference latency overhead; LoRA's parallel formulation merges with zero latency.

Prepends virtual prompt tokens; reduces available context length, unlike LoRA which preserves full sequence capacity.

linking Apache-2.0

PEFT: State-of-the-art Parameter-Efficient Fine-Tuning Methods

作者 / 機構: Sourab Mangrulkar, Sylvain Gugger, Lysandre Debut, Younes Belkada, Sayak Paul, Benjamin Bossan | 原始出處連結 ↗

對應章節 / 時間戳: N/A

驗證版本與日期: PEFT 0.10.x / GitHub (Verified: 2026-10-30)

入選理由:

Widely adopted open-source library implementing LoRA configuration classes (LoraConfig), get_peft_model, and adapter serialization.

來源前置條件:

PyTorch nn.Module, Hugging Face transformers, and LoRA equations.

安全回退方案(離線彈性):

Standalone, zero-dependency PyTorch implementations of LoRALinear layers and save/reload logic are provided in curriculum scripts.

對比候選資源與選型分析 (2)

Original reference code by Hu et al.; PEFT expands this to broader multi-model ecosystem integration.

Lit-GPT LoRA implementation (Lightning AI) ↗ compared_alternative [Apache 2.0]

High-performance clean implementation; compared alongside PEFT for modular code architecture.

04 120 分鐘

考核評估:四語言規範化 LoRA 微調複現實驗報告終審交付

獨立掌握檢查(無 AI 輔助)

前置要求

第 69 天活動 1 至 3 全部內容。

學習目標

全面彙整微調全生命週期客觀證據,撰寫涵蓋基準基準對照、準確率增量 Delta、錯誤分類學歸因、全口徑賬單對賬與徹底物理下線認證的標準化四語言實驗報告。

操作指引

1. 彙總全鏈路實測客觀數據:第 67 天零樣本基準得分、第 68 天最優早停步數、第 69 天微調後準確率淨增量、通用常識遺忘率與逐項賬單消費。
2. 規範填報標準四語言技術報告結構。
3. 細致校對中文(簡體/繁體)、英語、日語四個版本在數值、術語及結論上的完全對齊。
4. 正式簽署雲端基礎設施徹底銷毀確認書,閉環歸檔本次實驗資產。

自主實作與記錄

交付四語言 LoRA 微調實驗綜合技術報告。斷言全量核心數據(Delta 提升率、分類錯誤數、實際支出 < $10)在四種語言版本中完全一致並順利通過自動化審查。

獨立掌握標準

產出符合工業級前沿標準且證據鏈完備的四語言 LoRA 實驗技術報告與下線證明。

權威來源資源與權利證明

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 3.6 Evaluation and Section 4.1 Results on the API distribution

驗證版本與日期: 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.

linking Copyright Stanford CRFM (blog post; no open license stated)

Stanford Alpaca: An Instruction-following LLaMA Model

作者 / 機構: Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, Tatsunori B. Hashimoto | 原始出處連結 ↗

對應章節 / 時間戳: Preliminary evaluation and Known limitations

驗證版本與日期: Stanford CRFM Release (Verified: 2026-10-30)

入選理由:

Original open recipe demonstrating lightweight instruction fine-tuning of open models, establishing prompt/response templates, batch scheduling, and learning rate ranges.

來源前置條件:

Supervised fine-tuning, instruction formatting, and LoRA fundamentals.

安全回退方案(離線彈性):

Complete instruction templates, JSONL formatting scripts, and learning rate schedules are self-contained in curriculum materials.

對比候選資源與選型分析 (2)

Multi-turn ShareGPT tuning recipe; Alpaca provides simpler, single-turn clarity ideal for foundational instruction tuning study.

Databricks Dolly 15k Dataset & Training Recipe ↗ compared_alternative [CC-BY-SA 3.0]

Commercially permissive crowdsourced dataset; Alpaca established the academic instruction tuning standard.