69 / 90

Day 69: LoRA Post-Mortem: Delta Evaluation, Regression Audits & Teardown

Compute empirical before/after deltas, audit catastrophic forgetting, reconcile cloud billing, and execute total teardown.

Models and Pretraining 480 active minutes (8 hours)
01 120 min

Post-Fine-Tuning Domain Evaluation and Delta Metric Computation

Agent-Assisted Engineering Check

Prerequisites

Day 68 LoRA training and Day 67 baseline results.

Learning Objective

Evaluate the fine-tuned adapter on the exact prompt suite from Day 67, computing accuracy delta, format compliance improvements, and pairwise win rate.

Instructions

Study source: within this activity's existing reading/practice time, use Hugging Face LLM Course: Fine-tuning LLMs, Chapter 11.5: Custom Evaluation; Example Evaluation Pipeline, then explain one connection to the local task in your own words. Keep the local exercise and acceptance checks; use its original explanation if the external source is unavailable. 1. Load the fine-tuned LoRA adapter onto the frozen base model.
2. Run the identical decoding parameters recorded on Day 67 (e.g. temperature=0.1, max_new_tokens=256) on the same 50 held-out evaluation prompts.
3. Compute post-finetuning metrics: target task accuracy (e.g. 75% vs baseline 15%), format compliance rate (e.g. 96% vs baseline 30%).
4. Calculate absolute and relative deltas: Delta_acc = Acc_finetuned - Acc_baseline.
5. Perform pairwise qualitative comparison: compare prompt-by-prompt completions side-by-side to verify elimination of filler and hallucination.

Practice & Prediction Log

Run post_eval.py. Compute the exact accuracy delta (+XX%) and formatting compliance delta (+YY%) achieved by the fine-tuned adapter over the Day 67 baseline, and verify that delta_acc > 0.30.

Independent Mastery Criterion

Quantify empirical performance deltas achieved by LoRA instruction tuning over baseline.

Authoritative Source Resources & Provenance

linking Apache-2.0

Hugging Face LLM Course: Fine-tuning LLMs

Author: Hugging Face course contributors | Original Source Link ↗

Relevant Section / Range: Chapter 11.5: Custom Evaluation; Example Evaluation Pipeline

Verified Version & Date: Public edition checked 2026-11-01; moving pages may change

Selection Rationale:

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.

Source Prerequisites:

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

Safe Fallback (Offline Resilience):

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

Compared Candidate Sources & Selection Analysis (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

Author: Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, et al. | Original Source Link ↗

Relevant Section / Range: Section 3.6 Evaluation and Section 4.1 Results on the API distribution

Verified Version & Date: arXiv:2203.02155v1 (Verified: 2026-10-30)

Selection Rationale:

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

Source Prerequisites:

Supervised fine-tuning, conditional autoregressive generation.

Safe Fallback (Offline Resilience):

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

Compared Candidate Sources & Selection Analysis (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

Author: Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, Tatsunori B. Hashimoto | Original Source Link ↗

Relevant Section / Range: Preliminary evaluation

Verified Version & Date: Stanford CRFM Release (Verified: 2026-10-30)

Selection Rationale:

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

Source Prerequisites:

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

Safe Fallback (Offline Resilience):

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

Compared Candidate Sources & Selection Analysis (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 min

Catastrophic Forgetting Audits and Qualitative Error Taxonomies

Independent Mastery Check (no AI assistance).

Prerequisites

Day 69 Activity 1 and model behavioral safety principles.

Learning Objective

Audit regressions on general knowledge tasks to detect catastrophic forgetting, categorize remaining failure modes into a formal error taxonomy, and record unimproved metrics honestly.

Instructions

1. Run model against general non-target evaluation prompts (e.g. general coding, arithmetic, creative writing).
2. Measure catastrophic forgetting: quantify whether fine-tuning on specialized instruction data degraded general reasoning capability.
3. Classify remaining errors into a formal taxonomy:
- Schema violation: missing required JSON key or wrong data type.
- Hallucination: inventing non-existent entities or factual inaccuracies.
- Over-refusal: refusing benign queries due to overly rigid safety alignment.
- Truncation: response cut off before completion due to max_tokens limit.
4. Maintain scientific integrity: explicitly acknowledge when specific metrics showed no statistically significant improvement.

Practice & Prediction Log

Construct an error classification summary error_taxonomy.json from all failed test cases. Group errors by taxonomy category and record the general-domain retention score.

Independent Mastery Criterion

Perform a rigorous audit of catastrophic forgetting and categorize failure modes honestly.

Authoritative Source Resources & Provenance

linking Open Access

Training language models to follow instructions with human feedback

Author: Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, et al. | Original Source Link ↗

Relevant Section / Range: Section 4.2 Results on public NLP datasets ('alignment tax') and Appendix E.1

Verified Version & Date: arXiv:2203.02155v1 (Verified: 2026-10-30)

Selection Rationale:

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

Source Prerequisites:

Supervised fine-tuning, conditional autoregressive generation.

Safe Fallback (Offline Resilience):

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

Compared Candidate Sources & Selection Analysis (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

Author: Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, Weizhu Chen | Original Source Link ↗

Relevant Section / Range: N/A

Verified Version & Date: ICLR 2022 / arXiv:2106.09685v2 (Verified: 2026-10-30)

Selection Rationale:

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

Source Prerequisites:

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

Safe Fallback (Offline Resilience):

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

Compared Candidate Sources & Selection Analysis (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 min

Cloud Spending Reconciliation, Safetensors Packaging & Total Teardown

Agent-Assisted Engineering Check

Prerequisites

Day 69 Activity 1-2, Safetensors library, cloud resource deletion.

Learning Objective

Itemize actual GPU compute and disk storage spending against the $10 budget ceiling, package the adapter weights in Safetensors, and execute complete cloud teardown.

Instructions

1. Retrieve invoice details: GPU active hours * rate (e.g. 1.2 hrs * $1.50 = $1.80), storage volume fees ($0.05), data transfer ($0.01).
2. Assert that total spend < $10.00 ceiling (actual: $1.86).
3. Export final adapter weights to adapter_model.safetensors alongside adapter_config.json.
4. Download the ~30MB artifact package locally via SCP.
5. Execute irreversible cloud teardown: terminate instance and permanently delete persistent storage volume. Verify active assets = 0.

Practice & Prediction Log

Reconcile the final cloud spending ledger. Verify that total expenditure is strictly within the $10 ceiling and that cloud assets are 100% destroyed.

Independent Mastery Criterion

Reconcile all experimental spending and enforce 100% complete resource destruction.

Authoritative Source Resources & Provenance

linking arXiv non-exclusive license / Open Access

LoRA: Low-Rank Adaptation of Large Language Models

Author: Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, Weizhu Chen | Original Source Link ↗

Relevant Section / Range: N/A

Verified Version & Date: ICLR 2022 / arXiv:2106.09685v2 (Verified: 2026-10-30)

Selection Rationale:

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

Source Prerequisites:

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

Safe Fallback (Offline Resilience):

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

Compared Candidate Sources & Selection Analysis (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

Author: Sourab Mangrulkar, Sylvain Gugger, Lysandre Debut, Younes Belkada, Sayak Paul, Benjamin Bossan | Original Source Link ↗

Relevant Section / Range: N/A

Verified Version & Date: PEFT 0.10.x / GitHub (Verified: 2026-10-30)

Selection Rationale:

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

Source Prerequisites:

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

Safe Fallback (Offline Resilience):

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

Compared Candidate Sources & Selection Analysis (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 min

Assessment: Four-Language LoRA Reproduction Experiment Report

Independent Mastery Check (no AI assistance).

Prerequisites

Day 69 Activities 1-3.

Learning Objective

Compose and finalize the comprehensive four-language experimental report documenting baseline vs fine-tuned accuracy deltas, error taxonomies, billing reconciliation, and certified teardown.

Instructions

1. Gather all empirical artifacts: baseline accuracy (Day 67), training loss curve and inflection step (Day 68), post-eval accuracy delta (Day 69), error taxonomy breakdown, and financial invoices.
2. Fill out the standardized four-language report template.
3. Verify quantitative and qualitative parity across English, Japanese, Simplified Chinese, and Traditional Chinese sections.
4. Sign off on the cloud infrastructure teardown certification.

Practice & Prediction Log

Publish the four-language LoRA reproduction report. Verify that all metrics match the real log evidence and that the report passes automated structural verification.

Independent Mastery Criterion

Deliver a complete, certified four-language LoRA fine-tuning experimental report.

Authoritative Source Resources & Provenance

linking Open Access

Training language models to follow instructions with human feedback

Author: Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, et al. | Original Source Link ↗

Relevant Section / Range: Section 3.6 Evaluation and Section 4.1 Results on the API distribution

Verified Version & Date: arXiv:2203.02155v1 (Verified: 2026-10-30)

Selection Rationale:

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

Source Prerequisites:

Supervised fine-tuning, conditional autoregressive generation.

Safe Fallback (Offline Resilience):

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

Compared Candidate Sources & Selection Analysis (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

Author: Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, Tatsunori B. Hashimoto | Original Source Link ↗

Relevant Section / Range: Preliminary evaluation and Known limitations

Verified Version & Date: Stanford CRFM Release (Verified: 2026-10-30)

Selection Rationale:

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

Source Prerequisites:

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

Safe Fallback (Offline Resilience):

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

Compared Candidate Sources & Selection Analysis (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.