internalsGet Pro

Module 16 · Lesson 5 of 15Pro

Two-tower models for fast retrieval

Level
Advanced
Topic
Recommendation and ranking systems
Reading time
18 min

When you finish this page you can

  1. Explain why scoring with a dot product between separately computed vectors lets 20 million product vectors be computed once a day and searched with a nearest-neighbour index.
  2. Decide which features go in the user tower and which in the item tower, and name the signals neither tower can see.
  3. Train a two-tower model on orders with in-batch negatives, and correct its bias against popular products with logQ correction.
  4. Estimate the memory and the per-request work of serving a two-tower model at 30,000 requests a second.
  1. Learned embeddings: vectors for words, items and users18 min
  2. Collaborative filtering and matrix factorization20 min
  3. Content-based recommendations17 min

Video lesson · coming soon

Twenty million products, 100 milliseconds

It is the first morning of the festival sale at , the online store this course uses as its example. Recommendations take about 30,000 requests a second, and each “Picked for you” row must be ready within 100 ms. The catalogue holds 20 million products.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan