LLM Implementation From Scratch Transformer Models
Educational repositories focused on building Large Language Models from first principles using PyTorch, emphasizing step-by-step understanding of transformer architecture, tokenization, and training mechanics. Does NOT include fine-tuning existing models, inference optimization, or production deployment frameworks.
There are 44 llm implementation from scratch models tracked. 1 score above 50 (established tier). The highest-rated is rasbt/LLMs-from-scratch at 69/100 with 87,892 stars. 1 of the top 10 are actively maintained.
Get all 44 projects as JSON
curl "https://pt-edge.onrender.com/api/v1/datasets/quality?domain=transformers&subcategory=llm-implementation-from-scratch&limit=20"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
| # | Model | Score | Tier |
|---|---|---|---|
| 1 |
rasbt/LLMs-from-scratch
Implement a ChatGPT-like LLM in PyTorch from scratch, step by step |
|
Established |
| 2 |
datawhalechina/llms-from-scratch-cn
仅需Python基础,从0构建大语言模型;从0逐步构建GLM4\Llama3\RWKV6, 深入理解大模型原理 |
|
Emerging |
| 3 |
FareedKhan-dev/train-llm-from-scratch
A straightforward method for training your LLM, from downloading data to... |
|
Emerging |
| 4 |
facebookresearch/LayerSkip
Code for "LayerSkip: Enabling Early Exit Inference and Self-Speculative... |
|
Emerging |
| 5 |
kmeng01/rome
Locating and editing factual associations in GPT (NeurIPS 2022) |
|
Emerging |
| 6 |
analyticalrohit/llms-from-scratch
Build a ChatGPT like LLM from scratch in PyTorch, explained step by step. |
|
Emerging |
| 7 |
codewithdark-git/Building-LLMs-from-scratch
This repository guides you through the process of building a GPT-style Large... |
|
Emerging |
| 8 |
geeks-of-data/knowledge-gpt
Extract knowledge from all information sources using gpt and other language... |
|
Emerging |
| 9 |
huangwl18/language-planner
Official Code for "Language Models as Zero-Shot Planners: Extracting... |
|
Emerging |
| 10 |
skyloevil/llm-scratch-pytorch
lm-scratch-pytorch - The code is designed to be beginner-friendly, with a... |
|
Emerging |
| 11 |
therealoliver/Deepdive-llama3-from-scratch
Achieve the llama3 inference step-by-step, grasp the core concepts, master... |
|
Emerging |
| 12 |
clabrugere/scratch-llm
Implements a LLM similar to Meta's Llama 2 from the ground up in PyTorch,... |
|
Emerging |
| 13 |
OpenSparseLLMs/LLaMA-MoE-v2
🚀 LLaMA-MoE v2: Exploring Sparsity of LLaMA from Perspective of... |
|
Emerging |
| 14 |
HxCodeWarrior/StellarByte
从零实现基础的Transformer的Decoerder-Only模型,并进行模型升级,构建专属于自己的LLM模型 |
|
Emerging |
| 15 |
FareedKhan-dev/create-million-parameter-llm-from-scratch
Building a 2.3M-parameter LLM from scratch with LLaMA 1 architecture. |
|
Emerging |
| 16 |
zhanshijinwat/Steel-LLM
Train a 1B LLM with 1T tokens from scratch by personal |
|
Emerging |
| 17 |
Mmorgan-ML/Phase-Slip-Sampler
Phase-Slip is a stochastic intervention architecture that operates on the... |
|
Emerging |
| 18 |
joelbarmettlerUZH/ConceptFormer
Towards Finding the Essence of Everything in Large Language Models |
|
Emerging |
| 19 |
ai-art-dev99/llm-from-scratch
Build a Large Language Model From Scratch |
|
Experimental |
| 20 |
vipulraheja/iterater
Official implementation of the paper "IteraTeR: Understanding Iterative... |
|
Experimental |
| 21 |
bloomberg/minilmv2.bb
Our open source implementation of MiniLMv2... |
|
Experimental |
| 22 |
UCSB-NLP-Chang/ULD
Implementation of paper 'Reversing the Forget-Retain Objectives: An... |
|
Experimental |
| 23 |
jpwahle/emnlp23-paraphrase-types
The official implementation of the EMNLP 2023 paper "Paraphrase Types for... |
|
Experimental |
| 24 |
NamrataThakur/Large_Language_Model_From_Scratch_Implementation
Implementing an LLM from scratch block-by-block using PyTorch |
|
Experimental |
| 25 |
Swamy-s-Tech-Skills-Academy-2026/llms-from-scratch-practice
Hands-on learning repository for building a GPT-style Large Language Model... |
|
Experimental |
| 26 |
nishantb06/smolLM
Reverse Engineering SmolLM2 model and training it from scratch |
|
Experimental |
| 27 |
newfull5/NLLB-200-Distilled-350M-en-ko
nllb-200 distilled 350M for English to Korean translation |
|
Experimental |
| 28 |
Arlchoose-code/Indonesian-LLM-Starter
A starter kit for building your own Indonesian Large Language Model (LLM)... |
|
Experimental |
| 29 |
bijinc/speculoos
efficient speculative sampling for language models |
|
Experimental |
| 30 |
rafaelvp-db/db-ancient-code-translation
Simple repo showing code-to-code and code-to-text capabilities using LLMs on... |
|
Experimental |
| 31 |
shreyansh26/LLM-Sampling
A collection of various LLM sampling methods implemented in pure Pytorch |
|
Experimental |
| 32 |
wasim/scaling-specialization-dense-lms
Do dense LMs develop MoE-like specialization as they scale? Measure it,... |
|
Experimental |
| 33 |
bassrehab/speculative-decoding
Reference implementation of LLM inference acceleration techniques. Includes... |
|
Experimental |
| 34 |
NaS-Research/knowledge-model
Our knowledge system systematically ingests, processes, and indexes... |
|
Experimental |
| 35 |
SoelMgd/Poker_Transformers
LLMs trained for Poker |
|
Experimental |
| 36 |
ghassenov/llm_from_scratch
A GPT-2 model from scratch built to explore the inner workings of... |
|
Experimental |
| 37 |
adarsh-crafts/llama-llm-from-scratch
Educational, from-scratch implementation of a LLaMA-style LLM using PyTorch... |
|
Experimental |
| 38 |
ldr7/language_model_from_scratch
Build a language model from scratch. |
|
Experimental |
| 39 |
YUGESHKARAN/Clash_of_Clans_Language_Model
A mini language model from scratch using PyTorch, with approximately 2.96... |
|
Experimental |
| 40 |
harishm17/build-llm-from-scratch
From‑scratch LLM notebooks: Transformers, BPE tokenizer, PyTorch... |
|
Experimental |
| 41 |
theosorus/French-Language-Model
In this project, I built a French Large Language Model only with pytorch |
|
Experimental |
| 42 |
RobinSmits/Schaapje
Schaapje - A Dutch Small Language Model |
|
Experimental |
| 43 |
mohitpg/LLMs-from-scratch
A collection of LLMs implemented from scratch using pytorch |
|
Experimental |
| 44 |
VisualJoyce/TERepo
[ACL 2023] A Text Editing Repository for reproduction and innovation. |
|
Experimental |