{
  "id": "sim",
  "name": "Search-based Interest Model (SIM)",
  "description": "Alibaba 2020 SIM - a lifelong behaviour sequence (2000 events) is cut to the 50 most relevant by the General Search Unit BEFORE anything quadratic runs, then the Exact Search Unit attends them against the candidate. The retrieval step is what makes lifelong sequences affordable.",
  "icon": "🔎",
  "category": "Recommendation",
  "components": [
    {
      "id": "in-seq",
      "type": "input",
      "name": "Lifelong Seq (2000 events)",
      "position": {
        "x": 80,
        "y": 60
      },
      "params": {
        "shape": [
          2000
        ]
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "seq-emb",
      "type": "embedding",
      "name": "Item Embed",
      "position": {
        "x": 80,
        "y": 180
      },
      "params": {
        "vocabSize": 1000000,
        "embeddingDim": 64
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "in-tgt",
      "type": "input",
      "name": "Candidate Item",
      "position": {
        "x": 400,
        "y": 60
      },
      "params": {
        "shape": [
          1
        ]
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "tgt-emb",
      "type": "embedding",
      "name": "Candidate Embed",
      "position": {
        "x": 400,
        "y": 180
      },
      "params": {
        "vocabSize": 1000000,
        "embeddingDim": 64
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "gsu",
      "type": "behaviorRetrieval",
      "name": "GSU: top-50 by relevance",
      "position": {
        "x": 80,
        "y": 320
      },
      "params": {
        "topK": 50,
        "embedDim": 64,
        "mode": "soft"
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "esu",
      "type": "targetAttention",
      "name": "ESU: multi-head target attention",
      "position": {
        "x": 240,
        "y": 440
      },
      "params": {
        "embedDim": 64,
        "hiddenDim": 64,
        "activation": "dice"
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "in-user",
      "type": "input",
      "name": "User Profile",
      "position": {
        "x": 680,
        "y": 60
      },
      "params": {
        "shape": [
          16
        ]
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "user-fc",
      "type": "linear",
      "name": "User Tower",
      "position": {
        "x": 680,
        "y": 180
      },
      "params": {
        "inFeatures": 16,
        "outFeatures": 32
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "cat",
      "type": "concatenate",
      "name": "[interest; user]",
      "position": {
        "x": 460,
        "y": 560
      },
      "params": {
        "dim": 0,
        "numInputs": 2
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "fc1",
      "type": "linear",
      "name": "MLP 200",
      "position": {
        "x": 460,
        "y": 660
      },
      "params": {
        "inFeatures": 96,
        "outFeatures": 200
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "act1",
      "type": "prelu",
      "name": "Dice (~PReLU)",
      "position": {
        "x": 460,
        "y": 740
      },
      "params": {
        "numParameters": 1
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "fc2",
      "type": "linear",
      "name": "MLP 80",
      "position": {
        "x": 460,
        "y": 820
      },
      "params": {
        "inFeatures": 200,
        "outFeatures": 80
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "act2",
      "type": "prelu",
      "name": "Dice (~PReLU)",
      "position": {
        "x": 460,
        "y": 900
      },
      "params": {
        "numParameters": 1
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "ctr",
      "type": "linear",
      "name": "CTR Head",
      "position": {
        "x": 460,
        "y": 980
      },
      "params": {
        "inFeatures": 80,
        "outFeatures": 1
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "sig",
      "type": "sigmoid",
      "name": "Sigmoid",
      "position": {
        "x": 460,
        "y": 1060
      },
      "params": {},
      "inputs": [],
      "outputs": []
    },
    {
      "id": "out",
      "type": "output",
      "name": "pCTR",
      "position": {
        "x": 460,
        "y": 1140
      },
      "params": {},
      "inputs": [],
      "outputs": []
    }
  ],
  "connections": [
    {
      "id": "c1",
      "from": "in-seq",
      "to": "seq-emb",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c2",
      "from": "seq-emb",
      "to": "gsu",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c3",
      "from": "in-tgt",
      "to": "tgt-emb",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c4",
      "from": "tgt-emb",
      "to": "esu",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c5",
      "from": "gsu",
      "to": "esu",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c6",
      "from": "in-user",
      "to": "user-fc",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c7",
      "from": "esu",
      "to": "cat",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c8",
      "from": "user-fc",
      "to": "cat",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c9",
      "from": "cat",
      "to": "fc1",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c10",
      "from": "fc1",
      "to": "act1",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c11",
      "from": "act1",
      "to": "fc2",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c12",
      "from": "fc2",
      "to": "act2",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c13",
      "from": "act2",
      "to": "ctr",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c14",
      "from": "ctr",
      "to": "sig",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c15",
      "from": "sig",
      "to": "out",
      "fromPort": "bottom",
      "toPort": "top"
    }
  ]
}