{
  "id": "tiger",
  "name": "TIGER (Semantic ID Generative Retrieval)",
  "description": "Rajput et al. NeurIPS 2023 - retrieval as sequence generation. The user history is a stream of semantic-ID codes, a seq2seq model DECODES the next item id code by code, and the catalogue never appears as a softmax over millions of rows. Pair it with the RQ-VAE tokenizer that produces the codes.",
  "icon": "🐯",
  "category": "Recommendation",
  "components": [
    {
      "id": "in-hist",
      "type": "input",
      "name": "History semantic IDs (50 items x 4 codes)",
      "position": {
        "x": 80,
        "y": 60
      },
      "params": {
        "shape": [
          1,
          200
        ]
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "enc-emb",
      "type": "embedding",
      "name": "Code Embed (4 x 256 codebooks)",
      "position": {
        "x": 80,
        "y": 160
      },
      "params": {
        "vocabSize": 1024,
        "embeddingDim": 128
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "enc-pos",
      "type": "positionalEncoding",
      "name": "Pos Encoding",
      "position": {
        "x": 80,
        "y": 260
      },
      "params": {
        "dModel": 128,
        "maxLen": 256
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "enc1",
      "type": "transformerBlock",
      "name": "Encoder Block 1",
      "position": {
        "x": 80,
        "y": 360
      },
      "params": {
        "dModel": 128,
        "numHeads": 4,
        "dFf": 512,
        "numLayers": 1,
        "causal": false
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "enc2",
      "type": "transformerBlock",
      "name": "Encoder Block 2",
      "position": {
        "x": 80,
        "y": 460
      },
      "params": {
        "dModel": 128,
        "numHeads": 4,
        "dFf": 512,
        "numLayers": 1,
        "causal": false
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "in-dec",
      "type": "input",
      "name": "Decoded codes so far",
      "position": {
        "x": 460,
        "y": 60
      },
      "params": {
        "shape": [
          1,
          4
        ]
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "dec-emb",
      "type": "embedding",
      "name": "Code Embed (shared)",
      "position": {
        "x": 460,
        "y": 160
      },
      "params": {
        "vocabSize": 1024,
        "embeddingDim": 128
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "dec-pos",
      "type": "positionalEncoding",
      "name": "Pos Encoding",
      "position": {
        "x": 460,
        "y": 260
      },
      "params": {
        "dModel": 128,
        "maxLen": 8
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "dec-self",
      "type": "causalAttention",
      "name": "Masked Self-Attention",
      "position": {
        "x": 460,
        "y": 360
      },
      "params": {
        "embedDim": 128,
        "numHeads": 4
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "xattn",
      "type": "crossAttention",
      "name": "Cross-Attention to history",
      "position": {
        "x": 280,
        "y": 560
      },
      "params": {
        "embedDim": 128,
        "numHeads": 4
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "dec-ff",
      "type": "feedForward",
      "name": "Decoder FFN",
      "position": {
        "x": 280,
        "y": 660
      },
      "params": {
        "embedDim": 128,
        "ffDim": 512
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "dec-norm",
      "type": "layerNorm",
      "name": "LayerNorm",
      "position": {
        "x": 280,
        "y": 760
      },
      "params": {
        "normalizedShape": 128
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "head",
      "type": "lmHead",
      "name": "Codebook Head (1024 codes)",
      "position": {
        "x": 280,
        "y": 860
      },
      "params": {
        "vocabSize": 1024,
        "hiddenSize": 128,
        "tieWeights": true
      },
      "inputs": [],
      "outputs": []
    },
    {
      "id": "out",
      "type": "output",
      "name": "next code logits",
      "position": {
        "x": 280,
        "y": 960
      },
      "params": {},
      "inputs": [],
      "outputs": []
    }
  ],
  "connections": [
    {
      "id": "c1",
      "from": "in-hist",
      "to": "enc-emb",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c2",
      "from": "enc-emb",
      "to": "enc-pos",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c3",
      "from": "enc-pos",
      "to": "enc1",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c4",
      "from": "enc1",
      "to": "enc2",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c5",
      "from": "in-dec",
      "to": "dec-emb",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c6",
      "from": "dec-emb",
      "to": "dec-pos",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c7",
      "from": "dec-pos",
      "to": "dec-self",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c8",
      "from": "dec-self",
      "to": "xattn",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c9",
      "from": "enc2",
      "to": "xattn",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c10",
      "from": "xattn",
      "to": "dec-ff",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c11",
      "from": "dec-ff",
      "to": "dec-norm",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c12",
      "from": "dec-norm",
      "to": "head",
      "fromPort": "bottom",
      "toPort": "top"
    },
    {
      "id": "c13",
      "from": "head",
      "to": "out",
      "fromPort": "bottom",
      "toPort": "top"
    }
  ]
}