https://github.com/borhanmorphy/llm-fine-tuning-101
LLM Fine-Tuning 101
https://github.com/borhanmorphy/llm-fine-tuning-101
Last synced: 12 months ago
JSON representation
LLM Fine-Tuning 101
- Host: GitHub
- URL: https://github.com/borhanmorphy/llm-fine-tuning-101
- Owner: borhanMorphy
- License: mit
- Created: 2025-05-17T17:26:58.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-26T22:31:07.000Z (about 1 year ago)
- Last Synced: 2025-06-07T11:08:30.644Z (about 1 year ago)
- Language: Python
- Size: 77.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ง Educational Repository for Fine-Tuning Large Language Models (LLMs) โ PyTorch Only
Welcome to the **LLM Fine-Tuning Educational Repository**, built entirely with **pure PyTorch** โ no HuggingFace, no external frameworks. This project is designed to provide a hands-on, from-scratch learning experience for understanding and fine-tuning large language models. Perfect for learners who want to build a solid foundation by implementing everything step by step.
---
## ๐ What You'll Learn
- Core architecture and internals of LLMs and SLMs
- Dataset handling, preprocessing and multi-gpu training with PyTorch
- Building tokenizers and vocabularies from scratch
- Implementing training loops and loss functions
- Fine-tuning techniques without relying on external libraries
- LoRA (Low-Rank Adaptation) for parameter-efficient fine-tuning
- DPO (Direct Preference Optimization) for aligning models using preference data
---
## ๐ ๏ธ Repository Structure
```
.
โโโ demo/ # Markdowns for demos
โโโ scripts/ # Utility scripts
โโโ slm_full_sft.py # Supervised Full Fine-Tuning Smollm2
โโโ slm_lora_sft.py # Supervised Fine-Tuning Smollm2 via LoRA
โโโ llm_lora_sft.py # Supervised Fine-Tuning Gemma3 via LoRA
โโโ README.md # This file
```
## ๐งช Demos
| Markdown | Description |
| ---------------------------------- | --------------------------------------- |
| `YugiohGPT.md` | Yugioh Card generation via LLM |
## ๐ก Why No HuggingFace?
This repo is intended for educational purposes. By not using external libraries, youโll:
- Learn how everything works under the hood
- Gain deep insight into training dynamics and model architecture
- Build skills that translate to research and custom implementations