An open API service indexing awesome lists of open source software.

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

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