A hands-on mini-project where I built a basic GPT-style character-level language model from scratch using PyTorch. This repo explores how transformers work and how text can be modeled and generated.
- Tokenization & Preprocessing: Converted raw text into token sequences for model training.
- Bigram Baseline: A simple token-to-next-token predictor to compare against transformer performance.
- Transformer Model: Built transformer blocks featuring multi-head self-attention, feed-forward layers, and layer normalization.
- Text Generation: Trained the model to autoregressively generate text one character at a time.
- Python
- PyTorch
- NumPy
- Clone this repository:
git clone https://github.com/Sushitrashhhh/gpt-from-scratch.git cd gpt-from-scratch - Install dependencies:
pip install -r requirements.txt