Implementing a GPT model from scratch
This post implements a GPT-style model from scratch in Elixir/Nx, building on the attention mechanism post. We start with the GPT-2 configuration and parameter counts, then add layer normalization, GELU feed-forward layers, shortcut connections, transformer blocks, the full GPTModel, and a simple greedy text generation loop. https://karlosmid.com/2026/05/implementing-a-GPT-model-from-scratch/
