{
  "schemaVersion": 1,
  "id": "atlas-lesson-scalar-state-space-recurrence",
  "title": "Recurrent state and convolution",
  "category": "learning",
  "format": "Atlas lesson",
  "description": "Carry history in a state; recover the same output by an explicitly unrolled kernel.",
  "canonicalUrl": "https://semiaifoundry.com/learn/atlas/scalar-state-space-recurrence/",
  "publishedDate": null,
  "revisionDate": "2026-10-07",
  "author": null,
  "topic": "Contrasting computational structures",
  "series": null,
  "license": null,
  "rightsUrl": "https://semiaifoundry.com/ai-atlas/licenses.html",
  "version": "1.3.0",
  "status": "Published educational lesson",
  "evidenceScope": "Zero initial state; a and b are constant within the episode; one scalar state; no trained S4, selective state-space model or learned long-memory guarantee. Numerical settings are original teaching fixtures. The named experience executes the stated bounded algorithm; no production performance or independent human review is claimed.",
  "contentCoverage": "published-lesson",
  "artifactUrl": "https://semiaifoundry.com/ai-atlas/lesson-data/scalar-state-space-recurrence-8e4b73d079f45047.json",
  "interactiveUrl": "https://semiaifoundry.com/ai-atlas/#scalar-state-space-recurrence",
  "related": [],
  "supersedes": [],
  "supersededBy": [],
  "contentHash": "c1b7f463d4a0e0e1b2b4dc98ab40dd0428dddc7018cefa9f019582fca9ae433a",
  "contentLength": 6309,
  "jsonUrl": "https://semiaifoundry.com/agents/publications/atlas-lesson-scalar-state-space-recurrence.json",
  "markdownUrl": "https://semiaifoundry.com/agents/publications/atlas-lesson-scalar-state-space-recurrence.md",
  "sections": [
    {
      "id": "section-1",
      "title": "Recurrent state and convolution",
      "start": 53,
      "end": 489
    },
    {
      "id": "section-2",
      "title": "The mechanism",
      "start": 489,
      "end": 1784
    },
    {
      "id": "section-3",
      "title": "Science and assumptions",
      "start": 1784,
      "end": 1812
    },
    {
      "id": "section-4",
      "title": "Recurrent state and convolution · governing computation",
      "start": 1812,
      "end": 2877
    },
    {
      "id": "section-5",
      "title": "Engineering example",
      "start": 2877,
      "end": 3296
    },
    {
      "id": "section-6",
      "title": "Distinctions and tradeoffs",
      "start": 3296,
      "end": 3803
    },
    {
      "id": "section-7",
      "title": "Specifications and interfaces",
      "start": 3803,
      "end": 4279
    },
    {
      "id": "section-8",
      "title": "Interfaces",
      "start": 4279,
      "end": 4565
    },
    {
      "id": "section-9",
      "title": "Check your understanding",
      "start": 4565,
      "end": 4594
    },
    {
      "id": "section-10",
      "title": "Why must an input from before an explicit zero-state reset be excluded from the unrolled sum?",
      "start": 4594,
      "end": 5023
    },
    {
      "id": "section-11",
      "title": "Evidence and scope",
      "start": 5023,
      "end": 5537
    },
    {
      "id": "section-12",
      "title": "Sources",
      "start": 5537,
      "end": 5861
    },
    {
      "id": "section-13",
      "title": "Continue exploring",
      "start": 5861,
      "end": 5884
    },
    {
      "id": "section-14",
      "title": "Foundations",
      "start": 5884,
      "end": 6011
    },
    {
      "id": "section-15",
      "title": "Related lessons",
      "start": 6011,
      "end": 6309
    }
  ],
  "citations": [
    {
      "title": "Explore in Atlas",
      "url": "https://semiaifoundry.com/ai-atlas/#scalar-state-space-recurrence"
    },
    {
      "title": "Gu et al., state spaces and recurrence/convolution §2.3–2.4",
      "url": "https://arxiv.org/html/2111.00396v3"
    },
    {
      "title": "Published lesson data",
      "url": "https://semiaifoundry.com/ai-atlas/lesson-data/scalar-state-space-recurrence-8e4b73d079f45047.json"
    },
    {
      "title": "Atlas releases and licensing",
      "url": "https://semiaifoundry.com/ai-atlas/licenses.html"
    },
    {
      "title": "Tensor shapes, indices and contractions",
      "url": "https://semiaifoundry.com/learn/atlas/tensor-index-contracts/"
    },
    {
      "title": "Graph message passing and node identity",
      "url": "https://semiaifoundry.com/learn/atlas/graph-message-passing/"
    },
    {
      "title": "Self-attention",
      "url": "https://semiaifoundry.com/learn/atlas/attention/"
    },
    {
      "title": "Distributed checkpoint and recovery state",
      "url": "https://semiaifoundry.com/learn/atlas/checkpoint/"
    }
  ],
  "recordHash": "1810fb50e85a5188232388669f9f9dae32df8a9897826911dd3cc9cdd3478861",
  "contentFormat": "text/markdown",
  "content": "Contrasting computational structures · Atlas v1.3.0\n\n# Recurrent state and convolution\n\nCarry history in a state; recover the same output by an explicitly unrolled kernel.\n\n[Explore in Atlas](https://semiaifoundry.com/ai-atlas/#scalar-state-space-recurrence)Abstract computation with explicit coordinate, sample and operation units\n\nLearning objectiveExplain why a recurrence and a convolution agree for the declared time-invariant system, and why a reset changes their history boundary.\n\n## The mechanism\n\nA sequence model needs a representation of what preceded the current observation. A linear state-space system updates a hidden state from its previous value and a new input, then reads out an output. For a time-invariant system, repeatedly substituting the state update expresses that output as a convolution with an impulse-response kernel. The recurrent and convolutional forms are two computations of the same declared map, with different scheduling and storage opportunities. The atlas reduces this relationship to one scalar state so every contribution can be inspected. Changing retention changes the temporal weighting. A reset deliberately discards earlier contributions. Modern structured and selective state-space architectures build on richer matrices, discretization, learned parameters and sometimes input-dependent transitions; their capabilities do not follow from this scalar example.\n\n1.  Start from zero state and sixteen specified input samples, with input gain b = 0.3.\n2.  At each sample compute h = a × previous h + b × input; retain exactly one state scalar.\n3.  Independently multiply every input since the last reset by b a raised to its age and sum the contributions.\n4.  Compare the two results and vary a across decay, sign alternation and growth.\n\n## Science and assumptions\n\n### Recurrent state and convolution · governing computation\n\n$$\nh_t=a h_{t-1}+b x_t=\\sum_{j=r}^{t}b a^{t-j}x_j\n$$\n\nExplain why a recurrence and a convolution agree for the declared time-invariant system, and why a reset changes their history boundary.\n\nSymbols and units\n\nh\\_t\n\nRetained scalar state\n\nstate units\n\na\n\nTime-invariant retention\n\ndimensionless\n\nb\n\nInput gain\n\nstate units per input unit\n\nx\\_j\n\nInput sample\n\ninput units\n\nr\n\nStart of the current zero-state history interval\n\nsample index\n\nWith a = 0.7, b = 0.3 and the first four inputs \\[1, 0, 0, 0\\], recurrent states are \\[0.3, 0.21, 0.147, 0.1029\\]. The impulse kernel has those same first four values. Resetting before sample 2 makes that sample and the next zero, because the earlier impulse is no longer in the retained state. Setting a = −0.7 alternates the sign; a = 1.05 grows an isolated impulse instead of forgetting it.\n\nAssumptions Zero initial state; a and b are constant within the episode; one scalar state; no trained S4, selective state-space model or learned long-memory guarantee.\n\n## Engineering example\n\nWith a = 0.7, b = 0.3 and the first four inputs \\[1, 0, 0, 0\\], recurrent states are \\[0.3, 0.21, 0.147, 0.1029\\]. The impulse kernel has those same first four values. Resetting before sample 2 makes that sample and the next zero, because the earlier impulse is no longer in the retained state. Setting a = −0.7 alternates the sign; a = 1.05 grows an isolated impulse instead of forgetting it.\n\n## Distinctions and tradeoffs\n\nOne persistent scalar and a long sequence do not imply perfect long-term memory or task understanding.\n\nA compact recurrent state makes incremental execution possible, while parallel convolution can expose more training parallelism. Neither representation removes the need to choose and learn a suitable memory structure.\n\nState-space and recurrent models provide a different way to represent temporal dependencies and workload memory from storing attention keys and values.\n\n## Specifications and interfaces\n\nComputational contract\n\nCarry history in a state; recover the same output by an explicitly unrolled kernel.\n\nZero initial state; a and b are constant within the episode; one scalar state; no trained S4, selective state-space model or learned long-memory guarantee.\n\nLearning evidence\n\nInspectable executable specimen\n\nInputs, intermediate values, exact output and a declared comparison or failure are available in Contrasting AI mechanisms.\n\n### Interfaces\n\nSpecified input Input\n\nStart from zero state and sixteen specified input samples, with input gain b = 0.3.\n\nComputed output Output\n\nExplain why a recurrence and a convolution agree for the declared time-invariant system, and why a reset changes their history boundary.\n\n## Check your understanding\n\n### Why must an input from before an explicit zero-state reset be excluded from the unrolled sum?\n\n1.  A reset changes the input sample rate\n2.  The reset discards the state that carried that contribution\n3.  A convolution can never represent recurrence\n\nAnswer and reasoning\n\nThe reset discards the state that carried that contribution\n\nThe two forms agree only when they use the same initial/reset state and history interval.\n\n## Evidence and scope\n\nZero initial state; a and b are constant within the episode; one scalar state; no trained S4, selective state-space model or learned long-memory guarantee. Numerical settings are original teaching fixtures. The named experience executes the stated bounded algorithm; no production performance or independent human review is claimed.\n\nZero initial state; a and b are constant within the episode; one scalar state; no trained S4, selective state-space model or learned long-memory guarantee.\n\n## Sources\n\n-   [Gu et al., state spaces and recurrence/convolution §2.3–2.4](https://arxiv.org/html/2111.00396v3)\n\n[Published lesson data](https://semiaifoundry.com/ai-atlas/lesson-data/scalar-state-space-recurrence-8e4b73d079f45047.json) · [Atlas releases and licensing](https://semiaifoundry.com/ai-atlas/licenses.html)\n\n## Continue exploring\n\n### Foundations\n\n-   [Tensor shapes, indices and contractions](https://semiaifoundry.com/learn/atlas/tensor-index-contracts/)\n\n### Related lessons\n\n-   [Graph message passing and node identity](https://semiaifoundry.com/learn/atlas/graph-message-passing/)\n-   [Self-attention](https://semiaifoundry.com/learn/atlas/attention/)\n-   [Distributed checkpoint and recovery state](https://semiaifoundry.com/learn/atlas/checkpoint/)"
}
