rasbt/LLMs-from-scratch
# Implement a ChatGPT-like LLM in PyTorch from scratch, step by step
$ git clone https://github.com/rasbt/LLMs-from-scratch.git
stars
99,512
forks
15,272
language
Jupyter Notebook
license
Other
What is rasbt/LLMs-from-scratch?
This repository provides a hands-on implementation of a GPT-like language model in PyTorch, building up from foundational concepts through tokenization, attention mechanisms, model architecture, and training procedures. Developers can use it to understand how large language models work under the hood by following step-by-step code examples that cover pretraining, fine-tuning, and instruction-tuning. It's useful for learning the practical details of transformer-based models and natural language processing rather than relying solely on high-level APIs.
Links
Topics
Activity
4 open issues · last updated Jul 21, 2026