Sign in

Workbench · the workstation

Your Adventures

Every Adventure is a route over the concept graph. Pick one up where you left it, or author a new one.

Interview
Ready

Session 1 · Tier 4

The math under the machine

The companion that writes back to you in this app is still a black box. This Adventure cracks it open from the bottom — and it starts with the one operation a neural network does over and over: a matrix meeting a vector.

1 Lesson

Read through the idea, end on a worked example. No drills, no gates.

2 Volley

Now it asks you to prove it — a live, Claude-judged battle.

3 Boss

One clean synthesis to bank the session's XP.

Teach

…

The linear layer

Weights times input, plus a bias

A single linear layer takes an input vector $x$, multiplies it by a weight matrix $W$, and adds a bias $b$:

$$\text{out} = Wx + b$$

That’s it — no magic. The whole behaviour of the layer is stored in the numbers of $W$ and $b$. “Learning” is just nudging those numbers.

Shapes

The inner dimensions have to match

If $W$ has shape $(4,3)$ and $x$ is a column vector of shape $(3,1)$, the product is defined because the inner $3$’s line up, and the output has shape $(4,1)$:

$$A_{(m,n)}\, B_{(n,p)} = C_{(m,p)}$$

Reading shapes is the single most useful debugging skill in deep learning. Most bugs are a shape that doesn’t line up.

The dot product

One output number is a single dot product

Each entry of the output is one row of $W$ dotted with $x$. The dot product is just “multiply matching parts and add them up”:

$$a\cdot b=\sum_i a_i b_i=|a|\,|b|\cos\theta$$

Its sign reads the angle between the two vectors: positive → they point the same way, $0$ → they’re orthogonal, negative → they oppose. Hold onto that — it is the seed of attention later in this Adventure.

A small example, by hand

Take one row of $W$ and the input $x$, and compute that output entry.

1Row of $W$: $[\,1,\;0,\;-2\,]$,   input $x=[\,2,\;1,\;3\,]^\top$.
2Dot product: $1\cdot2 + 0\cdot1 + (-2)\cdot3 = 2 + 0 - 6 = -4$.
3Add this row’s bias $b=1$: output entry $=-4+1=-3$.

Do that for all four rows of a $(4,3)$ matrix and you get the full $(4,1)$ output vector. That’s a forward pass through one layer.

You
100 / 100
Encounter
Volley
…
Your strike
Encounter cleared
Volley · Cleared

Driven back
Encounter · Incomplete

You ran out of HP — but you saw where it slipped. Here's what to relearn before the rematch. The rematch asks different problems at the same difficulty.

Roadmap

The roadmap

Your route through this Adventure. Tap where you are to pick it up.

Learned so far

Session complete

Attributes
Mastered Today
Trophy · Session 1
Trophy · Foundations of LLMs — Session 1

Your character

Attributes
Mastered