Log inStart free
LESSON 36.07 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

Selective state-space models

Watch a state-space model choose which words to write and which to skip.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 2 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 36.07 · SELECT BAYSTEP Δ = 1 · MEAN ERROR 0.47
01
Stage 1 of 6 · Fixed step
In 36.05, every token gets the same step Δ = 1. The output y drifts far from the last key word.
Explain it simply

The teal bars on top are the 64 words of the story. Words that reach the ochre line, like cat or tree, are key words. Every word gets the same step here, so the output follows whatever came last. It drifts away from the last key word.

64 input bars, a row of equal step bars, 8 rows of state cells and 64 output bars. A line marks the last key word. The mean distance from it is 0.47.

The weights are set by hand, not trained.
input u, state hΔ, B̄, share in youtput ydashed: fixed step Δ = 1last key word
input u0.5catstep ΔΔ = 1state hh1h8output yFixed step116324864input u0.5catstep ΔΔ = 1state hh1h8output yFixed step116324864
Toy: one channel of the 36.C2 model, 8 states, 64 tokens · only Δ is selective · weights set by hand
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Δt=1,Aˉ=eΔA,yt=C⋅ht\sy{D}{param}{\Delta_t} = 1, \quad \sy{Ab}{param}{\bar A} = e^{\Delta A}, \quad \sy{y}{out}{y_t} = \sy{C}{param}{C}\cdot\sy{h}{data}{h_t}
Δt=1,Aˉt,8=e−2⋅1=0.135,∣yt−ukey∣‾=0.473\Delta_t = 1,\quad \bar A_{t,8} = e^{-2\cdot 1} = 0.135,\quad \overline{|y_t - u_{\text{key}}|} = 0.473

Every token gets one step, so every token moves the state alike.

Common mix-ups

MYTHA fixed SSM can learn to skip filler words.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01If w goes from 8 to 16, does "cat" count more or less in y at token 64?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 2 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.