A character-level transformer built from first principles

Project

GPT From Scratch

Year

2026

A decoder-only transformer implemented from the ground up in PyTorch — token and positional embeddings, scaled dot-product attention, multi-head attention, feed-forward blocks, residual connections and layer norm, all written by hand rather than imported.

I built this because using attention and understanding attention are different skills. Working through the tensor shapes, the causal mask, and why residual connections matter for gradient flow taught me more about how these models actually behave than any amount of high-level API work would have.

Scope of Work

PyTorch
Transformer Architecture
Self-Attention
Python

See more of my work

Create a free website with Framer, the website builder loved by startups, designers and agencies.