{
  "format": "tensorviz.graph",
  "version": 3,
  "exportedAt": "2026-09-17T05:43:00.236026+00:00",
  "status": "static",
  "warningCount": 0,
  "document": {
    "schemaVersion": 2,
    "semantic": {
      "graph_id": "snapshot",
      "name": "TinyDecoder",
      "revision": 0,
      "nodes": [
        {
          "node_id": "input",
          "kind": "input",
          "op": "Input",
          "params": {
            "shape": "1,6"
          },
          "in_ports": [],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "input",
              "name": "Input",
              "displayName": "Input",
              "description": "Model input node",
              "icon": "ArrowRight",
              "category": "io",
              "parameters": [
                {
                  "name": "shape",
                  "type": "string",
                  "defaultValue": "1,3,224,224",
                  "required": true,
                  "description": "Input tensor shape (comma-separated, e.g., 1,3,224,224)"
                },
                {
                  "name": "name",
                  "type": "string",
                  "defaultValue": "input",
                  "required": false,
                  "description": "Name for this input"
                }
              ]
            }
          }
        },
        {
          "node_id": "embedding",
          "kind": "layer",
          "op": "Embedding",
          "params": {
            "num_embeddings": 32,
            "embedding_dim": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "embedding",
              "name": "Embedding",
              "displayName": "Embedding",
              "description": "Lookup table for dense vector embeddings",
              "icon": "Hash",
              "category": "embedding",
              "parameters": [
                {
                  "name": "num_embeddings",
                  "type": "number",
                  "defaultValue": 10000,
                  "required": true,
                  "description": "Size of the dictionary of embeddings",
                  "min": 1
                },
                {
                  "name": "embedding_dim",
                  "type": "number",
                  "defaultValue": 128,
                  "required": true,
                  "description": "Size of each embedding vector",
                  "min": 1
                },
                {
                  "name": "padding_idx",
                  "type": "number",
                  "defaultValue": 0,
                  "required": false,
                  "description": "Pad output with zeros at this index",
                  "min": 0
                },
                {
                  "name": "max_norm",
                  "type": "number",
                  "defaultValue": 0,
                  "required": false,
                  "description": "If > 0, re-normalizes embeddings with norm > max_norm",
                  "min": 0
                },
                {
                  "name": "sparse",
                  "type": "boolean",
                  "defaultValue": false,
                  "required": false,
                  "description": "If True, gradient w.r.t. weight is sparse"
                }
              ]
            }
          }
        },
        {
          "node_id": "positions",
          "kind": "module",
          "op": "Module",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "module",
              "name": "Module",
              "displayName": "Module",
              "description": "Custom module group (nn.Module)",
              "icon": "Package",
              "category": "module",
              "parameters": [
                {
                  "name": "name",
                  "type": "string",
                  "defaultValue": "CustomModule",
                  "required": true,
                  "description": "Module class name"
                },
                {
                  "name": "description",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Module description"
                }
              ]
            },
            "moduleInstanceId": "positions",
            "moduleTemplateId": "model::SinusoidalPositions",
            "isGroup": true,
            "moduleMembers": [
              "python@positions#1",
              "python@positions#0",
              "mul@positions#0",
              "stack@positions#0",
              "flatten@positions#0",
              "add@positions#0"
            ],
            "moduleLayerCount": 6
          }
        },
        {
          "node_id": "block",
          "kind": "module",
          "op": "Module",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "module",
              "name": "Module",
              "displayName": "Module",
              "description": "Custom module group (nn.Module)",
              "icon": "Package",
              "category": "module",
              "parameters": [
                {
                  "name": "name",
                  "type": "string",
                  "defaultValue": "CustomModule",
                  "required": true,
                  "description": "Module class name"
                },
                {
                  "name": "description",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Module description"
                }
              ]
            },
            "moduleInstanceId": "block",
            "moduleTemplateId": "model::DecoderBlock",
            "isGroup": true,
            "moduleMembers": [
              "block.attention",
              "add@block#0",
              "block.norm_attention",
              "block.ffn",
              "add@block#1",
              "block.norm_ffn"
            ],
            "moduleLayerCount": 18
          }
        },
        {
          "node_id": "vocabulary",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 16,
            "out_features": 32
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            }
          }
        },
        {
          "node_id": "probabilities",
          "kind": "layer",
          "op": "Softmax",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "softmax",
              "name": "Softmax",
              "displayName": "Softmax",
              "description": "Softmax over a dimension",
              "icon": "TrendingUp",
              "category": "activation",
              "parameters": [
                {
                  "name": "dim",
                  "type": "number",
                  "defaultValue": 1,
                  "required": true,
                  "description": "Dimension along which Softmax is computed"
                }
              ]
            }
          }
        },
        {
          "node_id": "output",
          "kind": "output",
          "op": "Output",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [],
          "metadata": {
            "layerType": {
              "id": "output",
              "name": "Output",
              "displayName": "Output",
              "description": "Model output node",
              "icon": "ArrowLeft",
              "category": "io",
              "parameters": [
                {
                  "name": "name",
                  "type": "string",
                  "defaultValue": "output",
                  "required": false,
                  "description": "Name for this output"
                }
              ]
            }
          }
        },
        {
          "node_id": "python@positions#1",
          "kind": "layer",
          "op": "Python",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "python",
              "name": "Python",
              "displayName": "Python",
              "description": "A statement from the source file that has no graph equivalent. Its code is kept verbatim and its shape is unknown until the model is traced.",
              "icon": "Hash",
              "category": "misc",
              "parameters": []
            },
            "parentId": "positions"
          }
        },
        {
          "node_id": "python@positions#0",
          "kind": "layer",
          "op": "Python",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "python",
              "name": "Python",
              "displayName": "Python",
              "description": "A statement from the source file that has no graph equivalent. Its code is kept verbatim and its shape is unknown until the model is traced.",
              "icon": "Hash",
              "category": "misc",
              "parameters": []
            },
            "parentId": "positions"
          }
        },
        {
          "node_id": "mul@positions#0",
          "kind": "layer",
          "op": "torch.mul",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "mul",
              "name": "torch.mul",
              "displayName": "torch.mul",
              "description": "PyTorch mul operation",
              "icon": "Activity",
              "category": "tensor",
              "parameters": [
                {
                  "name": "dim",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Dimension(s) to apply the operation on"
                }
              ]
            },
            "parentId": "positions"
          }
        },
        {
          "node_id": "stack@positions#0",
          "kind": "layer",
          "op": "torch.stack",
          "params": {
            "dim": -1
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "stack",
              "name": "torch.stack",
              "displayName": "torch.stack",
              "description": "PyTorch stack operation",
              "icon": "Activity",
              "category": "tensor",
              "parameters": [
                {
                  "name": "dim",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Dimension(s) to apply the operation on"
                }
              ]
            },
            "parentId": "positions"
          }
        },
        {
          "node_id": "flatten@positions#0",
          "kind": "layer",
          "op": "Flatten",
          "params": {
            "start_dim": -2
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "flatten",
              "name": "Flatten",
              "displayName": "Flatten",
              "description": "Flattens input tensor contiguously",
              "icon": "Maximize2",
              "category": "tensor",
              "parameters": [
                {
                  "name": "start_dim",
                  "type": "number",
                  "defaultValue": 1,
                  "required": false,
                  "description": "First dim to flatten",
                  "min": 0
                },
                {
                  "name": "end_dim",
                  "type": "number",
                  "defaultValue": -1,
                  "required": false,
                  "description": "Last dim to flatten"
                }
              ]
            },
            "parentId": "positions"
          }
        },
        {
          "node_id": "add@positions#0",
          "kind": "layer",
          "op": "torch.add",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "add",
              "name": "torch.add",
              "displayName": "torch.add",
              "description": "PyTorch add operation",
              "icon": "Activity",
              "category": "tensor",
              "parameters": [
                {
                  "name": "dim",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Dimension(s) to apply the operation on"
                }
              ]
            },
            "parentId": "positions"
          }
        },
        {
          "node_id": "block.attention",
          "kind": "module",
          "op": "Module",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "module",
              "name": "Module",
              "displayName": "Module",
              "description": "Custom module group (nn.Module)",
              "icon": "Package",
              "category": "module",
              "parameters": [
                {
                  "name": "name",
                  "type": "string",
                  "defaultValue": "CustomModule",
                  "required": true,
                  "description": "Module class name"
                },
                {
                  "name": "description",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Module description"
                }
              ]
            },
            "parentId": "block",
            "moduleInstanceId": "block.attention",
            "moduleTemplateId": "model::CausalAttention",
            "isGroup": true,
            "moduleMembers": [
              "block.attention.query",
              "python@block.attention#0",
              "block.attention.key",
              "python@block.attention#1",
              "block.attention.value",
              "python@block.attention#2",
              "block.attention.scores",
              "block.attention.softmax",
              "python@block.attention#3",
              "block.attention.project"
            ],
            "moduleLayerCount": 11
          }
        },
        {
          "node_id": "add@block#0",
          "kind": "layer",
          "op": "torch.add",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "add",
              "name": "torch.add",
              "displayName": "Attention residual",
              "description": "PyTorch add operation",
              "icon": "Activity",
              "category": "tensor",
              "parameters": [
                {
                  "name": "dim",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Dimension(s) to apply the operation on"
                }
              ]
            },
            "parentId": "block"
          }
        },
        {
          "node_id": "block.norm_attention",
          "kind": "layer",
          "op": "LayerNorm",
          "params": {
            "normalized_shape": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "layernorm",
              "name": "LayerNorm",
              "displayName": "LayerNorm",
              "description": "Layer Normalization",
              "icon": "Layers",
              "category": "norm",
              "parameters": [
                {
                  "name": "normalized_shape",
                  "type": "string",
                  "defaultValue": "512",
                  "required": true,
                  "description": "Input shape for normalization (comma-separated for multi-dim, e.g., 512)"
                },
                {
                  "name": "eps",
                  "type": "number",
                  "defaultValue": 0.00001,
                  "required": false,
                  "description": "Value for numerical stability",
                  "min": 0
                },
                {
                  "name": "elementwise_affine",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If True, learnable affine parameters"
                }
              ]
            },
            "parentId": "block"
          }
        },
        {
          "node_id": "block.ffn",
          "kind": "module",
          "op": "Module",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "module",
              "name": "Module",
              "displayName": "Module",
              "description": "Custom module group (nn.Module)",
              "icon": "Package",
              "category": "module",
              "parameters": [
                {
                  "name": "name",
                  "type": "string",
                  "defaultValue": "CustomModule",
                  "required": true,
                  "description": "Module class name"
                },
                {
                  "name": "description",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Module description"
                }
              ]
            },
            "parentId": "block",
            "moduleInstanceId": "block.ffn",
            "moduleTemplateId": "model::FeedForward",
            "isGroup": true,
            "moduleMembers": [
              "block.ffn.expand",
              "block.ffn.relu",
              "block.ffn.project"
            ],
            "moduleLayerCount": 3
          }
        },
        {
          "node_id": "add@block#1",
          "kind": "layer",
          "op": "torch.add",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "add",
              "name": "torch.add",
              "displayName": "Feed-forward residual",
              "description": "PyTorch add operation",
              "icon": "Activity",
              "category": "tensor",
              "parameters": [
                {
                  "name": "dim",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Dimension(s) to apply the operation on"
                }
              ]
            },
            "parentId": "block"
          }
        },
        {
          "node_id": "block.norm_ffn",
          "kind": "layer",
          "op": "LayerNorm",
          "params": {
            "normalized_shape": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "layernorm",
              "name": "LayerNorm",
              "displayName": "LayerNorm",
              "description": "Layer Normalization",
              "icon": "Layers",
              "category": "norm",
              "parameters": [
                {
                  "name": "normalized_shape",
                  "type": "string",
                  "defaultValue": "512",
                  "required": true,
                  "description": "Input shape for normalization (comma-separated for multi-dim, e.g., 512)"
                },
                {
                  "name": "eps",
                  "type": "number",
                  "defaultValue": 0.00001,
                  "required": false,
                  "description": "Value for numerical stability",
                  "min": 0
                },
                {
                  "name": "elementwise_affine",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If True, learnable affine parameters"
                }
              ]
            },
            "parentId": "block"
          }
        },
        {
          "node_id": "block.attention.query",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 16,
            "out_features": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            },
            "parentId": "block.attention"
          }
        },
        {
          "node_id": "python@block.attention#0",
          "kind": "layer",
          "op": "Python",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "python",
              "name": "Python",
              "displayName": "Split query heads · Python",
              "description": "A statement from the source file that has no graph equivalent. Its code is kept verbatim and its shape is unknown until the model is traced.",
              "icon": "Hash",
              "category": "misc",
              "parameters": []
            },
            "parentId": "block.attention"
          }
        },
        {
          "node_id": "block.attention.key",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 16,
            "out_features": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            },
            "parentId": "block.attention"
          }
        },
        {
          "node_id": "python@block.attention#1",
          "kind": "layer",
          "op": "Python",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "python",
              "name": "Python",
              "displayName": "Split key heads · Python",
              "description": "A statement from the source file that has no graph equivalent. Its code is kept verbatim and its shape is unknown until the model is traced.",
              "icon": "Hash",
              "category": "misc",
              "parameters": []
            },
            "parentId": "block.attention"
          }
        },
        {
          "node_id": "block.attention.value",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 16,
            "out_features": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            },
            "parentId": "block.attention"
          }
        },
        {
          "node_id": "python@block.attention#2",
          "kind": "layer",
          "op": "Python",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "python",
              "name": "Python",
              "displayName": "Split value heads · Python",
              "description": "A statement from the source file that has no graph equivalent. Its code is kept verbatim and its shape is unknown until the model is traced.",
              "icon": "Hash",
              "category": "misc",
              "parameters": []
            },
            "parentId": "block.attention"
          }
        },
        {
          "node_id": "block.attention.scores",
          "kind": "module",
          "op": "Module",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "module",
              "name": "Module",
              "displayName": "Module",
              "description": "Custom module group (nn.Module)",
              "icon": "Package",
              "category": "module",
              "parameters": [
                {
                  "name": "name",
                  "type": "string",
                  "defaultValue": "CustomModule",
                  "required": true,
                  "description": "Module class name"
                },
                {
                  "name": "description",
                  "type": "string",
                  "defaultValue": "",
                  "required": false,
                  "description": "Module description"
                }
              ]
            },
            "parentId": "block.attention",
            "moduleInstanceId": "block.attention.scores",
            "moduleTemplateId": "model::CausalScores",
            "isGroup": true,
            "moduleMembers": [
              "python@block.attention.scores#0",
              "python@block.attention.scores#1"
            ],
            "moduleLayerCount": 2
          }
        },
        {
          "node_id": "block.attention.softmax",
          "kind": "layer",
          "op": "Softmax",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "softmax",
              "name": "Softmax",
              "displayName": "Softmax",
              "description": "Softmax over a dimension",
              "icon": "TrendingUp",
              "category": "activation",
              "parameters": [
                {
                  "name": "dim",
                  "type": "number",
                  "defaultValue": 1,
                  "required": true,
                  "description": "Dimension along which Softmax is computed"
                }
              ]
            },
            "parentId": "block.attention"
          }
        },
        {
          "node_id": "python@block.attention#3",
          "kind": "layer",
          "op": "Python",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "python",
              "name": "Python",
              "displayName": "Mix and join heads · Python",
              "description": "A statement from the source file that has no graph equivalent. Its code is kept verbatim and its shape is unknown until the model is traced.",
              "icon": "Hash",
              "category": "misc",
              "parameters": []
            },
            "parentId": "block.attention"
          }
        },
        {
          "node_id": "block.attention.project",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 16,
            "out_features": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            },
            "parentId": "block.attention"
          }
        },
        {
          "node_id": "python@block.attention.scores#0",
          "kind": "layer",
          "op": "Python",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "python",
              "name": "Python",
              "displayName": "Scale attention scores · Python",
              "description": "A statement from the source file that has no graph equivalent. Its code is kept verbatim and its shape is unknown until the model is traced.",
              "icon": "Hash",
              "category": "misc",
              "parameters": []
            },
            "parentId": "block.attention.scores"
          }
        },
        {
          "node_id": "python@block.attention.scores#1",
          "kind": "layer",
          "op": "Python",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "python",
              "name": "Python",
              "displayName": "Mask future positions · Python",
              "description": "A statement from the source file that has no graph equivalent. Its code is kept verbatim and its shape is unknown until the model is traced.",
              "icon": "Hash",
              "category": "misc",
              "parameters": []
            },
            "parentId": "block.attention.scores"
          }
        },
        {
          "node_id": "block.ffn.expand",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 16,
            "out_features": 64
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            },
            "parentId": "block.ffn"
          }
        },
        {
          "node_id": "block.ffn.relu",
          "kind": "layer",
          "op": "ReLU",
          "params": {},
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "relu",
              "name": "ReLU",
              "displayName": "ReLU",
              "description": "Rectified Linear Unit",
              "icon": "TrendingUp",
              "category": "activation",
              "parameters": [
                {
                  "name": "inplace",
                  "type": "boolean",
                  "defaultValue": false,
                  "required": false,
                  "description": "Can optionally do the operation in-place"
                }
              ]
            },
            "parentId": "block.ffn"
          }
        },
        {
          "node_id": "block.ffn.project",
          "kind": "layer",
          "op": "Linear",
          "params": {
            "in_features": 64,
            "out_features": 16
          },
          "in_ports": [
            "x"
          ],
          "out_ports": [
            "y"
          ],
          "metadata": {
            "layerType": {
              "id": "linear",
              "name": "Linear",
              "displayName": "Linear",
              "description": "Fully Connected Layer",
              "icon": "Minus",
              "category": "linear",
              "parameters": [
                {
                  "name": "in_features",
                  "type": "number",
                  "defaultValue": 512,
                  "required": true,
                  "description": "Size of input features",
                  "min": 1
                },
                {
                  "name": "out_features",
                  "type": "number",
                  "defaultValue": 256,
                  "required": true,
                  "description": "Size of output features",
                  "min": 1
                },
                {
                  "name": "bias",
                  "type": "boolean",
                  "defaultValue": true,
                  "required": false,
                  "description": "If set to False, the layer will not learn an additive bias"
                }
              ]
            },
            "parentId": "block.ffn"
          }
        }
      ],
      "edges": [
        {
          "edge_id": "edge-1",
          "source_node_id": "python@positions#0",
          "target_node_id": "mul@positions#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-2",
          "source_node_id": "python@positions#1",
          "target_node_id": "mul@positions#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-3",
          "source_node_id": "mul@positions#0",
          "target_node_id": "stack@positions#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-4",
          "source_node_id": "stack@positions#0",
          "target_node_id": "flatten@positions#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-5",
          "source_node_id": "flatten@positions#0",
          "target_node_id": "add@positions#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-6",
          "source_node_id": "python@block.attention.scores#0",
          "target_node_id": "python@block.attention.scores#1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-7",
          "source_node_id": "block.attention.query",
          "target_node_id": "python@block.attention#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-8",
          "source_node_id": "block.attention.key",
          "target_node_id": "python@block.attention#1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-9",
          "source_node_id": "block.attention.value",
          "target_node_id": "python@block.attention#2",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-10",
          "source_node_id": "python@block.attention#0",
          "target_node_id": "python@block.attention.scores#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-11",
          "source_node_id": "python@block.attention#0",
          "target_node_id": "python@block.attention.scores#1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-12",
          "source_node_id": "python@block.attention#0",
          "target_node_id": "block.attention.scores",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-13",
          "source_node_id": "python@block.attention#1",
          "target_node_id": "python@block.attention.scores#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-14",
          "source_node_id": "python@block.attention#1",
          "target_node_id": "python@block.attention.scores#1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-15",
          "source_node_id": "python@block.attention#1",
          "target_node_id": "block.attention.scores",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-16",
          "source_node_id": "python@block.attention.scores#1",
          "target_node_id": "block.attention.softmax",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-17",
          "source_node_id": "block.attention.scores",
          "target_node_id": "block.attention.softmax",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-18",
          "source_node_id": "block.attention.softmax",
          "target_node_id": "python@block.attention#3",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-19",
          "source_node_id": "python@block.attention#2",
          "target_node_id": "python@block.attention#3",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-20",
          "source_node_id": "python@block.attention#3",
          "target_node_id": "block.attention.project",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-21",
          "source_node_id": "block.ffn.expand",
          "target_node_id": "block.ffn.relu",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-22",
          "source_node_id": "block.ffn.relu",
          "target_node_id": "block.ffn.project",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-23",
          "source_node_id": "block.attention.project",
          "target_node_id": "add@block#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-24",
          "source_node_id": "block.attention",
          "target_node_id": "add@block#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-25",
          "source_node_id": "add@block#0",
          "target_node_id": "block.norm_attention",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-26",
          "source_node_id": "block.norm_attention",
          "target_node_id": "block.ffn.expand",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-27",
          "source_node_id": "block.norm_attention",
          "target_node_id": "block.ffn",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-28",
          "source_node_id": "block.norm_attention",
          "target_node_id": "add@block#1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-29",
          "source_node_id": "block.ffn.project",
          "target_node_id": "add@block#1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-30",
          "source_node_id": "block.ffn",
          "target_node_id": "add@block#1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-31",
          "source_node_id": "add@block#1",
          "target_node_id": "block.norm_ffn",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-32",
          "source_node_id": "input",
          "target_node_id": "embedding",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-33",
          "source_node_id": "embedding",
          "target_node_id": "python@positions#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-34",
          "source_node_id": "embedding",
          "target_node_id": "python@positions#1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-35",
          "source_node_id": "embedding",
          "target_node_id": "add@positions#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-36",
          "source_node_id": "embedding",
          "target_node_id": "positions",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-37",
          "source_node_id": "add@positions#0",
          "target_node_id": "block.attention.query",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-38",
          "source_node_id": "add@positions#0",
          "target_node_id": "python@block.attention#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-39",
          "source_node_id": "add@positions#0",
          "target_node_id": "block.attention.key",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-40",
          "source_node_id": "add@positions#0",
          "target_node_id": "python@block.attention#1",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-41",
          "source_node_id": "add@positions#0",
          "target_node_id": "block.attention.value",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-42",
          "source_node_id": "add@positions#0",
          "target_node_id": "python@block.attention#2",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-43",
          "source_node_id": "add@positions#0",
          "target_node_id": "python@block.attention#3",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-44",
          "source_node_id": "add@positions#0",
          "target_node_id": "add@block#0",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-45",
          "source_node_id": "positions",
          "target_node_id": "block",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-46",
          "source_node_id": "block.norm_ffn",
          "target_node_id": "vocabulary",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-47",
          "source_node_id": "block",
          "target_node_id": "vocabulary",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-48",
          "source_node_id": "vocabulary",
          "target_node_id": "probabilities",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        },
        {
          "edge_id": "edge-49",
          "source_node_id": "probabilities",
          "target_node_id": "output",
          "source_port": "y",
          "target_port": "x",
          "metadata": {}
        }
      ],
      "inputs": [],
      "modules": [],
      "operations": [],
      "metadata": {}
    },
    "view": {
      "graph_id": "snapshot",
      "node_positions": {
        "input": {
          "x": 0,
          "y": 160
        },
        "embedding": {
          "x": 340,
          "y": 160
        },
        "positions": {
          "x": 680,
          "y": 160
        },
        "block": {
          "x": 1020,
          "y": 160
        },
        "vocabulary": {
          "x": 1360,
          "y": 160
        },
        "probabilities": {
          "x": 1700,
          "y": 160
        },
        "output": {
          "x": 2040,
          "y": 160
        },
        "python@positions#1": {
          "x": 24,
          "y": 214
        },
        "python@positions#0": {
          "x": 24,
          "y": 364
        },
        "mul@positions#0": {
          "x": 24,
          "y": 514
        },
        "stack@positions#0": {
          "x": 24,
          "y": 664
        },
        "flatten@positions#0": {
          "x": 24,
          "y": 814
        },
        "add@positions#0": {
          "x": 24,
          "y": 964
        },
        "block.attention": {
          "x": 24,
          "y": 214
        },
        "add@block#0": {
          "x": 24,
          "y": 364
        },
        "block.norm_attention": {
          "x": 24,
          "y": 514
        },
        "block.ffn": {
          "x": 24,
          "y": 664
        },
        "add@block#1": {
          "x": 24,
          "y": 814
        },
        "block.norm_ffn": {
          "x": 24,
          "y": 964
        },
        "block.attention.query": {
          "x": 24,
          "y": 214
        },
        "python@block.attention#0": {
          "x": 24,
          "y": 364
        },
        "block.attention.key": {
          "x": 24,
          "y": 514
        },
        "python@block.attention#1": {
          "x": 24,
          "y": 664
        },
        "block.attention.value": {
          "x": 24,
          "y": 814
        },
        "python@block.attention#2": {
          "x": 24,
          "y": 964
        },
        "block.attention.scores": {
          "x": 24,
          "y": 1114
        },
        "block.attention.softmax": {
          "x": 24,
          "y": 1264
        },
        "python@block.attention#3": {
          "x": 24,
          "y": 1414
        },
        "block.attention.project": {
          "x": 24,
          "y": 1564
        },
        "python@block.attention.scores#0": {
          "x": 24,
          "y": 214
        },
        "python@block.attention.scores#1": {
          "x": 24,
          "y": 364
        },
        "block.ffn.expand": {
          "x": 24,
          "y": 214
        },
        "block.ffn.relu": {
          "x": 24,
          "y": 364
        },
        "block.ffn.project": {
          "x": 24,
          "y": 514
        }
      },
      "collapsed_modules": [
        "positions",
        "block",
        "block.attention",
        "block.ffn",
        "block.attention.scores"
      ],
      "selection": [],
      "layout": {}
    }
  },
  "snapshotId": "snapshot-d177c5aa44d90c8",
  "collaboration": {
    "walkthrough": {
      "title": "One token at a time",
      "steps": [
        {
          "id": "tokens",
          "title": "Turn IDs into features",
          "note": "Each integer token ID indexes one of 32 learned vectors with 16 features. The positions block scales embeddings by √16 and adds sinusoidal position information.",
          "view": {
            "camera": {
              "x": -7.5,
              "y": 60,
              "z": 1.25
            },
            "nodePositions": {
              "input": {
                "x": 0,
                "y": 160
              },
              "embedding": {
                "x": 340,
                "y": 160
              },
              "positions": {
                "x": 680,
                "y": 160
              },
              "block": {
                "x": 1020,
                "y": 160
              },
              "vocabulary": {
                "x": 1360,
                "y": 160
              },
              "probabilities": {
                "x": 1700,
                "y": 160
              },
              "output": {
                "x": 2040,
                "y": 160
              },
              "python@positions#1": {
                "x": 24,
                "y": 214
              },
              "python@positions#0": {
                "x": 24,
                "y": 364
              },
              "mul@positions#0": {
                "x": 24,
                "y": 514
              },
              "stack@positions#0": {
                "x": 24,
                "y": 664
              },
              "flatten@positions#0": {
                "x": 24,
                "y": 814
              },
              "add@positions#0": {
                "x": 24,
                "y": 964
              },
              "block.attention": {
                "x": 24,
                "y": 214
              },
              "add@block#0": {
                "x": 24,
                "y": 364
              },
              "block.norm_attention": {
                "x": 24,
                "y": 514
              },
              "block.ffn": {
                "x": 24,
                "y": 664
              },
              "add@block#1": {
                "x": 24,
                "y": 814
              },
              "block.norm_ffn": {
                "x": 24,
                "y": 964
              },
              "block.attention.query": {
                "x": 24,
                "y": 214
              },
              "python@block.attention#0": {
                "x": 24,
                "y": 364
              },
              "block.attention.key": {
                "x": 24,
                "y": 514
              },
              "python@block.attention#1": {
                "x": 24,
                "y": 664
              },
              "block.attention.value": {
                "x": 24,
                "y": 814
              },
              "python@block.attention#2": {
                "x": 24,
                "y": 964
              },
              "block.attention.scores": {
                "x": 24,
                "y": 1114
              },
              "block.attention.softmax": {
                "x": 24,
                "y": 1264
              },
              "python@block.attention#3": {
                "x": 24,
                "y": 1414
              },
              "block.attention.project": {
                "x": 24,
                "y": 1564
              },
              "python@block.attention.scores#0": {
                "x": 24,
                "y": 214
              },
              "python@block.attention.scores#1": {
                "x": 24,
                "y": 364
              },
              "block.ffn.expand": {
                "x": 24,
                "y": 214
              },
              "block.ffn.relu": {
                "x": 24,
                "y": 364
              },
              "block.ffn.project": {
                "x": 24,
                "y": 514
              }
            },
            "expandedModuleIds": [],
            "selectedNodeIds": [
              "embedding"
            ],
            "viewport": {
              "width": 1100,
              "height": 700
            }
          },
          "anchors": [
            {
              "target": {
                "kind": "node",
                "nodeId": "embedding"
              },
              "snapshotId": "snapshot-d177c5aa44d90c8",
              "exportedAt": "2026-09-17T05:43:00.236026+00:00",
              "modelName": "TinyDecoder",
              "context": "{\"connections\":[\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"embedding\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"add@positions#0\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"embedding\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"positions\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"embedding\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"python@positions#0\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"embedding\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"python@positions#1\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"input\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"embedding\\\",\\\"targetPort\\\":\\\"x\\\"}\"],\"contents\":[],\"node\":{\"id\":\"embedding\",\"kind\":\"layer\",\"op\":\"Embedding\",\"params\":{\"embedding_dim\":16,\"num_embeddings\":32}}}"
            }
          ]
        },
        {
          "id": "causal",
          "title": "Restrict attention to the prefix",
          "note": "Four heads each have four features. Query–key scores are scaled by √4 and future positions are masked before softmax. The recorded rows below show the resulting zero weights.",
          "view": {
            "camera": {
              "x": 308.5,
              "y": -1044,
              "z": 1.25
            },
            "nodePositions": {
              "input": {
                "x": 0,
                "y": 160
              },
              "embedding": {
                "x": 340,
                "y": 160
              },
              "positions": {
                "x": 680,
                "y": 160
              },
              "block": {
                "x": 1020,
                "y": 160
              },
              "vocabulary": {
                "x": 1360,
                "y": 160
              },
              "probabilities": {
                "x": 1700,
                "y": 160
              },
              "output": {
                "x": 2040,
                "y": 160
              },
              "python@positions#1": {
                "x": 24,
                "y": 214
              },
              "python@positions#0": {
                "x": 24,
                "y": 364
              },
              "mul@positions#0": {
                "x": 24,
                "y": 514
              },
              "stack@positions#0": {
                "x": 24,
                "y": 664
              },
              "flatten@positions#0": {
                "x": 24,
                "y": 814
              },
              "add@positions#0": {
                "x": 24,
                "y": 964
              },
              "block.attention": {
                "x": 24,
                "y": 214
              },
              "add@block#0": {
                "x": 24,
                "y": 364
              },
              "block.norm_attention": {
                "x": 24,
                "y": 514
              },
              "block.ffn": {
                "x": 24,
                "y": 664
              },
              "add@block#1": {
                "x": 24,
                "y": 814
              },
              "block.norm_ffn": {
                "x": 24,
                "y": 964
              },
              "block.attention.query": {
                "x": 24,
                "y": 214
              },
              "python@block.attention#0": {
                "x": 24,
                "y": 364
              },
              "block.attention.key": {
                "x": 24,
                "y": 514
              },
              "python@block.attention#1": {
                "x": 24,
                "y": 664
              },
              "block.attention.value": {
                "x": 24,
                "y": 814
              },
              "python@block.attention#2": {
                "x": 24,
                "y": 964
              },
              "block.attention.scores": {
                "x": 24,
                "y": 1114
              },
              "block.attention.softmax": {
                "x": 24,
                "y": 1264
              },
              "python@block.attention#3": {
                "x": 24,
                "y": 1414
              },
              "block.attention.project": {
                "x": 24,
                "y": 1564
              },
              "python@block.attention.scores#0": {
                "x": 24,
                "y": 214
              },
              "python@block.attention.scores#1": {
                "x": 24,
                "y": 364
              },
              "block.ffn.expand": {
                "x": 24,
                "y": 214
              },
              "block.ffn.relu": {
                "x": 24,
                "y": 364
              },
              "block.ffn.project": {
                "x": 24,
                "y": 514
              }
            },
            "expandedModuleIds": [
              "block",
              "block.attention"
            ],
            "selectedNodeIds": [
              "block.attention.softmax"
            ],
            "viewport": {
              "width": 1100,
              "height": 700
            }
          },
          "anchors": [
            {
              "target": {
                "kind": "node",
                "nodeId": "block.attention.softmax"
              },
              "snapshotId": "snapshot-d177c5aa44d90c8",
              "exportedAt": "2026-09-17T05:43:00.236026+00:00",
              "modelName": "TinyDecoder",
              "context": "{\"connections\":[\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"block.attention.scores\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"block.attention.softmax\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"block.attention.softmax\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"python@block.attention#3\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"python@block.attention.scores#1\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"block.attention.softmax\\\",\\\"targetPort\\\":\\\"x\\\"}\"],\"contents\":[],\"node\":{\"id\":\"block.attention.softmax\",\"kind\":\"layer\",\"op\":\"Softmax\",\"params\":{},\"parent\":\"block.attention\"}}"
            }
          ]
        },
        {
          "id": "feed-forward",
          "title": "Transform each token's features",
          "note": "A 16 → 64 → 16 ReLU feed-forward network processes each position independently. Residual additions and LayerNorm surround the attention and feed-forward routes.",
          "view": {
            "camera": {
              "x": 434.8461538461538,
              "y": -590.8251748251748,
              "z": 0.8746177370030581
            },
            "nodePositions": {
              "input": {
                "x": 0,
                "y": 160
              },
              "embedding": {
                "x": 340,
                "y": 160
              },
              "positions": {
                "x": 680,
                "y": 160
              },
              "block": {
                "x": 1020,
                "y": 160
              },
              "vocabulary": {
                "x": 1360,
                "y": 160
              },
              "probabilities": {
                "x": 1700,
                "y": 160
              },
              "output": {
                "x": 2040,
                "y": 160
              },
              "python@positions#1": {
                "x": 24,
                "y": 214
              },
              "python@positions#0": {
                "x": 24,
                "y": 364
              },
              "mul@positions#0": {
                "x": 24,
                "y": 514
              },
              "stack@positions#0": {
                "x": 24,
                "y": 664
              },
              "flatten@positions#0": {
                "x": 24,
                "y": 814
              },
              "add@positions#0": {
                "x": 24,
                "y": 964
              },
              "block.attention": {
                "x": 24,
                "y": 214
              },
              "add@block#0": {
                "x": 24,
                "y": 364
              },
              "block.norm_attention": {
                "x": 24,
                "y": 514
              },
              "block.ffn": {
                "x": 24,
                "y": 664
              },
              "add@block#1": {
                "x": 24,
                "y": 814
              },
              "block.norm_ffn": {
                "x": 24,
                "y": 964
              },
              "block.attention.query": {
                "x": 24,
                "y": 214
              },
              "python@block.attention#0": {
                "x": 24,
                "y": 364
              },
              "block.attention.key": {
                "x": 24,
                "y": 514
              },
              "python@block.attention#1": {
                "x": 24,
                "y": 664
              },
              "block.attention.value": {
                "x": 24,
                "y": 814
              },
              "python@block.attention#2": {
                "x": 24,
                "y": 964
              },
              "block.attention.scores": {
                "x": 24,
                "y": 1114
              },
              "block.attention.softmax": {
                "x": 24,
                "y": 1264
              },
              "python@block.attention#3": {
                "x": 24,
                "y": 1414
              },
              "block.attention.project": {
                "x": 24,
                "y": 1564
              },
              "python@block.attention.scores#0": {
                "x": 24,
                "y": 214
              },
              "python@block.attention.scores#1": {
                "x": 24,
                "y": 364
              },
              "block.ffn.expand": {
                "x": 24,
                "y": 214
              },
              "block.ffn.relu": {
                "x": 24,
                "y": 364
              },
              "block.ffn.project": {
                "x": 24,
                "y": 514
              }
            },
            "expandedModuleIds": [
              "block",
              "block.ffn"
            ],
            "selectedNodeIds": [
              "block.ffn"
            ],
            "viewport": {
              "width": 1100,
              "height": 700
            }
          },
          "anchors": [
            {
              "target": {
                "kind": "node",
                "nodeId": "block.ffn"
              },
              "snapshotId": "snapshot-d177c5aa44d90c8",
              "exportedAt": "2026-09-17T05:43:00.236026+00:00",
              "modelName": "TinyDecoder",
              "context": "{\"connections\":[\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"block.ffn\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"add@block#1\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"block.ffn.expand\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"block.ffn.relu\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"block.ffn.project\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"add@block#1\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"block.ffn.relu\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"block.ffn.project\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"block.norm_attention\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"block.ffn\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"block.norm_attention\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"block.ffn.expand\\\",\\\"targetPort\\\":\\\"x\\\"}\"],\"contents\":[\"{\\\"id\\\":\\\"block.ffn.expand\\\",\\\"kind\\\":\\\"layer\\\",\\\"op\\\":\\\"Linear\\\",\\\"params\\\":{\\\"in_features\\\":16,\\\"out_features\\\":64},\\\"parent\\\":\\\"block.ffn\\\"}\",\"{\\\"id\\\":\\\"block.ffn.project\\\",\\\"kind\\\":\\\"layer\\\",\\\"op\\\":\\\"Linear\\\",\\\"params\\\":{\\\"in_features\\\":64,\\\"out_features\\\":16},\\\"parent\\\":\\\"block.ffn\\\"}\",\"{\\\"id\\\":\\\"block.ffn.relu\\\",\\\"kind\\\":\\\"layer\\\",\\\"op\\\":\\\"ReLU\\\",\\\"params\\\":{},\\\"parent\\\":\\\"block.ffn\\\"}\"],\"node\":{\"id\":\"block.ffn\",\"kind\":\"module\",\"op\":\"Module\",\"params\":{},\"parent\":\"block\"}}"
            }
          ]
        },
        {
          "id": "predict",
          "title": "Form a vocabulary distribution",
          "note": "The final projection creates 32 logits for every position. Softmax turns them into probabilities that sum to one; training would teach these outputs to predict the next token.",
          "view": {
            "camera": {
              "x": -1367.5,
              "y": 60,
              "z": 1.25
            },
            "nodePositions": {
              "input": {
                "x": 0,
                "y": 160
              },
              "embedding": {
                "x": 340,
                "y": 160
              },
              "positions": {
                "x": 680,
                "y": 160
              },
              "block": {
                "x": 1020,
                "y": 160
              },
              "vocabulary": {
                "x": 1360,
                "y": 160
              },
              "probabilities": {
                "x": 1700,
                "y": 160
              },
              "output": {
                "x": 2040,
                "y": 160
              },
              "python@positions#1": {
                "x": 24,
                "y": 214
              },
              "python@positions#0": {
                "x": 24,
                "y": 364
              },
              "mul@positions#0": {
                "x": 24,
                "y": 514
              },
              "stack@positions#0": {
                "x": 24,
                "y": 664
              },
              "flatten@positions#0": {
                "x": 24,
                "y": 814
              },
              "add@positions#0": {
                "x": 24,
                "y": 964
              },
              "block.attention": {
                "x": 24,
                "y": 214
              },
              "add@block#0": {
                "x": 24,
                "y": 364
              },
              "block.norm_attention": {
                "x": 24,
                "y": 514
              },
              "block.ffn": {
                "x": 24,
                "y": 664
              },
              "add@block#1": {
                "x": 24,
                "y": 814
              },
              "block.norm_ffn": {
                "x": 24,
                "y": 964
              },
              "block.attention.query": {
                "x": 24,
                "y": 214
              },
              "python@block.attention#0": {
                "x": 24,
                "y": 364
              },
              "block.attention.key": {
                "x": 24,
                "y": 514
              },
              "python@block.attention#1": {
                "x": 24,
                "y": 664
              },
              "block.attention.value": {
                "x": 24,
                "y": 814
              },
              "python@block.attention#2": {
                "x": 24,
                "y": 964
              },
              "block.attention.scores": {
                "x": 24,
                "y": 1114
              },
              "block.attention.softmax": {
                "x": 24,
                "y": 1264
              },
              "python@block.attention#3": {
                "x": 24,
                "y": 1414
              },
              "block.attention.project": {
                "x": 24,
                "y": 1564
              },
              "python@block.attention.scores#0": {
                "x": 24,
                "y": 214
              },
              "python@block.attention.scores#1": {
                "x": 24,
                "y": 364
              },
              "block.ffn.expand": {
                "x": 24,
                "y": 214
              },
              "block.ffn.relu": {
                "x": 24,
                "y": 364
              },
              "block.ffn.project": {
                "x": 24,
                "y": 514
              }
            },
            "expandedModuleIds": [],
            "selectedNodeIds": [
              "probabilities"
            ],
            "viewport": {
              "width": 1100,
              "height": 700
            }
          },
          "anchors": [
            {
              "target": {
                "kind": "node",
                "nodeId": "probabilities"
              },
              "snapshotId": "snapshot-d177c5aa44d90c8",
              "exportedAt": "2026-09-17T05:43:00.236026+00:00",
              "modelName": "TinyDecoder",
              "context": "{\"connections\":[\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"probabilities\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"output\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"vocabulary\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"probabilities\\\",\\\"targetPort\\\":\\\"x\\\"}\"],\"contents\":[],\"node\":{\"id\":\"probabilities\",\"kind\":\"layer\",\"op\":\"Softmax\",\"params\":{}}}"
            }
          ]
        }
      ]
    },
    "threads": [],
    "savedViews": [
      {
        "id": "causal",
        "title": "Restrict attention to the prefix",
        "note": "Four heads each have four features. Query–key scores are scaled by √4 and future positions are masked before softmax. The recorded rows below show the resulting zero weights.",
        "view": {
          "camera": {
            "x": 308.5,
            "y": -1044,
            "z": 1.25
          },
          "nodePositions": {
            "input": {
              "x": 0,
              "y": 160
            },
            "embedding": {
              "x": 340,
              "y": 160
            },
            "positions": {
              "x": 680,
              "y": 160
            },
            "block": {
              "x": 1020,
              "y": 160
            },
            "vocabulary": {
              "x": 1360,
              "y": 160
            },
            "probabilities": {
              "x": 1700,
              "y": 160
            },
            "output": {
              "x": 2040,
              "y": 160
            },
            "python@positions#1": {
              "x": 24,
              "y": 214
            },
            "python@positions#0": {
              "x": 24,
              "y": 364
            },
            "mul@positions#0": {
              "x": 24,
              "y": 514
            },
            "stack@positions#0": {
              "x": 24,
              "y": 664
            },
            "flatten@positions#0": {
              "x": 24,
              "y": 814
            },
            "add@positions#0": {
              "x": 24,
              "y": 964
            },
            "block.attention": {
              "x": 24,
              "y": 214
            },
            "add@block#0": {
              "x": 24,
              "y": 364
            },
            "block.norm_attention": {
              "x": 24,
              "y": 514
            },
            "block.ffn": {
              "x": 24,
              "y": 664
            },
            "add@block#1": {
              "x": 24,
              "y": 814
            },
            "block.norm_ffn": {
              "x": 24,
              "y": 964
            },
            "block.attention.query": {
              "x": 24,
              "y": 214
            },
            "python@block.attention#0": {
              "x": 24,
              "y": 364
            },
            "block.attention.key": {
              "x": 24,
              "y": 514
            },
            "python@block.attention#1": {
              "x": 24,
              "y": 664
            },
            "block.attention.value": {
              "x": 24,
              "y": 814
            },
            "python@block.attention#2": {
              "x": 24,
              "y": 964
            },
            "block.attention.scores": {
              "x": 24,
              "y": 1114
            },
            "block.attention.softmax": {
              "x": 24,
              "y": 1264
            },
            "python@block.attention#3": {
              "x": 24,
              "y": 1414
            },
            "block.attention.project": {
              "x": 24,
              "y": 1564
            },
            "python@block.attention.scores#0": {
              "x": 24,
              "y": 214
            },
            "python@block.attention.scores#1": {
              "x": 24,
              "y": 364
            },
            "block.ffn.expand": {
              "x": 24,
              "y": 214
            },
            "block.ffn.relu": {
              "x": 24,
              "y": 364
            },
            "block.ffn.project": {
              "x": 24,
              "y": 514
            }
          },
          "expandedModuleIds": [
            "block",
            "block.attention"
          ],
          "selectedNodeIds": [
            "block.attention.softmax"
          ],
          "viewport": {
            "width": 1100,
            "height": 700
          }
        },
        "anchors": [
          {
            "target": {
              "kind": "node",
              "nodeId": "block.attention.softmax"
            },
            "snapshotId": "snapshot-d177c5aa44d90c8",
            "exportedAt": "2026-09-17T05:43:00.236026+00:00",
            "modelName": "TinyDecoder",
            "context": "{\"connections\":[\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"block.attention.scores\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"block.attention.softmax\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"block.attention.softmax\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"python@block.attention#3\\\",\\\"targetPort\\\":\\\"x\\\"}\",\"{\\\"kind\\\":\\\"edge\\\",\\\"source\\\":\\\"python@block.attention.scores#1\\\",\\\"sourcePort\\\":\\\"y\\\",\\\"target\\\":\\\"block.attention.softmax\\\",\\\"targetPort\\\":\\\"x\\\"}\"],\"contents\":[],\"node\":{\"id\":\"block.attention.softmax\",\"kind\":\"layer\",\"op\":\"Softmax\",\"params\":{},\"parent\":\"block.attention\"}}"
          }
        ]
      }
    ],
    "openingViewId": "causal"
  }
}
