{"type":"excalidraw","version":2,"source":"https://AwesomeSystemDesign.dev","elements":[{"angle":0,"strokeColor":"#6577aa","backgroundColor":"#eef1fc","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-1"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-1"}],"updated":0,"link":null,"locked":false,"id":"shape-0","type":"rectangle","seed":41,"x":36,"y":32,"width":192,"height":527.4000000000001,"customData":{"revealStep":1}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-1"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-1","type":"text","seed":114,"x":56,"y":50.00000000000003,"width":152,"height":491.40000000000003,"fontSize":18,"fontFamily":1,"text":"User Tower\n\nInput:\n- user_id\n- age\n- gender\n- country\n- history\n(last 50\nitems)\n\nLayers:\nDense →\nReLU →\nDense →\nReLU →\nDense\n\nOutput:\n256-dim\nembedding","originalText":"User Tower\n\nInput:\n- user_id\n- age\n- gender\n- country\n- history\n(last 50\nitems)\n\nLayers:\nDense →\nReLU →\nDense →\nReLU →\nDense\n\nOutput:\n256-dim\nembedding","textAlign":"center","verticalAlign":"middle","containerId":"shape-0","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":1}},{"angle":0,"strokeColor":"#628572","backgroundColor":"#edf5ee","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-2"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-3"}],"updated":0,"link":null,"locked":false,"id":"shape-2","type":"rectangle","seed":187,"x":268,"y":32,"width":192,"height":527.4000000000001,"customData":{"revealStep":2}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-2"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-3","type":"text","seed":260,"x":288,"y":50.00000000000003,"width":152,"height":491.40000000000003,"fontSize":18,"fontFamily":1,"text":"Item Tower\n\nInput:\n- item_id\n- category\n- title\n- tags\n- price\n- age\n- creator\n\nLayers:\nDense →\nReLU →\nDense →\nReLU →\nDense\n\nOutput:\n256-dim\nembedding","originalText":"Item Tower\n\nInput:\n- item_id\n- category\n- title\n- tags\n- price\n- age\n- creator\n\nLayers:\nDense →\nReLU →\nDense →\nReLU →\nDense\n\nOutput:\n256-dim\nembedding","textAlign":"center","verticalAlign":"middle","containerId":"shape-2","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":2}},{"angle":0,"strokeColor":"#a68a53","backgroundColor":"#fff7e6","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-3"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-5"}],"updated":0,"link":null,"locked":false,"id":"shape-4","type":"rectangle","seed":333,"x":36,"y":599.4000000000001,"width":547.46122,"height":345.40000000000003,"customData":{"revealStep":3}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-3"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-5","type":"text","seed":406,"x":56,"y":617.4000000000001,"width":507.46122,"height":309.40000000000003,"fontSize":17,"fontFamily":1,"text":"Two-Tower Model Architecture\n\nTRAINING (offline):\n\nuser_embedding item_embedding\n\ndot_product(user, item) = similarity score\n\nLoss: softmax cross-entropy\npositive pairs: (user, item_clicked)\nnegative pairs: (user, random_item) — in-batch negatives\n\nTraining data: 3.6T interactions, sampled\nTraining time: ~8 hours on 256 GPUs","originalText":"Two-Tower Model Architecture\n\nTRAINING (offline):\n\nuser_embedding item_embedding\n\ndot_product(user, item) = similarity score\n\nLoss: softmax cross-entropy\npositive pairs: (user, item_clicked)\nnegative pairs: (user, random_item) — in-batch negatives\n\nTraining data: 3.6T interactions, sampled\nTraining time: ~8 hours on 256 GPUs","textAlign":"left","verticalAlign":"middle","containerId":"shape-4","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":3}},{"angle":0,"strokeColor":"#a68a53","backgroundColor":"#fff7e6","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-4"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-7"}],"updated":0,"link":null,"locked":false,"id":"shape-6","type":"rectangle","seed":479,"x":36,"y":968.8000000000002,"width":420,"height":68,"customData":{"revealStep":4}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-4"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-7","type":"text","seed":552,"x":56,"y":991.7500000000002,"width":380,"height":22.1,"fontSize":17,"fontFamily":1,"text":"SERVING (online):","originalText":"SERVING (online):","textAlign":"left","verticalAlign":"middle","containerId":"shape-6","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":4}},{"angle":0,"strokeColor":"#a68a53","backgroundColor":"#fff7e6","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-5"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-9"}],"updated":0,"link":null,"locked":false,"id":"shape-8","type":"rectangle","seed":625,"x":36,"y":1060.8000000000002,"width":640.94898,"height":124.4,"customData":{"revealStep":5}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-5"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-9","type":"text","seed":698,"x":56,"y":1078.8000000000002,"width":600.94898,"height":88.4,"fontSize":17,"fontFamily":1,"text":"1. User logs in → look up user_embedding (precomputed or on-the-fly)\n2. Query ANN index with user_embedding\n3. ANN returns top-1000 nearest item_embeddings\n4. These are the collaborative filtering candidates","originalText":"1. User logs in → look up user_embedding (precomputed or on-the-fly)\n2. Query ANN index with user_embedding\n3. ANN returns top-1000 nearest item_embeddings\n4. These are the collaborative filtering candidates","textAlign":"left","verticalAlign":"middle","containerId":"shape-8","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":5}},{"angle":0,"strokeColor":"#a68a53","backgroundColor":"#fff7e6","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-6"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-11"}],"updated":0,"link":null,"locked":false,"id":"shape-10","type":"rectangle","seed":771,"x":36,"y":1209.2000000000003,"width":557.49836,"height":146.5,"customData":{"revealStep":6}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-6"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-11","type":"text","seed":844,"x":56,"y":1227.2000000000003,"width":517.49836,"height":110.5,"fontSize":17,"fontFamily":1,"text":"Why \"Two-Tower\"?\nUser and item embeddings are computed INDEPENDENTLY\nItem embeddings precomputed and stored in ANN index\nAt serving time, only compute user embedding (fast)\nThen ANN lookup is O(log N) not O(N)","originalText":"Why \"Two-Tower\"?\nUser and item embeddings are computed INDEPENDENTLY\nItem embeddings precomputed and stored in ANN index\nAt serving time, only compute user embedding (fast)\nThen ANN lookup is O(log N) not O(N)","textAlign":"left","verticalAlign":"middle","containerId":"shape-10","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":6}}],"appState":{"viewBackgroundColor":"#fbfbf8","gridSize":null},"files":{}}