Learn / How LLMs Actually Work

Neural-net foundations

History, a trainable neuron, an N-gram model, and the RNN the transformer replaced.

Start free, no card 10 lessons a month on the free tier.

Lessons in this class

The road to the Transformer

python · 1 steps · free

How we got from a single neuron to ChatGPT, in seven steps.

  1. Sixty years in one map

Start this lesson

A neuron from scratch

python · 5 steps · free

Build and train a single artificial neuron with NumPy.

  1. The weighted sum
  2. Fire or not: the activation
  3. Wrap it in a predict()
  4. Learn from one mistake
  5. Train the AND gate

Start this lesson

Predict the next word: an N-gram model

python · 4 steps · free

The simplest language model: count what usually comes next.

  1. Split into words
  2. Count what follows each word
  3. Counts into probabilities
  4. Predict the next word

Start this lesson

An RNN cell, unrolled

python · 3 steps · free

Carry a hidden state across a sequence, the pre-Transformer way.

  1. One time step
  2. Carry the state across a sequence
  3. Read out a prediction

Start this lesson

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.

The rest of How LLMs Actually Work

Tokens & embeddingsThe Transformer blockTraining, generation & fine-tuning
Start this class free Browse every course