rasbt/LLMs-from-scratch
Implement a ChatGPT-like LLM in PyTorch from scratch, step by step
739 best points · 155 comments · 17 Hacker News posts · 107,940 GitHub stars · View on GitHub
Hacker News discussions
- Implementing a ChatGPT-like LLM from scratch, step by step (739 points, 98 comments, by rasbt, 2024-01-27)
- Gemma 3 270M re-implemented in pure PyTorch for local tinkering (417 points, 57 comments, by ModelForge, 2025-08-20)
- Finetuning an LLM-Based Spam Classifier with LoRA from Scratch (14 points, 0 comments, by rasbt, 2024-05-11)
- Implementing the Llama 3.2 1B and 3B Architectures from Scratch (5 points, 0 comments, by sbbq, 2024-10-05)
- Comparing 5 ways to implement Multihead Attention in PyTorch (3 points, 0 comments, by rasbt, 2024-03-08)
- Finetune a GPT Model for Spam Detection on Your Laptop in Just 5 Minutes (3 points, 0 comments, by rasbt, 2024-05-03)
- Qwen3 Implemented from Scratch (3 points, 0 comments, by sbbq, 2025-06-20)
- Qwen3 from Scratch (3 points, 0 comments, by tzury, 2025-08-02)
- Explanation of Gated DeltaNet (Qwen3-Next and Kimi Linear) (3 points, 0 comments, by ModelForge, 2025-11-03)
- Insights from Finetuning LLMs for Classification Tasks (2 points, 0 comments, by rasbt, 2024-04-28)
- Evaluating LLMs locally, on a laptop, with Llama 3 and Ollama (2 points, 0 comments, by rasbt, 2024-06-13)
- LLM instruction finetuning from-scratch tutorial (2 points, 0 comments, by sbbq, 2024-06-17)
- Converting GPT to Llama step-by-step code guide (2 points, 0 comments, by sbbq, 2024-09-23)
- Python Setup Tips (2 points, 0 comments, by tosh, 2025-02-16)
- Implement a ChatGPT-like LLM in PyTorch from scratch, step by step (2 points, 0 comments, by jinqueeny, 2025-04-24)
- DeepSeek Sparse Attention (2 points, 0 comments, by eigenBasis, 2026-05-24)
- Olmo 3 from Scratch (Standalone Notebook) (1 points, 0 comments, by quietlearning, 2025-11-24)