<aside> 📌
Notes from implementing GPT from scratch following Karpathy's tutorial, with extra annotations on shapes and intuitions.
</aside>
https://github.com/archit-manek/gpt_scratch
input.txt (Tiny Shakespeare).stoi (string-to-integer) and itos mappings.tensor(5)) are not the same as Python integers (5)..tolist() to extract values before passing them to standard Python functions (like string decoders).# Don't loop over the tensor directly
decode(out.tolist())
In Mechanical Interpretability, always track the shapes: