Index

Module 06 · AIGPT, built from scratch

The GPT Block

From Transformer to LLM
From Transformer to LLM · Open board

The From Transformer to LLM board draws the stack of identical layers inside a language model. This lesson builds that stack at toy size: the fifth of six lessons that end with a small GPT built from scratch.

Before you start. A weight is one adjustable number inside a model, and training nudges every weight, again and again, to shrink the loss, one number for how wrong the guesses were. Validation loss is that same score measured on text held back from training; in The MLP Language Model a model that read the last eight characters of a returns-desk reply scored 0.1784 on it. From Tokens & Embeddings: an embedding is a short list of numbers that stands for one piece of text, looked up by its id. From What a Neural Network Is: a hidden layer is a row of neurons between input and answer, each adding up its inputs times weights, and ReLU after it turns every negative total into zero. From The Maths Floor, Part 2: Probability, Softmax and Temperature: softmax turns a list of scores into shares that add to 1. From Attention by Hand: in attention, each position in the text scores every earlier position, turns the scores into shares, and takes a blend of what those positions offer, weighted by the shares; each copy running side by side is a head.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Related paper

Review AI →

Saved in this browser, and to your account when you sign in.