SLM From Scratch

May 9, 2026·1 min read

I implemented a small language model from scratch in PyTorch to understand transformer internals: tokenization, attention, positional encoding and the training loop, without high-level abstractions.

Stack: PyTorch, Python