Slide 1

Slide 1 text

Scaling embedding models to serve a billion queries Senthilkumar Gopal @sengopal

Slide 2

Slide 2 text

© 2022 eBay. All rights reserved. 2 Journey of a Query @ eBay

Slide 3

Slide 3 text

© 2022 eBay. All rights reserved. 3 Search @ eBay How can we discover items without describing them? This is a problem across many domains where search is a core functionality. Question to ponder can we provide users with the ability to “discover” through visual cues instead? https://unsplash.com/photos/2oUiUu5QAys

Slide 4

Slide 4 text

© 2022 eBay. All rights reserved. 4 Current Search Experience Nice Kilim Pillow for my couch! Is this a kilim pillow? Or a orange kilim pillows? Perhaps a orange throw kilim pillow??

Slide 5

Slide 5 text

© 2022 eBay. All rights reserved. 5 k nearest neighbours search - A thought experiment Let’s represent an item TITLE as a 2-dimensional vector

Slide 6

Slide 6 text

© 2022 eBay. All rights reserved. 6 So what is an embedding then? https://pytorch.org/tutorials/beginner/nlp/word_embeddings_tutorial.html Represents Semantic Similarity Similarity (sofa, couch) A real word example [R 768 ]

Slide 7

Slide 7 text

© 2022 eBay. All rights reserved. 7 So what is an embedding then? Large Language Models - GPT 3 [175 B] ○ 45 TB text data - Wikipedia and books Neural network learns word associations from a large corpus. ○ Detects synonymous words. ○ Suggests words for a partial sentence. https://en.wikipedia.org/wiki/Word2vec https://ruder.io/word-embeddings-1/ You shall know a word by the company it keeps - (Firth, J. R. 1957:11)

Slide 8

Slide 8 text

© 2022 eBay. All rights reserved. 8 So what is an embedding then? http://web.stanford.edu/class/cs224n/slides/cs224n-2022-lecture02-wordvecs2.pdf 8 numbers companies books

Slide 9

Slide 9 text

© 2022 eBay. All rights reserved. 9 So what is an embedding then? http://web.stanford.edu/class/cs224n/slides/cs224n-2022-lecture02-wordvecs2.pdf

Slide 10

Slide 10 text

© 2022 eBay. All rights reserved. 10 What about an image? https://en.wikipedia.org/wiki/Convolutional_neural_network

Slide 11

Slide 11 text

© 2022 eBay. All rights reserved. 11 Model Architecture Multiple Modalities - Inspired by CLIP * https://openai.com/blog/clip/

Slide 12

Slide 12 text

© 2022 eBay. All rights reserved. 12 How do we “learn” an embedding? Devlin, Jacob, et al. "Bert: Pre-training of deep bidirectional transformers for language understanding." arXiv preprint arXiv:1810.04805 (2018). https://en.wikipedia.org/wiki/Convolutional_neural_network Text Encoder Image Encoder R 768 That's how an embedding looks like!!!

Slide 13

Slide 13 text

© 2022 eBay. All rights reserved. 13 Why do we need ANN? Exhaustive search curse of dimensionality ANN Approximate Nearest Neighbours All problems start with SCALE https://en.wikipedia.org/wiki/Proximity_analysis#/media/File:Euclidean_Voronoi_diagram.svg http://ann-benchmarks.com/index.html#algorithms

Slide 14

Slide 14 text

© 2022 eBay. All rights reserved. 14 combining the elements together

Slide 15

Slide 15 text

© 2022 eBay. All rights reserved. 15 How does this function? Display all inventory matching my visual appeal Is this a orange throw kilim pillow? Quickly pivot to entire inventory using a visual first cue

Slide 16

Slide 16 text

Data Engineering

Slide 17

Slide 17 text

© 2022 eBay. All rights reserved. 17 Design Trained model

Slide 18

Slide 18 text

© 2022 eBay. All rights reserved. 18 Data Ingestion

Slide 19

Slide 19 text

© 2022 eBay. All rights reserved. 19 Data Ingestion Challenges - Speed vs. resource trade off - Storage - Download errors - Downstream dependencies https://unsplash.com/photos/wrrgZwI7qOY

Slide 20

Slide 20 text

© 2022 eBay. All rights reserved. 20 ML Platform and Inference

Slide 21

Slide 21 text

© 2022 eBay. All rights reserved. 21 Cassini Indexing The Architecture of eBay Search Trotman, Andrew, Jon Degenhardt, and Surya Kallumadi - eCOM@ SIGIR. 2017.

Slide 22

Slide 22 text

© 2022 eBay. All rights reserved. 22 Orchestration https://unsplash.com/photos/yUJVHiYZCGQ

Slide 23

Slide 23 text

© 2022 eBay. All rights reserved. 23 Workflow Orchestration using Apache Airflow Processing modes - BULK - DELTA Apache Airflow Logo

Slide 24

Slide 24 text

© 2022 eBay. All rights reserved. 24 Challenges with Apache Airflow Challenge Solution Multiple Spark versions Define task level parameters Multiple Docker image versions Python virtual environment packages Different platforms, zones, and network flakiness Retries, system monitoring Apache Airflow Logo

Slide 25

Slide 25 text

© 2022 eBay. All rights reserved. 25 A/B Testing How do we test different models in production? Trained model

Slide 26

Slide 26 text

© 2022 eBay. All rights reserved. 26 Data Publishing for A/B Tests using Airflow

Slide 27

Slide 27 text

© 2022 eBay. All rights reserved. 27 Model Drift • Seasonality • Aging of the models Actions • Metrics monitoring • Downstream evaluation • Retraining Evolution Data Drift • Data Integrity • Data pipelines Actions • Fault tolerance • Monitoring of time, cpu, memory, disk

Slide 28

Slide 28 text

© 2022 eBay. All rights reserved. 28 Key takeaways Similarity Scalability Monitoring

Slide 29

Slide 29 text

© 2022 eBay. All rights reserved. 29 Questions? https://unsplash.com/photos/4V1dC_eoCwg slides are available at https://bit.ly/ebay-ml

Slide 30

Slide 30 text

No content