
PyTorch · Transformers · Model Internals
Rebuilding GPT-2 From First Principles
Reimplemented GPT-2 inference from scratch in PyTorch, including causal self-attention, transformer blocks, weight loading, and autoregressive generation, while validating intermediate representations against a reference implementation.


