Signals to learning / 8. Learn sequences

Lesson 32 of 40 · Advanced · About 35 minutes

State-space memory

When is a recurrence also a convolution?

You will be able to

  • Unroll a fixed linear state-space system.
  • Explain why input-dependent transitions change the fixed-kernel interpretation.

State and readout

A discrete system hₜ=Ahₜ₋₁+Bxₜ, yₜ=Chₜ maps input through state and then a readout. A is a transition matrix, B injects input and C selects output. With h₋₁=0 and fixed matrices, unrolling gives a convolution-like sum with lag kernel CAᵏB. Nonzero initial state adds CAᵗ⁺¹h₋₁.

Modern models are more than fixed decay

Structured state-space models exploit constraints on transitions and kernels for long sequences. Mamba adds input-dependent selection and a hardware-aware scan; that is not generally a single fixed LTI convolution. The lab visualises a fixed two-dimensional rotating decay with impulse injection and no trained readout.

yₜ=Σⱼ₌₀ᵗ CAᵗ⁻ʲBxⱼ when h₋₁=0 and A,B,C are fixed

Worked example

For scalar A=0.5,B=C=1 and x=[1,2], h₀=1 and h₁=2.5. The convolution interpretation gives y₁=0.5×1+1×2=2.5.

A common trap

State-space models and attention are not interchangeable formulas. Their state, retrieval and input-dependence assumptions differ.

Predict, then experiment

What distinguishes a coordinate oscillation from forgetting? Before touching the controls, say or write your prediction.

Interactive experiment

An impulse leaves a rotating memory

How do decay and rotation control the response to one input?

State starts at [1,0], then evolves as hₜ₊₁=ρR(θ)hₜ with no further input. Solid blue and dashed amber are the two state coordinates, not the output of a trained model.

Your experiment

Hold decay 0.95 and compare rotation 0 and 0.8 rad/step. Observe the same norm decay despite different coordinate patterns. Explain what a learned C would change.

Change one parameter at a time. Compare what you observed with your prediction and record an explanation in your notes.

Check your understanding

Try from memory first. Hints and feedback are part of learning, not a penalty. These checks are for self-study, not a graded qualification.

1. Input-dependent transition matrices generally imply…
Give me a hint

Can the same impulse response describe every input-dependent path?

2. For A=0.5,B=C=1,h₋₁=0 and x=[1,2], what is y₁?

Accepted absolute tolerance: ±0.001 .

Give me a hint

Apply the recurrence twice.

Reference answers (after your attempt)
  1. the fixed-LTI-kernel interpretation no longer generally applies — Correct: selection changes the transition sequence.
  2. 2.5 — h₀=1; h₁=0.5×1+2=2.5.

Apply it: Compare representations of the same system

Use paper, your notes, or a local notebook/editor. Code examples are Python 3 starting points to run yourself; this page does not execute code or automatically assess the practical task.

  1. Compute the scalar recurrence for x=[1,2,0].
  2. Compute the lag-kernel sum at each step.
  3. Explain what changes if A depends on xₜ.
Reference solution & review criteria

Both fixed-system calculations give [1,2.5,1.25]. If A varies with the input, different transition products apply at different times; the one fixed convolution kernel no longer generally represents the operator.

Your notebook

Notes and progress stay in this browser. They are not sent to the server; ordinary web-server request logs still operate. Export a backup from the course page.

Review list

Completion requires both correct checks and your practical-task acknowledgement.

Go deeper

Sources support further study; the worked examples and questions here are original. Browser experiments are small, disclosed models—not evidence of production-model quality or hardware performance.