Tiny GPT with 107,000 parameters trained in browser

olivernguyen.io35 min read

This article explains how a tiny GPT model with about 107,000 parameters works by walking through its architecture step-by-step, from tokenization and embeddings to attention heads and multi-layer perceptrons. The model is trained to invent names of plants and animals based on emoji prompts. Through live numbers, math formulas, and interactive code demonstrations, the article demonstrates how attention mechanisms allow tokens to look back at prompts and how training minimizes cross-entropy loss. Open article →