{"id":50884707,"url":"https://github.com/ginaecho/finetuninglearn","last_synced_at":"2026-06-15T16:03:22.635Z","repository":{"id":362481472,"uuid":"1259259086","full_name":"ginaecho/FinetuningLearn","owner":"ginaecho","description":"Learning finetuning from real hands-on examples to understand the theories, and implement it, step by step","archived":false,"fork":false,"pushed_at":"2026-06-04T12:59:20.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-04T13:07:39.450Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ginaecho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-04T10:32:46.000Z","updated_at":"2026-06-04T12:51:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ginaecho/FinetuningLearn","commit_stats":null,"previous_names":["ginaecho/finetuninglearn"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ginaecho/FinetuningLearn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ginaecho%2FFinetuningLearn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ginaecho%2FFinetuningLearn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ginaecho%2FFinetuningLearn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ginaecho%2FFinetuningLearn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ginaecho","download_url":"https://codeload.github.com/ginaecho/FinetuningLearn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ginaecho%2FFinetuningLearn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34369850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-15T16:03:19.204Z","updated_at":"2026-06-15T16:03:22.620Z","avatar_url":"https://github.com/ginaecho.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FinetuningLearn\n\nLearning fine-tuning from real hands-on examples — understand the theory, then implement it, step by step.\n\nEach **case** has three layers so you can learn the way that suits you:\n\n| Layer | File | What it gives you |\n|-------|------|-------------------|\n| 🎬 **Animation** | `animation.html` | Open in a browser. Sliders + animated canvases build intuition *before* any math. |\n| 📓 **Notebook** | `*.ipynb` | Runnable Jupyter notebook: theory refresher → code → experiment. Cases 01-02 run on CPU; from Case 03 onward, notebooks are **Colab-first** (free T4 GPU). |\n| 🧪 **Your turn** | `challenge.md` | An open problem to solve yourself, with hints and a checklist. |\n\n\u003e **New here?** Read [`SETUP.md`](./SETUP.md) first to install PyTorch + LoRA/QLoRA and hook up your local Llama.\n\n---\n\n## The roadmap (medium → professional)\n\nThe cases are ordered so each one earns the next. The whole path is built to land on **your** question:\n*how do you keep fine-tuning a self-driving model as new data arrives — cheaply, accurately, and without it forgetting what it already knew?*\n\n| # | Case | Level | Core idea you'll own | Status |\n|---|------|-------|----------------------|--------|\n| 00 | **Tensors \u0026 NN Basics** — the co-pilot vocabulary | Beginner | Shapes, layers, the training loop; what you must know vs what the agent handles | ✅ Built |\n| 01 | **Foundations** — what *is* fine-tuning? | Medium | Pre-train vs fine-tune; which weights move; over/underfitting | ✅ Built |\n| 02 | **LoRA from scratch** | Medium | Why low-rank adapters work; implement LoRA in ~30 lines | ✅ Built |\n| 03 | **QLoRA on a real LLM** | Medium+ | 4-bit quantization + LoRA; fine-tune on a free Colab T4 | ✅ Built |\n| 04 | **Instruction / SFT tuning** | Pro-ish | Datasets, chat templates, eval; measure if it actually learned | 🔜 |\n| 05 | **Catastrophic forgetting — see it happen** | Pro-ish | Train task B, watch task A collapse; *measure* forgetting | ✅ Built |\n| 06 | **Continual learning toolkit** | Pro | Replay, EWC, LoRA-per-task, distillation — when to use which | ✅ Built |\n| 07 | **Capstone: Auto-car continual fine-tuning** | Pro | Cost vs accuracy vs forgetting on a streaming-update problem | ✅ Built |\n\n✅ = ready to learn now. 🔜 = built as you progress (so each builds on what you actually ran).\n\n---\n\n## How to use this repo\n\n1. **Install once:** follow [`SETUP.md`](./SETUP.md).\n2. **Pick a case folder** under [`cases/`](./cases/), start with `01_foundations`.\n3. In each folder:\n   - Open `animation.html` in your browser → play with it for 5 min.\n   - Open the `.ipynb` — Cases 01-02 run locally; **from Case 03 onward, open in Google Colab** (free T4 GPU, no install needed). Each notebook has a setup cell that installs everything.\n   - Try `challenge.md` → solve it, then compare with notes.\n4. Come back and we build the next case together.\n\n---\n\n## 💬 Ask-the-tutor (in the animations)\n\nEvery `animation.html` has a **floating \"💬 Ask tutor\" button**. Click it, paste your API key once\n(⚙ settings), and ask questions about whatever you're looking at — the tutor is given the page's context\nso its answers fit the lesson.\n\n- **Resizable window:** drag the bottom-right corner, **⤢ maximize**, or **▁ collapse** to just the title\n  bar. Your size/state is remembered.\n- **Readable answers:** replies render as **Markdown** (headings, lists, code blocks, links).\n- **📚 Self-updating lesson:** every answer is folded into the tutorial as a new collapsible section, so the\n  lesson grows to cover *your* questions. **Curate it:** click **👍 Useful** to keep a section or\n  **🗑 This can be removed** to drop it. Kept sections are fed back to the tutor as memory, so it builds on\n  what you found useful (saved per page).\n\n- **Bring your own key:** **Anthropic (Claude)** by default, or **OpenAI**. Pick the provider in ⚙.\n- **Your key stays local.** It's saved in your browser's `localStorage` on your machine and sent *only*\n  to the provider you choose (Claude calls use Anthropic's official direct-browser-access header). It is\n  **never** written into the HTML or committed to git.\n- **Where to get a key:** Anthropic → \u003chttps://console.anthropic.com/settings/keys\u003e · OpenAI → \u003chttps://platform.openai.com/api-keys\u003e.\n- ⚠️ Don't type your key on a shared/public computer, and don't paste a key into any file in this repo.\n\nSee [`SETUP.md` §7](./SETUP.md#7-in-page-ai-tutor-optional) for details.\n\n---\n\n## Your capstone question (Case 07)\n\n\u003e *\"In fine-tuning for an autonomous car, when new memory/data and new training arrive, how do I fine-tune in the best way for cost, efficiency, and accuracy — and how do I overcome catastrophic forgetting?\"*\n\nWe don't hand-wave this. By Case 07 you'll have built every piece:\n- **Cost/efficiency** ← LoRA \u0026 QLoRA (Cases 02–03): tune \u003c1% of weights.\n- **Accuracy** ← SFT + eval discipline (Case 04).\n- **Forgetting** ← measure it (Case 05), then defeat it (Case 06) with replay / regularization / modular adapters.\n\nCase 07 puts them together on a simulated streaming self-driving task and makes you trade the three off against each other — the real engineering decision.\n\n---\n\n## Glossary quick-reference\n\n- **Fine-tuning** — continue training a pre-trained model on new, narrower data.\n- **LoRA** (Low-Rank Adaptation) — freeze the big model, train two small matrices per layer.\n- **QLoRA** — LoRA on top of a 4-bit quantized model → fits big models on small GPUs.\n- **Catastrophic forgetting** — a model loses old skills when trained on new data.\n- **Continual / lifelong learning** — training on a *stream* of tasks without forgetting.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fginaecho%2Ffinetuninglearn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fginaecho%2Ffinetuninglearn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fginaecho%2Ffinetuninglearn/lists"}