Skip to content

Navigation Menu

Sign in
Sign up

Latest commit

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

My GPT — Built from Scratch

Assembled from the NeetCode ML course on NeetCode.io Built by Labibul Ahsan Alif on June 21, 2026

Every file in this project is code I wrote and submitted while completing the NeetCode ML course. The problems progressively build from gradient descent fundamentals all the way to a working GPT.

Project Structure

model/ Attention, Transformer, GPT architecture
 attention.py Self-attention head
 multi_head_attention.py Multi-headed attention
 transformer.py Transformer block
 gpt.py GPT model
 normalization.py Layer normalization
 batch_normalization.py Batch normalization
 rms_normalization.py RMS normalization
 embeddings.py Word embeddings
 positional_encoding.py Positional encoding
 kv_cache.py KV-Cache for fast inference
 grouped_query_attention.py Grouped query attention
data/ Data pipeline
 tokenizer.py BPE tokenizer
 vocab.py Character-level vocabulary
 loader.py Batched training data loader
 dataset.py GPT dataset preparation
 nlp_preprocessing.py NLP preprocessing
 tokenizer_utils.py Tokenization edge cases
train.py GPT training loop
generate.py Text generation
foundations/ Neural network primitives built from scratch
 neuron.py, backprop.py, mlp.py, activations.py, loss.py,
 training_loop.py, dead_relu_detector.py, ...

Quick Start

pip install -r requirements.txt
python train.py
python generate.py

Course

This project was built by completing the NeetCode ML Course:

  • Math Foundations (gradient descent, activations, loss functions)
  • Neural Networks from scratch (neuron, backprop, MLP)
  • PyTorch fundamentals
  • NLP pipeline (embeddings, tokenization, attention)
  • Transformer architecture
  • GPT model + text generation

About

GPT built from scratch — assembled from my NeetCode ML course submissions

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /