{
  "schemaVersion": 1,
  "lessonId": "transformers-03",
  "contentHash": "e1476923ec8af45541c1ffde358df2ce7e0100dd828c265a75ad1db8f790568d",
  "rendererHash": "a1bd5b648f4731ae5d5f0a24811c2540d1a0a132149ce589d17c4113509cbedf",
  "kind": "executed",
  "generatedAt": "2026-10-20T10:45:54.021705+00:00",
  "provenance": "recorded_cpu_computation",
  "environment": {
    "backend": "cpu",
    "deviceCount": 1,
    "jax": "0.9.2",
    "numpy": "2.4.4",
    "matplotlib": "3.10.8"
  },
  "stdout": "Block shape: (4, 8)\n",
  "data": {
    "kind": "heatmap",
    "values": [
      [
        -0.0692247599363327,
        -0.058812908828258514,
        -0.05995139479637146,
        0.08969148993492126,
        0.03707131743431091,
        -0.02404448390007019,
        -0.051313698291778564,
        -0.3853258490562439
      ],
      [
        -0.06922483444213867,
        -0.05881297588348389,
        -0.0599513053894043,
        0.08969151973724365,
        0.0370713472366333,
        -0.024044394493103027,
        -0.05131375789642334,
        -0.38532590866088867
      ],
      [
        -0.06922471523284912,
        -0.058812856674194336,
        -0.0599513053894043,
        0.08969151973724365,
        0.03707122802734375,
        -0.024044275283813477,
        -0.05131387710571289,
        -0.38532590866088867
      ],
      [
        -0.06922483444213867,
        -0.058812856674194336,
        -0.0599515438079834,
        0.0896914005279541,
        0.03707122802734375,
        -0.024044513702392578,
        -0.05131387710571289,
        -0.38532590866088867
      ]
    ],
    "rows": [
      "token 0",
      "token 1",
      "token 2",
      "token 3"
    ],
    "columns": [
      "f0",
      "f1",
      "f2",
      "f3",
      "f4",
      "f5",
      "f6",
      "f7"
    ],
    "unit": "output minus input",
    "diverging": true
  },
  "diagram": {
    "title": "The actual single-head pre-LN block",
    "prediction": "What should happen when every learned projection is zero?",
    "reading": "The center path carries four positions with eight features. Attention mixes eligible positions through four-by-four weights. The feed-forward branch changes each token from eight to sixteen features and back. Curved bypasses carry residual values to additions. No multihead or cache component is implied.",
    "alt": "The center path carries four positions with eight features. Attention mixes eligible positions through four-by-four weights. The feed-forward branch changes each token from eight to sixteen features and back. Curved bypasses carry residual values to additions. No multihead or cache component is implied.",
    "scope": "Architecture and dataflow mechanism diagram.",
    "height": 8.7,
    "panel": {
      "kind": "graph",
      "nodes": [
        {
          "id": "x",
          "x": 5,
          "y": 0.7,
          "label": "Input X: 4 \u00d7 8",
          "tone": "data",
          "w": 4,
          "h": 0.85
        },
        {
          "id": "ln1",
          "x": 5,
          "y": 2,
          "label": "Layer norm \u2192 Q, K, V\nEach: 4 \u00d7 8",
          "tone": "data",
          "w": 5,
          "h": 1
        },
        {
          "id": "att",
          "x": 5,
          "y": 3.6,
          "label": "QK\u1d40 / \u221a8 \u2192 causal mask \u2192 softmax\nScores / weights: 4 \u00d7 4",
          "tone": "data",
          "w": 7,
          "h": 1.1
        },
        {
          "id": "v",
          "x": 5,
          "y": 5.2,
          "label": "Weighted V \u2192 output projection\nCorrection: 4 \u00d7 8",
          "tone": "data",
          "w": 6,
          "h": 1
        },
        {
          "id": "a1",
          "x": 5,
          "y": 6.7,
          "label": "Add first residual: 4 \u00d7 8",
          "tone": "result",
          "w": 5,
          "h": 0.85
        },
        {
          "id": "ff",
          "x": 5,
          "y": 8.3,
          "label": "Layer norm \u2192 8 to 16\nGELU \u2192 16 to 8",
          "tone": "data",
          "w": 6,
          "h": 1
        },
        {
          "id": "a2",
          "x": 5,
          "y": 9.9,
          "label": "Add second residual: 4 \u00d7 8",
          "tone": "result",
          "w": 5,
          "h": 0.85
        }
      ],
      "edges": [
        {
          "from": "x",
          "to": "ln1"
        },
        {
          "from": "ln1",
          "to": "att"
        },
        {
          "from": "att",
          "to": "v"
        },
        {
          "from": "v",
          "to": "a1"
        },
        {
          "from": "a1",
          "to": "ff"
        },
        {
          "from": "ff",
          "to": "a2"
        },
        {
          "from": "x",
          "to": "a1",
          "exit": "left",
          "enter": "left",
          "curve": "arc3,rad=0.65"
        },
        {
          "from": "a1",
          "to": "a2",
          "exit": "right",
          "enter": "right",
          "curve": "arc3,rad=-0.9"
        },
        {
          "from": "ln1",
          "to": "v",
          "exit": "right",
          "enter": "right",
          "curve": "arc3,rad=-0.55",
          "label": "V",
          "labelAt": [
            9.25,
            3.55
          ]
        }
      ],
      "height": 10.7,
      "width": 10
    }
  }
}
