How tanmay-boop-hash/soc-2025_building_llms_from_scratch works
This repository is a guided, notebook-based course project for building a GPT-style language model in Python and PyTorch. A learner progresses from programming and transformer concepts through preprocessing, attention, model assembly, training, pretrained-weight loading, and fine-tuning, ending with an instruction-tuned model and evaluation. The README documents the major stages; the sampled source shows the GPT-2 download and checkpoint-loading helper. Notebook internals beyond that sample are not verified, so documented connections are cited to the README.
Main entry points: gpt_download3.py GPT-2 weight loading · Week 5 + week 6 + week 7.ipynb Pretraining pipeline · 01-python-variables-types-and-basic-io (1).ipynb Python basics · 04-numpy (1).ipynb NumPy basics
Components 16
Foundations
- Python basics
01-python-variables-types-and-basic-io (1).ipynb - NumPy basics
04-numpy (1).ipynb - Transformer concepts
Week 5 + week 6 + week 7.ipynb
Model construction
- Text preprocessing
week2.ipynb - Attention mechanisms
week3.ipynb - Transformer block
week4 (1).ipynb - Combined implementation
combined_code.ipynb
Training and adaptation
- Pretraining pipeline
Week 5 + week 6 + week 7.ipynb - Text decoding
Week 5 + week 6 + week 7.ipynb - Task fine-tuning
Week 5 + week 6 + week 7.ipynb - Spam classifier
Week 5 + week 6 + week 7.ipynb - Instruction tuning
Week 5 + week 6 + week 7.ipynb - LLM-judge evaluation
Week 5 + week 6 + week 7.ipynb
Model support
- GPT-2 weight loading
gpt_download3.py
Other components
- Learner
- GPT-2 file host
Connections 15
- Learner → Python basics: starts with
README.md - Learner → Transformer concepts: studies
README.md - Python basics → NumPy basics: builds foundations
README.md - NumPy basics → Text preprocessing: continues into
README.md - Text preprocessing → Attention mechanisms: precedes
README.md - Attention mechanisms → Transformer block: feeds into
README.md - Transformer block → Pretraining pipeline: precedes
README.md - Pretraining pipeline → Text decoding: explores
README.md - Pretraining pipeline → GPT-2 weight loading: loads pretrained weights
README.md - GPT-2 weight loading → GPT-2 file host: downloads files
gpt_download3.py - GPT-2 weight loading → Task fine-tuning: provides model weights
README.md - Task fine-tuning → Spam classifier: culminates in
README.md - Task fine-tuning → Instruction tuning: continues to
README.md - Instruction tuning → LLM-judge evaluation: evaluates with
README.md - Combined implementation → GPT-2 weight loading: uses helper
README.md