Open-Source Project Replicates Full LLM Training Pipeline in Pure PyTorch

thisguyknowsai · x · 2026-08-15

Developer Fareed Khan released train-llm-from-scratch on GitHub, demonstrating the complete pipeline from raw data to a modern aligned reasoning model, with all algorithms hand-written in pure PyTorch, without trl, peft, or transformers. The project covers pretraining (based on Attention is All You Need), SFT, reward modeling, DPO, PPO, and GRPO (DeepSeek-R1 method), along with theory docs, hand-drawn diagrams, and code. It serves as a comprehensive educational resource for LLM training.

Original post →

More from coding & agent

coding & agent channel →