{
  "id": "gpt2",
  "name": "GPT-2 Block",
  "components": [
    {
      "id": "input-1",
      "type": "input",
      "name": "tokens",
      "position": { "x": 300, "y": 50 },
      "params": { "shape": [1, 1024] },
      "inputs": [], "outputs": []
    },
    {
      "id": "embedding-1",
      "type": "embedding",
      "name": "token_embed",
      "scope": "embeddings",
      "position": { "x": 300, "y": 230 },
      "params": { "numEmbeddings": 50257, "embeddingDim": 768 },
      "inputs": [], "outputs": []
    },
    {
      "id": "positionalEncoding-1",
      "type": "positionalEncoding",
      "name": "pos_embed",
      "scope": "embeddings",
      "position": { "x": 300, "y": 410 },
      "params": { "maxLen": 1024, "embedDim": 768 },
      "inputs": [], "outputs": []
    },
    {
      "id": "layerNorm-1",
      "type": "layerNorm",
      "name": "ln_1",
      "scope": "block.0",
      "position": { "x": 300, "y": 590 },
      "params": { "normalizedShape": 768 },
      "inputs": [], "outputs": []
    },
    {
      "id": "causalAttention-1",
      "type": "causalAttention",
      "name": "attn",
      "scope": "block.0",
      "position": { "x": 300, "y": 770 },
      "params": { "embedDim": 768, "numHeads": 12 },
      "inputs": [], "outputs": []
    },
    {
      "id": "add-1",
      "type": "add",
      "name": "residual_1",
      "scope": "block.0",
      "position": { "x": 300, "y": 950 },
      "params": {},
      "inputs": [], "outputs": []
    },
    {
      "id": "layerNorm-2",
      "type": "layerNorm",
      "name": "ln_2",
      "scope": "block.0",
      "position": { "x": 300, "y": 1130 },
      "params": { "normalizedShape": 768 },
      "inputs": [], "outputs": []
    },
    {
      "id": "feedForward-1",
      "type": "feedForward",
      "name": "mlp",
      "scope": "block.0",
      "position": { "x": 300, "y": 1310 },
      "params": { "hiddenDim": 768, "ffDim": 3072 },
      "inputs": [], "outputs": []
    },
    {
      "id": "add-2",
      "type": "add",
      "name": "residual_2",
      "scope": "block.0",
      "position": { "x": 300, "y": 1490 },
      "params": {},
      "inputs": [], "outputs": []
    },
    {
      "id": "layerNorm-3",
      "type": "layerNorm",
      "name": "ln_f",
      "scope": "head",
      "position": { "x": 300, "y": 1670 },
      "params": { "normalizedShape": 768 },
      "inputs": [], "outputs": []
    },
    {
      "id": "linear-1",
      "type": "linear",
      "name": "lm_head",
      "scope": "head",
      "position": { "x": 300, "y": 1850 },
      "params": { "outFeatures": 50257 },
      "inputs": [], "outputs": []
    },
    {
      "id": "output-1",
      "type": "output",
      "name": "logits",
      "position": { "x": 300, "y": 2030 },
      "params": {},
      "inputs": [], "outputs": []
    }
  ],
  "connections": [
    { "id": "c1", "from": "input-1", "to": "embedding-1" },
    { "id": "c2", "from": "embedding-1", "to": "positionalEncoding-1" },
    { "id": "c3", "from": "positionalEncoding-1", "to": "layerNorm-1" },
    { "id": "c4", "from": "layerNorm-1", "to": "causalAttention-1" },
    { "id": "c5", "from": "causalAttention-1", "to": "add-1" },
    { "id": "c6", "from": "positionalEncoding-1", "to": "add-1" },
    { "id": "c7", "from": "add-1", "to": "layerNorm-2" },
    { "id": "c8", "from": "layerNorm-2", "to": "feedForward-1" },
    { "id": "c9", "from": "feedForward-1", "to": "add-2" },
    { "id": "c10", "from": "add-1", "to": "add-2" },
    { "id": "c11", "from": "add-2", "to": "layerNorm-3" },
    { "id": "c12", "from": "layerNorm-3", "to": "linear-1" },
    { "id": "c13", "from": "linear-1", "to": "output-1" }
  ]
}
