Module 3.2
Same output head as Module 2.3, same vocabulary, same query — but this time the model hasn't learned "quota" yet. Watch cross-entropy measure exactly how wrong it is, then watch one gradient step nudge it toward the right answer.
The math
Every weight in the entire network gets a version of this same nudge — the chain rule is just this gradient, propagated backward through every matrix that helped compute the logits.
The code
def softmax(x):
e = np.exp(x - x.max())
return e / e.sum()
def cross_entropy(logits, true_idx):
probs = softmax(logits)
return -np.log(probs[true_idx]), probs
loss, probs = cross_entropy(logits, true_idx)
one_hot = np.zeros_like(probs); one_hot[true_idx] = 1.0
grad = probs - one_hot # ∂loss/∂logits, exactly
lr = 0.01 # realistic learning rate
logits = logits - lr * grad # gradient descent step
Real training runs this on batches of thousands of (context, next-token) pairs at once, and the gradient reaches all the way back through every attention and feed-forward matrix in every block — but it is, at its core, this loop.
Go deeper (optional)
A shorter, focused clip on the general mechanism (not specific to language models) — useful if the "logits minus one-hot" shortcut above felt like it skipped a step.
StatQuest with Josh Starmer — "Gradient Descent, Step-by-Step." Supplementary and optional.
The Nimbus thread
Nothing about "workspace quota" is built into a base model. If Nimbus's real support transcripts show "export fail" followed by "quota" often enough, this exact update — repeated across millions of examples — is what shifts the weights until the model predicts it confidently, the way Module 2.3 assumed it already did. Module 3.3 covers what changes when this happens at each stage: pretraining, fine-tuning, and instruction-tuning.
So what
Training is predict, measure how wrong, nudge every weight a little — repeated billions of times, never anything more mysterious than that.