{
  "schemaVersion": 1,
  "slug": "mamba",
  "title": "Carry context through a selective state",
  "className": "TinyMamba",
  "question": "How does the input decide what a recurrent state retains?",
  "description": "Follow a causal convolution into input-dependent state dynamics, then replay the scan and compare its fixed-size streaming state.",
  "category": "Alternative architectures",
  "tags": [
    "Mamba",
    "Selective SSM",
    "State space",
    "Scan",
    "Recurrence"
  ],
  "curator": "TensorViz",
  "attribution": "Original TensorViz teaching example. PyTorch provides the underlying operators.",
  "license": "No separate redistribution license has been declared for these project examples.",
  "limitations": "Untrained single teaching block, without token embeddings or a language head. CPU sequential loop with exact ZOH B discretization; the released fast implementation uses a simplified delta × B input term. No fused parallel scan, custom backward or measured speed claim. The static graph groups the recurrence in a Python node; the panel records its actual state history. This model does not universally replace attention.",
  "openingStep": "select",
  "provenance": {
    "capturedAt": "2026-09-17T06:55:55.075292+00:00",
    "productRevision": "cf0ab1c9c58c1dc640235b742fa032cade00b43c",
    "sourceSha256": "cc6ddffd335c7c6f37f908ea898b9826b5e199f49ca0fcc76d494fca0734bd85",
    "python": "3.13.13",
    "torch": "2.7.1",
    "execution": {
      "inputs": {
        "args": [
          {
            "shape": [
              1,
              6,
              4
            ],
            "dtype": "float32",
            "fill": "randn"
          }
        ]
      },
      "device": "cpu",
      "mode": "eval",
      "seed": 0,
      "deterministic": true
    },
    "outcome": "passed",
    "outputShape": [
      1,
      6,
      4
    ],
    "method": "TensorViz multifile projection and isolated execution worker",
    "scope": "Reduced Mamba-style block with causal convolution, input-dependent delta/B/C and diagonal ZOH scan. Causality, token streaming, closed-form recurrence and selection-gradient checks.",
    "numericalChecks": [
      "Future changes leave every earlier output unchanged",
      "Token streaming with a 16-value convolution cache and 24-value SSM state matches the full forward",
      "The recurrent state matches an independent sum of decayed past writes",
      "Negative diagonal A and positive input-dependent delta give decay factors between zero and one; selection maps receive gradients"
    ]
  },
  "layers": [
    {
      "id": "input",
      "label": "input",
      "op": "Input",
      "kind": "input",
      "parent": null,
      "params": {
        "shape": "1,6,4"
      }
    },
    {
      "id": "norm",
      "label": "norm",
      "op": "LayerNorm",
      "kind": "layer",
      "parent": null,
      "params": {
        "normalized_shape": 4
      },
      "source": {
        "line": 49,
        "endLine": 49
      }
    },
    {
      "id": "in_projection",
      "label": "in_projection",
      "op": "Linear",
      "kind": "layer",
      "parent": null,
      "params": {
        "in_features": 4,
        "out_features": 16,
        "bias": false
      },
      "source": {
        "line": 50,
        "endLine": 50
      }
    },
    {
      "id": "python@TinyMamba#0",
      "label": "python@TinyMamba#0",
      "op": "Python",
      "kind": "layer",
      "parent": null,
      "params": {},
      "source": {
        "line": 57,
        "endLine": 57
      }
    },
    {
      "id": "silu@TinyMamba#1",
      "label": "silu@TinyMamba#1",
      "op": "SiLU",
      "kind": "layer",
      "parent": null,
      "params": {},
      "source": {
        "line": 61,
        "endLine": 61
      }
    },
    {
      "id": "local_conv",
      "label": "local_conv",
      "op": "Conv1d",
      "kind": "layer",
      "parent": null,
      "params": {
        "in_channels": 8,
        "out_channels": 8,
        "kernel_size": 3,
        "groups": 8
      },
      "source": {
        "line": 51,
        "endLine": 51
      }
    },
    {
      "id": "silu@TinyMamba#0",
      "label": "silu@TinyMamba#0",
      "op": "SiLU",
      "kind": "layer",
      "parent": null,
      "params": {},
      "source": {
        "line": 58,
        "endLine": 58
      }
    },
    {
      "id": "selection",
      "label": "selection",
      "op": "Module",
      "kind": "module",
      "parent": null,
      "params": {},
      "source": {
        "line": 52,
        "endLine": 52
      }
    },
    {
      "id": "scan",
      "label": "scan",
      "op": "Module",
      "kind": "module",
      "parent": null,
      "params": {},
      "source": {
        "line": 53,
        "endLine": 53
      }
    },
    {
      "id": "mul@TinyMamba#0",
      "label": "mul@TinyMamba#0",
      "op": "torch.mul",
      "kind": "layer",
      "parent": null,
      "params": {},
      "source": {
        "line": 61,
        "endLine": 61
      }
    },
    {
      "id": "project",
      "label": "project",
      "op": "Linear",
      "kind": "layer",
      "parent": null,
      "params": {
        "in_features": 8,
        "out_features": 4,
        "bias": false
      },
      "source": {
        "line": 54,
        "endLine": 54
      }
    },
    {
      "id": "add@TinyMamba#0",
      "label": "add@TinyMamba#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": null,
      "params": {},
      "source": {
        "line": 61,
        "endLine": 61
      }
    },
    {
      "id": "output",
      "label": "output",
      "op": "Output",
      "kind": "output",
      "parent": null,
      "params": {}
    },
    {
      "id": "selection.delta_rank",
      "label": "selection.delta_rank",
      "op": "Linear",
      "kind": "layer",
      "parent": "selection",
      "params": {
        "in_features": 8,
        "out_features": 1,
        "bias": false
      },
      "source": {
        "line": 15,
        "endLine": 15
      }
    },
    {
      "id": "selection.delta",
      "label": "selection.delta",
      "op": "Linear",
      "kind": "layer",
      "parent": "selection",
      "params": {
        "in_features": 1,
        "out_features": 8
      },
      "source": {
        "line": 16,
        "endLine": 16
      }
    },
    {
      "id": "softplus@selection#0",
      "label": "softplus@selection#0",
      "op": "Softplus",
      "kind": "layer",
      "parent": "selection",
      "params": {},
      "source": {
        "line": 21,
        "endLine": 21
      }
    },
    {
      "id": "selection.input_map",
      "label": "selection.input_map",
      "op": "Linear",
      "kind": "layer",
      "parent": "selection",
      "params": {
        "in_features": 8,
        "out_features": 3,
        "bias": false
      },
      "source": {
        "line": 17,
        "endLine": 17
      }
    },
    {
      "id": "selection.readout",
      "label": "selection.readout",
      "op": "Linear",
      "kind": "layer",
      "parent": "selection",
      "params": {
        "in_features": 8,
        "out_features": 3,
        "bias": false
      },
      "source": {
        "line": 18,
        "endLine": 18
      }
    },
    {
      "id": "python@scan#0",
      "label": "python@scan#0",
      "op": "Python",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 35,
        "endLine": 35
      }
    },
    {
      "id": "scan.A_log",
      "label": "scan.A_log",
      "op": "Parameter",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 28,
        "endLine": 30
      }
    },
    {
      "id": "mul@scan#1",
      "label": "mul@scan#1",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 40,
        "endLine": 40
      }
    },
    {
      "id": "div@scan#0",
      "label": "div@scan#0",
      "op": "torch.div",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 40,
        "endLine": 40
      }
    },
    {
      "id": "mul@scan#2",
      "label": "mul@scan#2",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 40,
        "endLine": 40
      }
    },
    {
      "id": "mul@scan#3",
      "label": "mul@scan#3",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 40,
        "endLine": 40
      }
    },
    {
      "id": "mul@scan#0",
      "label": "mul@scan#0",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 39,
        "endLine": 39
      }
    },
    {
      "id": "python@scan#1",
      "label": "python@scan#1",
      "op": "Python",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 39,
        "endLine": 39
      }
    },
    {
      "id": "mul@scan#4",
      "label": "mul@scan#4",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 41,
        "endLine": 41
      }
    },
    {
      "id": "add@scan#0",
      "label": "add@scan#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 41,
        "endLine": 41
      }
    },
    {
      "id": "mul@scan#5",
      "label": "mul@scan#5",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 42,
        "endLine": 42
      }
    },
    {
      "id": "scan.direct",
      "label": "scan.direct",
      "op": "Parameter",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 31,
        "endLine": 31
      }
    },
    {
      "id": "mul@scan#6",
      "label": "mul@scan#6",
      "op": "torch.mul",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 42,
        "endLine": 42
      }
    },
    {
      "id": "add@scan#1",
      "label": "add@scan#1",
      "op": "torch.add",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 42,
        "endLine": 42
      }
    },
    {
      "id": "python@scan#2",
      "label": "python@scan#2",
      "op": "Python",
      "kind": "layer",
      "parent": "scan",
      "params": {},
      "source": {
        "line": 42,
        "endLine": 42
      }
    }
  ],
  "connections": [
    {
      "id": "edge-1",
      "source": "selection.delta_rank",
      "target": "selection.delta",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-2",
      "source": "selection.delta",
      "target": "softplus@selection#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-3",
      "source": "scan.A_log",
      "target": "mul@scan#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-4",
      "source": "mul@scan#0",
      "target": "python@scan#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-5",
      "source": "scan.A_log",
      "target": "mul@scan#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-6",
      "source": "mul@scan#1",
      "target": "div@scan#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-7",
      "source": "scan.A_log",
      "target": "div@scan#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-8",
      "source": "div@scan#0",
      "target": "mul@scan#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-9",
      "source": "mul@scan#2",
      "target": "mul@scan#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-10",
      "source": "python@scan#1",
      "target": "mul@scan#4",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-11",
      "source": "python@scan#0",
      "target": "mul@scan#4",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-12",
      "source": "mul@scan#4",
      "target": "add@scan#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-13",
      "source": "mul@scan#3",
      "target": "add@scan#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-14",
      "source": "add@scan#0",
      "target": "mul@scan#5",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-15",
      "source": "scan.direct",
      "target": "mul@scan#6",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-16",
      "source": "mul@scan#5",
      "target": "add@scan#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-17",
      "source": "mul@scan#6",
      "target": "add@scan#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-18",
      "source": "add@scan#1",
      "target": "python@scan#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-19",
      "source": "input",
      "target": "norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-20",
      "source": "norm",
      "target": "in_projection",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-21",
      "source": "in_projection",
      "target": "python@TinyMamba#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-22",
      "source": "python@TinyMamba#0",
      "target": "local_conv",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-23",
      "source": "local_conv",
      "target": "silu@TinyMamba#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-24",
      "source": "silu@TinyMamba#0",
      "target": "selection.delta_rank",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-25",
      "source": "silu@TinyMamba#0",
      "target": "selection.input_map",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-26",
      "source": "silu@TinyMamba#0",
      "target": "selection.readout",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-27",
      "source": "silu@TinyMamba#0",
      "target": "selection",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-28",
      "source": "silu@TinyMamba#0",
      "target": "python@scan#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-29",
      "source": "silu@TinyMamba#0",
      "target": "mul@scan#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-30",
      "source": "silu@TinyMamba#0",
      "target": "mul@scan#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-31",
      "source": "silu@TinyMamba#0",
      "target": "mul@scan#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-32",
      "source": "silu@TinyMamba#0",
      "target": "mul@scan#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-33",
      "source": "silu@TinyMamba#0",
      "target": "mul@scan#5",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-34",
      "source": "silu@TinyMamba#0",
      "target": "mul@scan#6",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-35",
      "source": "silu@TinyMamba#0",
      "target": "scan",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-36",
      "source": "softplus@selection#0",
      "target": "python@scan#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-37",
      "source": "softplus@selection#0",
      "target": "mul@scan#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-38",
      "source": "softplus@selection#0",
      "target": "mul@scan#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-39",
      "source": "softplus@selection#0",
      "target": "mul@scan#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-40",
      "source": "softplus@selection#0",
      "target": "mul@scan#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-41",
      "source": "softplus@selection#0",
      "target": "mul@scan#5",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-42",
      "source": "softplus@selection#0",
      "target": "mul@scan#6",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-43",
      "source": "selection.input_map",
      "target": "python@scan#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-44",
      "source": "selection.input_map",
      "target": "mul@scan#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-45",
      "source": "selection.input_map",
      "target": "mul@scan#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-46",
      "source": "selection.input_map",
      "target": "mul@scan#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-47",
      "source": "selection.input_map",
      "target": "mul@scan#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-48",
      "source": "selection.input_map",
      "target": "mul@scan#5",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-49",
      "source": "selection.input_map",
      "target": "mul@scan#6",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-50",
      "source": "selection.readout",
      "target": "python@scan#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-51",
      "source": "selection.readout",
      "target": "mul@scan#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-52",
      "source": "selection.readout",
      "target": "mul@scan#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-53",
      "source": "selection.readout",
      "target": "mul@scan#2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-54",
      "source": "selection.readout",
      "target": "mul@scan#3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-55",
      "source": "selection.readout",
      "target": "mul@scan#5",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-56",
      "source": "selection.readout",
      "target": "mul@scan#6",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-57",
      "source": "selection",
      "target": "scan",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-58",
      "source": "python@TinyMamba#0",
      "target": "silu@TinyMamba#1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-59",
      "source": "python@scan#2",
      "target": "mul@TinyMamba#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-60",
      "source": "scan",
      "target": "mul@TinyMamba#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-61",
      "source": "silu@TinyMamba#1",
      "target": "mul@TinyMamba#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-62",
      "source": "mul@TinyMamba#0",
      "target": "project",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-63",
      "source": "input",
      "target": "add@TinyMamba#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-64",
      "source": "project",
      "target": "add@TinyMamba#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-65",
      "source": "add@TinyMamba#0",
      "target": "output",
      "sourcePort": null,
      "targetPort": null
    }
  ],
  "steps": [
    {
      "id": "local",
      "target": "local_conv",
      "title": "Gather local context before the scan",
      "note": "The normalized input expands into eight content and eight gate features. A left-padded depthwise convolution reads only the current and two earlier content projections; SiLU supplies the scan input."
    },
    {
      "id": "select",
      "target": "selection.delta",
      "title": "Choose dynamics from the current input",
      "note": "Softplus makes delta positive. Separate learned maps produce B, which controls writes, and C, which controls readout. Unlike a time-invariant SSM, these quantities change across tokens."
    },
    {
      "id": "state",
      "target": "scan",
      "title": "Decay the old state and add the current write",
      "note": "For each channel, hₜ = Āₜ hₜ₋₁ + B̄ₜ uₜ. Negative diagonal A and positive delta produce decay factors between zero and one. The recorded panel exposes three state coordinates and checks an independent sum of decayed writes."
    },
    {
      "id": "read",
      "target": "project",
      "title": "Read, gate and project the state output",
      "note": "C reads the updated state, with a learned direct input path D. A separate SiLU gate modulates the result before projection and residual addition. Streaming retains 24 SSM values and 16 convolution-history values per sequence for this configuration."
    }
  ],
  "milestone": {
    "name": "Mamba selective state-space models",
    "year": 2023,
    "kind": "Architecture",
    "fidelity": "Width four, expansion eight, three state coordinates per channel, causal depthwise convolution width three. LayerNorm wrapper, SiLU gate and residual projection. Exact diagonal zero-order-hold discretization follows the paper’s Eq. 4.",
    "papers": [
      {
        "title": "Mamba: Linear-Time Sequence Modeling with Selective State Spaces",
        "url": "https://arxiv.org/abs/2312.00752"
      }
    ]
  },
  "experiment": {
    "kind": "matrices",
    "title": "Read, write and retain a recurrent state.",
    "description": "Recorded selective-state evolution in a tiny Mamba-style block. Streaming state size is fixed for this architecture; these counts do not include weights or training activations.",
    "controlLabel": "Scan checkpoint",
    "cases": [
      {
        "id": "first",
        "label": "After token 0",
        "target": "scan",
        "note": "The recurrence has processed tokens 0 through 0. This table shows channel 0’s three state coordinates; the complete state holds eight channels. Delta, B and C come from the current convolved token. Exact diagonal ZOH gives Ā = exp(ΔA) and B̄ = (exp(ΔA)−1)B/A. This is a recorded CPU loop, without the fused parallel scan or measured GPU speed.",
        "matrices": [
          {
            "label": "Channel 0 state history · processed tokens × state coordinates",
            "values": [
              [
                0.0028182393539163413,
                -0.010537066745402683,
                -0.00784164629620153
              ]
            ]
          },
          {
            "label": "Current full state · channels × coordinates",
            "values": [
              [
                0.0028182393539163413,
                -0.010537066745402683,
                -0.00784164629620153
              ],
              [
                -0.001974331621310062,
                0.007900057852871843,
                0.006223652277864977
              ],
              [
                -0.0033953960241741867,
                0.010168460390130212,
                0.0065498798760998955
              ],
              [
                0.003721872691424867,
                -0.012092310160219935,
                -0.008144172107855993
              ],
              [
                0.0011967177169104992,
                -0.003539063139261009,
                -0.0022662157165803864
              ],
              [
                -0.0018275401541951214,
                0.00700819359539097,
                0.005324342664576923
              ],
              [
                0.004021993523870823,
                -0.012970971501410068,
                -0.008696817225194232
              ],
              [
                0.0060052362213579135,
                -0.01826898899847851,
                -0.011859231269932035
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Current input token",
            "values": [
              1.279318052918509,
              0.3919448799126044,
              -0.4732379164518807,
              -1.0147876304600973
            ]
          },
          {
            "label": "Current delta · eight channels",
            "values": [
              0.4986526694645875,
              0.32822965324848863,
              1.2466799193608706,
              0.9244711888662873,
              1.3043497535885482,
              0.4329857006315755,
              0.9507933081053215,
              1.178194955355712
            ]
          },
          {
            "label": "Channel 0 decay factors",
            "values": [
              0.6073484077558778,
              0.36887208770291946,
              0.2240338689102113
            ]
          },
          {
            "label": "Channel 0 write contribution",
            "values": [
              0.0028182393539163413,
              -0.010537066745402683,
              -0.00784164629620153
            ]
          }
        ],
        "metrics": [
          {
            "label": "SSM state values per sequence",
            "value": 24
          },
          {
            "label": "Convolution history values per sequence",
            "value": 16
          }
        ]
      },
      {
        "id": "middle",
        "label": "After token 2",
        "target": "scan",
        "note": "The recurrence has processed tokens 0 through 2. This table shows channel 0’s three state coordinates; the complete state holds eight channels. Delta, B and C come from the current convolved token. Exact diagonal ZOH gives Ā = exp(ΔA) and B̄ = (exp(ΔA)−1)B/A. This is a recorded CPU loop, without the fused parallel scan or measured GPU speed.",
        "matrices": [
          {
            "label": "Channel 0 state history · processed tokens × state coordinates",
            "values": [
              [
                0.0028182393539163413,
                -0.010537066745402683,
                -0.00784164629620153
              ],
              [
                0.004873730432046338,
                -0.00915477022339425,
                -0.011602296275764815
              ],
              [
                -0.00301501689061632,
                -0.011337814206202949,
                -0.007509822729152433
              ]
            ]
          },
          {
            "label": "Current full state · channels × coordinates",
            "values": [
              [
                -0.00301501689061632,
                -0.011337814206202949,
                -0.007509822729152433
              ],
              [
                0.003005532147151552,
                0.011276051766255546,
                0.008067929216438398
              ],
              [
                0.022029101377326124,
                0.023094450415887195,
                0.012078495254168814
              ],
              [
                -0.005869870581283822,
                -0.00875681688257194,
                -0.004725311273251915
              ],
              [
                0.004764477223689162,
                0.00470157055015142,
                0.002465278544910123
              ],
              [
                -0.0006842187442956465,
                -0.0006684789412782933,
                -0.0013573633291113104
              ],
              [
                -0.005766366861376273,
                -0.01015187481480913,
                -0.005501725106148151
              ],
              [
                0.004039405117769291,
                0.0006290388110263834,
                0.0004366245153112298
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Current input token",
            "values": [
              0.5777008018447466,
              0.21219867531604147,
              -1.3373748058478179,
              0.5705738667927814
            ]
          },
          {
            "label": "Current delta · eight channels",
            "values": [
              0.4846955167975028,
              0.3300814347688844,
              1.2746148110636655,
              0.9269083368444032,
              1.320065552066713,
              0.41988940541893655,
              0.962065418401713,
              1.173750458589704
            ]
          },
          {
            "label": "Channel 0 decay factors",
            "values": [
              0.6158846947620713,
              0.3793139565418216,
              0.23361365403755702
            ]
          },
          {
            "label": "Channel 0 write contribution",
            "values": [
              -0.0060166728701097965,
              -0.00786528209153602,
              -0.004799367900944675
            ]
          }
        ],
        "metrics": [
          {
            "label": "SSM state values per sequence",
            "value": 24
          },
          {
            "label": "Convolution history values per sequence",
            "value": 16
          }
        ]
      },
      {
        "id": "last",
        "label": "After token 5",
        "target": "scan",
        "note": "The recurrence has processed tokens 0 through 5. This table shows channel 0’s three state coordinates; the complete state holds eight channels. Delta, B and C come from the current convolved token. Exact diagonal ZOH gives Ā = exp(ΔA) and B̄ = (exp(ΔA)−1)B/A. This is a recorded CPU loop, without the fused parallel scan or measured GPU speed.",
        "matrices": [
          {
            "label": "Channel 0 state history · processed tokens × state coordinates",
            "values": [
              [
                0.0028182393539163413,
                -0.010537066745402683,
                -0.00784164629620153
              ],
              [
                0.004873730432046338,
                -0.00915477022339425,
                -0.011602296275764815
              ],
              [
                -0.00301501689061632,
                -0.011337814206202949,
                -0.007509822729152433
              ],
              [
                0.005944862092737309,
                -0.007949776349270878,
                -0.00841232704428652
              ],
              [
                -0.016519918501915934,
                -0.015057961779256647,
                -0.006250632512568108
              ],
              [
                -0.0014739041684932782,
                -0.010938218661359047,
                -0.00941267502904927
              ]
            ]
          },
          {
            "label": "Current full state · channels × coordinates",
            "values": [
              [
                -0.0014739041684932782,
                -0.010938218661359047,
                -0.00941267502904927
              ],
              [
                0.011032862348978049,
                0.01570235913659085,
                0.0099463640652495
              ],
              [
                0.06748817815191788,
                -0.00014557736189026171,
                -0.008582505265828355
              ],
              [
                0.003329572593620605,
                -0.00771579937630755,
                -0.007828871303332336
              ],
              [
                -0.008806888227436123,
                0.0013501825545097165,
                0.002493074789237922
              ],
              [
                -0.01901798503340152,
                -0.002914908392832273,
                0.0027143148163792426
              ],
              [
                0.002925803446264884,
                -0.008932811578534396,
                -0.009116039782672449
              ],
              [
                -0.0025505728680483807,
                -0.004806505645996672,
                -0.00424639459714048
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Current input token",
            "values": [
              0.5449482063234682,
              -0.8704264341806643,
              -1.6371821259053128,
              -0.8944304271023046
            ]
          },
          {
            "label": "Current delta · eight channels",
            "values": [
              0.49630550766785203,
              0.3285376263807963,
              1.2513135556328443,
              0.9248770483142744,
              1.3069623336906422,
              0.4307808885160657,
              0.9526662016947541,
              1.1774537056310086
            ]
          },
          {
            "label": "Channel 0 decay factors",
            "values": [
              0.6087756270379251,
              0.37060776337475504,
              0.22561696729737396
            ]
          },
          {
            "label": "Channel 0 write contribution",
            "values": [
              0.008583019576126014,
              -0.005357621125366193,
              -0.008002426277873289
            ]
          }
        ],
        "metrics": [
          {
            "label": "SSM state values per sequence",
            "value": 24
          },
          {
            "label": "Convolution history values per sequence",
            "value": 16
          }
        ]
      },
      {
        "id": "changed",
        "label": "Change token 2 · inspect final state",
        "target": "scan",
        "note": "The recurrence has processed tokens 0 through 5. This table shows channel 0’s three state coordinates; the complete state holds eight channels. Delta, B and C come from the current convolved token. Exact diagonal ZOH gives Ā = exp(ΔA) and B̄ = (exp(ΔA)−1)B/A. Token 2 changes while later input tokens stay fixed, exposing the carried influence.",
        "matrices": [
          {
            "label": "Channel 0 state history · processed tokens × state coordinates",
            "values": [
              [
                0.0028182393539163413,
                -0.010537066745402683,
                -0.00784164629620153
              ],
              [
                0.004873730432046338,
                -0.00915477022339425,
                -0.011602296275764815
              ],
              [
                0.002419779259561077,
                -0.007288898486076463,
                -0.008684161994826325
              ],
              [
                0.005357236460870546,
                -0.003596952164928283,
                -0.004791638452126722
              ],
              [
                -0.0030519778228330586,
                -0.0024358237512675804,
                -0.003421168541419978
              ],
              [
                0.006725049863324978,
                -0.006260356317798576,
                -0.008774299948801644
              ]
            ]
          },
          {
            "label": "Current full state · channels × coordinates",
            "values": [
              [
                0.006725049863324978,
                -0.006260356317798576,
                -0.008774299948801644
              ],
              [
                -0.001637283673453878,
                0.006202850393147521,
                0.00881001888492659
              ],
              [
                0.02737356090496436,
                -0.0066264716105599725,
                -0.008937327247150332
              ],
              [
                0.006934883425434804,
                -0.005985693619377941,
                -0.007818502487516489
              ],
              [
                -0.0008313593690156625,
                0.0021489410396817424,
                0.002624309278935409
              ],
              [
                -0.011227752032423282,
                0.0018818449014911271,
                0.002967652030177038
              ],
              [
                0.00881738883011581,
                -0.006905748428889309,
                -0.009042872526338806
              ],
              [
                0.0017029212102252318,
                -0.0034001394408378384,
                -0.0042281965143753115
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Current input token",
            "values": [
              0.5449482063234682,
              -0.8704264341806643,
              -1.6371821259053128,
              -0.8944304271023046
            ]
          },
          {
            "label": "Current delta · eight channels",
            "values": [
              0.49630550766785203,
              0.3285376263807963,
              1.2513135556328443,
              0.9248770483142744,
              1.3069623336906422,
              0.4307808885160657,
              0.9526662016947541,
              1.1774537056310086
            ]
          },
          {
            "label": "Channel 0 decay factors",
            "values": [
              0.6087756270379251,
              0.37060776337475504,
              0.22561696729737396
            ]
          },
          {
            "label": "Channel 0 write contribution",
            "values": [
              0.008583019576126014,
              -0.005357621125366193,
              -0.008002426277873289
            ]
          }
        ],
        "metrics": [
          {
            "label": "SSM state values per sequence",
            "value": 24
          },
          {
            "label": "Convolution history values per sequence",
            "value": 16
          }
        ]
      }
    ]
  },
  "revision": "dae2c22380683e3d",
  "files": {
    "graph.tensorviz.json": {
      "url": "/models/mamba/dae2c22380683e3d/graph.tensorviz.json",
      "sha256": "4f73d4f43ed007bf8f5ba444479cd36190a94ca18bfeaef2af371aad4074d1f2",
      "bytes": 88342
    },
    "model.py": {
      "url": "/models/mamba/dae2c22380683e3d/model.py",
      "sha256": "cc6ddffd335c7c6f37f908ea898b9826b5e199f49ca0fcc76d494fca0734bd85",
      "bytes": 9130
    },
    "run.py": {
      "url": "/models/mamba/dae2c22380683e3d/run.py",
      "sha256": "c0d24cbd371558c7d0c72d2020f29396773c582b98f479d7c416e03a7ee82442",
      "bytes": 642
    },
    "requirements.txt": {
      "url": "/models/mamba/dae2c22380683e3d/requirements.txt",
      "sha256": "edb86016b42cb3cc6cdc0c490aab929d3bb098ced4515394f0b55766033e0daf",
      "bytes": 91
    },
    "preview.svg": {
      "url": "/models/mamba/dae2c22380683e3d/preview.svg",
      "sha256": "3b74e844d510bc6dd2dde9e0d26e7bdc65b88ffae0d68245b3c2af19984e8eea",
      "bytes": 2082
    }
  }
}
