
Build a Small LLM From Scratch: A Tested GPT in PyTorch
A practical, fully tested GPT implementation in PyTorch with causal attention, training, sampling, baselines, checkpoints, and 25 tests. Trained on Tiny Shakespeare with 813K parameters and a final validation loss near 1.78.



