Learn / How LLMs Actually Work
Training, generation & fine-tuning
Assemble a GPT, learn the loss, sample text, and see how assistants are aligned.
Start free, no card
10 lessons a month on the free tier.
Lessons in this class
Stack blocks into a GPT (forward pass)
Assemble the full model and read out next-token scores.
- Embed and add position
- Run through the blocks
- Final norm and unembed to logits
The training objective
Cross-entropy, and watching a loss actually go down.
- Logits to probabilities
- Cross-entropy for one token
- Average over a batch
- Watch a loss go down
Sampling: how text comes out
Greedy, temperature, top-k and top-p decoding.
- Greedy: always the top token
- Temperature
- Top-k
- Top-p (nucleus)
From base model to assistant
How next-token predictors become ChatGPT: SFT and RLHF.
- The last mile: alignment
How CodeTrain teaches this
No videos and no multiple-choice quiz at the end. Each lesson is a handful of small steps in a real editor. You type the code yourself, it runs, and the tutor reviews what you actually wrote. It will not hand you the answer, and the step doesn't advance until your code passes. What you get at the end is a record of which steps you wrote unaided, not a completion percentage.