SlideShare a Scribd company logo
Scaling Recommendations at Quora
Nikhil Dandekar
@nikhilbd
9/16/2016
Quora’s Mission
“To share and grow the world’s knowledge”
● Millions of questions & answers
● Millions of users
● Over a million topics
● Growing exponentially...
Lots of high-quality textual information
Lots of data relations
● Scaling the home page feed
● Scaling the Machine Learning environment
● Pragmatism: aka don’t chase every new, shiny object
Agenda
Scaling the Home
Page Feed
Recommendations at Quora
● Home feed
● Digest emails
● Topics to follow
● Users to follow
● Related Questions
● Related Topics (topic → topic)
● Trending topics
● …..
Home feed
● Goal: personalized, engaging experience for
reading/writing
● Show a ranked list of stories (questions/answers)
● ML model predicts an interestingness score for each
story
● Training data:
○ impression logs from the past
○ x: features about user/story/interactions
○ y: score based on actions (answer/follow,
upvote/click)
What is interestingness?
click
upvote
downvote
expand
share
click
answer pass
downvot
e
follow
Performance and Cost
Millions of questions and
answers
The best 20 questions and
answers
Personalized
Ranking
x millions of users
Scaling challenge:
● Content growing exponentially
○ Time spent per ranking request growing
exponentially
● Users growing exponentially
○ Number of ranking requests growing
exponentially
● Computational resources spent on ranking
growing quadratically with respect to user
growth
● Solution: Multi-phase ranking!
● Use an unpersonalized model to reduce the
number of candidates for the personalized
model
● Cache the computed score in storage
Performance and Cost
Millions of questions and
answers
The best 20 questions and
answers
Ranking
x millions of users
Thousands of questions and
answers
Unpersonalized
(1p)
Personalized (2p)
Feed backend system
Aggregator 1 Aggregator 2 Aggregator 3
Leaf 1 Leaf 2 Leaf 3
Aggregator
Leaf
Requests from Web (python)
...
...
...
user_id
object_id
Scaling the Machine
Learning Environment
ML applications
● Feed / digest
● Search
● Answer ranking / Answer collapsing
● User-user, user-topic recommendations
● Related questions
● Duplicate questions
● Question-topics
● Question quality
● Spam users / content
● ….and a lot more
Machine Learning environment
ML Models
● Logistic Regression
● Gradient Boosted Decision Trees
● LambdaMART
● Random Forest
● Matrix Factorization
● Deep Neural Networks
● LDA
● k-means
● k-NNs
● ...and others
● Productionizing ML training
○ Continuous retraining of models to
adapt to new data
○ Use Luigi to keep track of task
dependencies
Machine Learning environment
● Productionizing ML training:
○ Continuous retraining of models to
adapt to new data
○ Use Luigi to keep track of task
dependencies
● Use Amazon EC2 spot instance for
training tasks
○ Usually much cheaper than
on-demand price
○ Can spawn multiple boxes at once and
shut them down after training is
complete
Machine Learning environment
● Productionizing ML training:
○ Continuous retraining of models to
adapt to new data
○ Use Luigi to keep track of task
dependencies
● Use Amazon EC2 spot instance for training
tasks
● Extremely important to have automatic
monitoring of each task’s input/output
○ Data can change in unexpected ways
○ Don’t want bugs in upstream models
to affect downstream models
Machine Learning environment
Data populator
Training model 1
Training model 2 Training model 3
● Productionizing ML training:
○ Continuous retraining of models to
adapt to new data
○ Use Luigi to keep track of task
dependencies
● Use Amazon EC2 spot instance for training
tasks
● Extremely important to have automatic
monitoring of each task’s input/output
○ Data can change in unexpected ways
○ Don’t want bugs in upstream models
to affect downstream models
Machine Learning environment
Data populator
Training model 1
Training model 2 Training model 3
Verify data
Verify metrics
Counts, class
proportions,...
MSE, R2, AUC,...
● Need a ML platform that is
○ Easy to ramp up on
○ Easy to iterate on
○ Fast
○ Reliable
○ Reusable
○ Production-ready
Machine Learning platform goals
● Have a centralized ML platform that is shared across teams
○ Write training scripts in C++/Python and run them on remote boxes
○ Provide Python wrappers with iPython integration
○ Store data on Redshift/S3 and have training boxes communicate with them directly
Machine Learning platform
Dev laptop
Storage services (Redshift,
S3…)
Training
boxes
CPU/GPU
● In an IPython notebook
Lego ML platform
Lego ML platform
● Single way to define and add ML features
● Features are reusable
○ Different ML applications do not define / calculate them separately
● Available both offline (training time) and online (prediction time)
● Single point for logging, monitoring, documentation etc.
Alchemy Feature Engineering Framework
Pragmatism
● Relevance
● Speed: Fast prediction, (relatively) fast
training
● Fast development and iteration time
● Reliability / Robustness
● Cost
● Debuggability
● Low technical debt
What all matters for your ML algorithm:
Occam’s razor for Machine Learning
● Given two models that perform more or
less equally, you should always prefer
the less complex
● E.g. A Deep Learning model:
○ +1% in accuracy
○ 10x training time
○ 1.5x prediction time
○ Costly to store and maintain
● Look at all the factors, not just
relevance
Distributing ML training
● Distributed ML training helps you scale with data
● But most of what people do in practice can fit into a single, multi-core
machine
● Trade-offs:
○ Relevance gains
○ Training speed
○ Development and iteration time
○ Costs
● Use what works best given these factors, with an eye out for the future
● Figure out how to scale up your data and your models
● But scaling is not just about data and the models
○ Think about your ML environment too
● Be Pragmatic
○ Don’t chase every new, shiny object
In summary
● https://www.quora.com/careers
● Technical Lead - Machine Learning
● Software Engineer - Machine Learning
● Software Engineer - NLP
● Engineering Manager - Machine Learning
We are hiring!
Thanks!

More Related Content

What's hot

Math problem solving service
Math problem solving serviceMath problem solving service
Math problem solving service
ChaejungMaeng
 
Déjà Vu: The Importance of Time and Causality in Recommender Systems
Déjà Vu: The Importance of Time and Causality in Recommender SystemsDéjà Vu: The Importance of Time and Causality in Recommender Systems
Déjà Vu: The Importance of Time and Causality in Recommender Systems
Justin Basilico
 
RecSys 2016 Talk: Feature Selection For Human Recommenders
RecSys 2016 Talk: Feature Selection For Human RecommendersRecSys 2016 Talk: Feature Selection For Human Recommenders
RecSys 2016 Talk: Feature Selection For Human Recommenders
Katherine Livins
 
Quora ML Workshop: Maintaining High Quality User-Generated Content through Ma...
Quora ML Workshop: Maintaining High Quality User-Generated Content through Ma...Quora ML Workshop: Maintaining High Quality User-Generated Content through Ma...
Quora ML Workshop: Maintaining High Quality User-Generated Content through Ma...
Quora
 
Machine learning the high interest credit card of technical debt [PWL]
Machine learning the high interest credit card of technical debt [PWL]Machine learning the high interest credit card of technical debt [PWL]
Machine learning the high interest credit card of technical debt [PWL]
Jenia Gorokhovsky
 
Machine Learning at Netflix Scale
Machine Learning at Netflix ScaleMachine Learning at Netflix Scale
Machine Learning at Netflix Scale
Aish Fenton
 
Visualising the world of competitive programming with Python (Codeforces)
Visualising the world of competitive programming with Python (Codeforces)Visualising the world of competitive programming with Python (Codeforces)
Visualising the world of competitive programming with Python (Codeforces)
Anuj Menta
 
Time, Context and Causality in Recommender Systems
Time, Context and Causality in Recommender SystemsTime, Context and Causality in Recommender Systems
Time, Context and Causality in Recommender Systems
Yves Raimond
 
Educational Question Routing in Online Student Communities
 Educational Question Routing in Online Student Communities Educational Question Routing in Online Student Communities
Educational Question Routing in Online Student Communities
Jakub Macina
 
Resources for Getting Started in Predictive Analytics
Resources for Getting Started in Predictive AnalyticsResources for Getting Started in Predictive Analytics
Resources for Getting Started in Predictive Analytics
meepbobeep
 
Evan Estola – Data Scientist, Meetup.com at MLconf ATL
Evan Estola – Data Scientist, Meetup.com at MLconf ATLEvan Estola – Data Scientist, Meetup.com at MLconf ATL
Evan Estola – Data Scientist, Meetup.com at MLconf ATL
MLconf
 
Introduction to ML.NET
Introduction to ML.NETIntroduction to ML.NET
Introduction to ML.NET
Marco Parenzan
 
Machine learning 101 dkom 2017
Machine learning 101 dkom 2017Machine learning 101 dkom 2017
Machine learning 101 dkom 2017
fredverheul
 
Machine learning and data at Meetup
Machine learning and data at MeetupMachine learning and data at Meetup
Machine learning and data at Meetup
Evan Estola
 
Europython - Machine Learning for dummies with Python
Europython - Machine Learning for dummies with PythonEuropython - Machine Learning for dummies with Python
Europython - Machine Learning for dummies with Python
Javier Arias Losada
 
10 books that every developer must read
10 books that every developer must read10 books that every developer must read
10 books that every developer must read
Ganesh Samarthyam
 

What's hot (17)

Math problem solving service
Math problem solving serviceMath problem solving service
Math problem solving service
 
Déjà Vu: The Importance of Time and Causality in Recommender Systems
Déjà Vu: The Importance of Time and Causality in Recommender SystemsDéjà Vu: The Importance of Time and Causality in Recommender Systems
Déjà Vu: The Importance of Time and Causality in Recommender Systems
 
RecSys 2016 Talk: Feature Selection For Human Recommenders
RecSys 2016 Talk: Feature Selection For Human RecommendersRecSys 2016 Talk: Feature Selection For Human Recommenders
RecSys 2016 Talk: Feature Selection For Human Recommenders
 
Quora ML Workshop: Maintaining High Quality User-Generated Content through Ma...
Quora ML Workshop: Maintaining High Quality User-Generated Content through Ma...Quora ML Workshop: Maintaining High Quality User-Generated Content through Ma...
Quora ML Workshop: Maintaining High Quality User-Generated Content through Ma...
 
Machine learning the high interest credit card of technical debt [PWL]
Machine learning the high interest credit card of technical debt [PWL]Machine learning the high interest credit card of technical debt [PWL]
Machine learning the high interest credit card of technical debt [PWL]
 
Machine Learning at Netflix Scale
Machine Learning at Netflix ScaleMachine Learning at Netflix Scale
Machine Learning at Netflix Scale
 
Visualising the world of competitive programming with Python (Codeforces)
Visualising the world of competitive programming with Python (Codeforces)Visualising the world of competitive programming with Python (Codeforces)
Visualising the world of competitive programming with Python (Codeforces)
 
Time, Context and Causality in Recommender Systems
Time, Context and Causality in Recommender SystemsTime, Context and Causality in Recommender Systems
Time, Context and Causality in Recommender Systems
 
Educational Question Routing in Online Student Communities
 Educational Question Routing in Online Student Communities Educational Question Routing in Online Student Communities
Educational Question Routing in Online Student Communities
 
Resources for Getting Started in Predictive Analytics
Resources for Getting Started in Predictive AnalyticsResources for Getting Started in Predictive Analytics
Resources for Getting Started in Predictive Analytics
 
Evan Estola – Data Scientist, Meetup.com at MLconf ATL
Evan Estola – Data Scientist, Meetup.com at MLconf ATLEvan Estola – Data Scientist, Meetup.com at MLconf ATL
Evan Estola – Data Scientist, Meetup.com at MLconf ATL
 
Introduction to ML.NET
Introduction to ML.NETIntroduction to ML.NET
Introduction to ML.NET
 
Machine learning 101 dkom 2017
Machine learning 101 dkom 2017Machine learning 101 dkom 2017
Machine learning 101 dkom 2017
 
Machine learning and data at Meetup
Machine learning and data at MeetupMachine learning and data at Meetup
Machine learning and data at Meetup
 
Europython - Machine Learning for dummies with Python
Europython - Machine Learning for dummies with PythonEuropython - Machine Learning for dummies with Python
Europython - Machine Learning for dummies with Python
 
10 books that every developer must read
10 books that every developer must read10 books that every developer must read
10 books that every developer must read
 
kaggle_meet_up
kaggle_meet_upkaggle_meet_up
kaggle_meet_up
 

Viewers also liked

Crowd-Based Personalized Natural Language Explanations for Recommendations
Crowd-Based Personalized Natural Language Explanations for Recommendations Crowd-Based Personalized Natural Language Explanations for Recommendations
Crowd-Based Personalized Natural Language Explanations for Recommendations
Shuo Chang
 
Data features at Foursquare (August 2013)
Data features at Foursquare (August 2013)Data features at Foursquare (August 2013)
Data features at Foursquare (August 2013)
Nikhil Dandekar
 
Activity ranking in linked in feed
Activity ranking in linked in feedActivity ranking in linked in feed
Activity ranking in linked in feed
Bodla Kumar
 
Activity Ranking in LinkedIn Feed
Activity Ranking in LinkedIn FeedActivity Ranking in LinkedIn Feed
Activity Ranking in LinkedIn FeedBodla Kumar
 
Ewa Dominowska, Engineering Manager, Facebook at MLconf SEA - 5/20/16
Ewa Dominowska, Engineering Manager, Facebook at MLconf SEA - 5/20/16Ewa Dominowska, Engineering Manager, Facebook at MLconf SEA - 5/20/16
Ewa Dominowska, Engineering Manager, Facebook at MLconf SEA - 5/20/16
MLconf
 
Qcon SF 2013 - Machine Learning & Recommender Systems @ Netflix Scale
Qcon SF 2013 - Machine Learning & Recommender Systems @ Netflix ScaleQcon SF 2013 - Machine Learning & Recommender Systems @ Netflix Scale
Qcon SF 2013 - Machine Learning & Recommender Systems @ Netflix ScaleXavier Amatriain
 
Evan Estola, Lead Machine Learning Engineer, Meetup at MLconf SEA - 5/20/16
Evan Estola, Lead Machine Learning Engineer, Meetup at MLconf SEA - 5/20/16Evan Estola, Lead Machine Learning Engineer, Meetup at MLconf SEA - 5/20/16
Evan Estola, Lead Machine Learning Engineer, Meetup at MLconf SEA - 5/20/16
MLconf
 
Xyzjairalmeida73 japao
Xyzjairalmeida73 japaoXyzjairalmeida73 japao
Xyzjairalmeida73 japao
Jair Almeida
 
Culture opus in less than 140 characters
Culture opus in less than 140 charactersCulture opus in less than 140 characters
Culture opus in less than 140 characters
Sachin Sharma
 
Evolution Timeline of Ipod Touch
Evolution Timeline of Ipod TouchEvolution Timeline of Ipod Touch
Evolution Timeline of Ipod Touch
Ainin Sofiya Gazari
 
SMWi Bristol: When Does Influencer Become Advertiser and Why Should You Care?
SMWi Bristol: When Does Influencer Become Advertiser and Why Should You Care?SMWi Bristol: When Does Influencer Become Advertiser and Why Should You Care?
SMWi Bristol: When Does Influencer Become Advertiser and Why Should You Care?
Alexei Lee
 
Applying Optimized Persuasion to Improve UX
Applying Optimized Persuasion to Improve UXApplying Optimized Persuasion to Improve UX
Applying Optimized Persuasion to Improve UX
Rachel Weatherly
 

Viewers also liked (14)

Crowd-Based Personalized Natural Language Explanations for Recommendations
Crowd-Based Personalized Natural Language Explanations for Recommendations Crowd-Based Personalized Natural Language Explanations for Recommendations
Crowd-Based Personalized Natural Language Explanations for Recommendations
 
Data features at Foursquare (August 2013)
Data features at Foursquare (August 2013)Data features at Foursquare (August 2013)
Data features at Foursquare (August 2013)
 
Activity ranking in linked in feed
Activity ranking in linked in feedActivity ranking in linked in feed
Activity ranking in linked in feed
 
Activity Ranking in LinkedIn Feed
Activity Ranking in LinkedIn FeedActivity Ranking in LinkedIn Feed
Activity Ranking in LinkedIn Feed
 
Ewa Dominowska, Engineering Manager, Facebook at MLconf SEA - 5/20/16
Ewa Dominowska, Engineering Manager, Facebook at MLconf SEA - 5/20/16Ewa Dominowska, Engineering Manager, Facebook at MLconf SEA - 5/20/16
Ewa Dominowska, Engineering Manager, Facebook at MLconf SEA - 5/20/16
 
Qcon SF 2013 - Machine Learning & Recommender Systems @ Netflix Scale
Qcon SF 2013 - Machine Learning & Recommender Systems @ Netflix ScaleQcon SF 2013 - Machine Learning & Recommender Systems @ Netflix Scale
Qcon SF 2013 - Machine Learning & Recommender Systems @ Netflix Scale
 
Evan Estola, Lead Machine Learning Engineer, Meetup at MLconf SEA - 5/20/16
Evan Estola, Lead Machine Learning Engineer, Meetup at MLconf SEA - 5/20/16Evan Estola, Lead Machine Learning Engineer, Meetup at MLconf SEA - 5/20/16
Evan Estola, Lead Machine Learning Engineer, Meetup at MLconf SEA - 5/20/16
 
Xyzjairalmeida73 japao
Xyzjairalmeida73 japaoXyzjairalmeida73 japao
Xyzjairalmeida73 japao
 
Health insurance an overview
Health insurance an overviewHealth insurance an overview
Health insurance an overview
 
Culture opus in less than 140 characters
Culture opus in less than 140 charactersCulture opus in less than 140 characters
Culture opus in less than 140 characters
 
Evolution Timeline of Ipod Touch
Evolution Timeline of Ipod TouchEvolution Timeline of Ipod Touch
Evolution Timeline of Ipod Touch
 
SMWi Bristol: When Does Influencer Become Advertiser and Why Should You Care?
SMWi Bristol: When Does Influencer Become Advertiser and Why Should You Care?SMWi Bristol: When Does Influencer Become Advertiser and Why Should You Care?
SMWi Bristol: When Does Influencer Become Advertiser and Why Should You Care?
 
Millward brownadreaction estudomultitelas BR 2014
Millward brownadreaction estudomultitelas BR 2014Millward brownadreaction estudomultitelas BR 2014
Millward brownadreaction estudomultitelas BR 2014
 
Applying Optimized Persuasion to Improve UX
Applying Optimized Persuasion to Improve UXApplying Optimized Persuasion to Improve UX
Applying Optimized Persuasion to Improve UX
 

Similar to Scaling Recommendations at Quora (RecSys talk 9/16/2016)

Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15
Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15
Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15
MLconf
 
10 more lessons learned from building Machine Learning systems
10 more lessons learned from building Machine Learning systems10 more lessons learned from building Machine Learning systems
10 more lessons learned from building Machine Learning systems
Xavier Amatriain
 
10 more lessons learned from building Machine Learning systems - MLConf
10 more lessons learned from building Machine Learning systems - MLConf10 more lessons learned from building Machine Learning systems - MLConf
10 more lessons learned from building Machine Learning systems - MLConf
Xavier Amatriain
 
Open source ml systems that need to be built
Open source ml systems that need to be builtOpen source ml systems that need to be built
Open source ml systems that need to be built
Nikhil Garg
 
AI hype or reality
AI  hype or realityAI  hype or reality
AI hype or reality
Awantik Das
 
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning InfrastructureML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
Fei Chen
 
Sf big analytics: bighead
Sf big analytics: bigheadSf big analytics: bighead
Sf big analytics: bighead
Chester Chen
 
Future of ai on the jvm
Future of ai on the jvmFuture of ai on the jvm
Future of ai on the jvm
Adam Gibson
 
BIG2016- Lessons Learned from building real-life user-focused Big Data systems
BIG2016- Lessons Learned from building real-life user-focused Big Data systemsBIG2016- Lessons Learned from building real-life user-focused Big Data systems
BIG2016- Lessons Learned from building real-life user-focused Big Data systems
Xavier Amatriain
 
Production-Ready BIG ML Workflows - from zero to hero
Production-Ready BIG ML Workflows - from zero to heroProduction-Ready BIG ML Workflows - from zero to hero
Production-Ready BIG ML Workflows - from zero to hero
Daniel Marcous
 
Staying Shallow & Lean in a Deep Learning World
Staying Shallow & Lean in a Deep Learning WorldStaying Shallow & Lean in a Deep Learning World
Staying Shallow & Lean in a Deep Learning World
Xavier Amatriain
 
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
MLconf
 
Machine Learning: Artificial Intelligence isn't just a Science Fiction topic
Machine Learning: Artificial Intelligence isn't just a Science Fiction topicMachine Learning: Artificial Intelligence isn't just a Science Fiction topic
Machine Learning: Artificial Intelligence isn't just a Science Fiction topic
Raúl Garreta
 
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
.NET Conf UY
 
Context Aware Recommendations at Netflix
Context Aware Recommendations at NetflixContext Aware Recommendations at Netflix
Context Aware Recommendations at Netflix
Linas Baltrunas
 
Real world machine learning with Java for Fumankaitori.com
Real world machine learning with Java for Fumankaitori.comReal world machine learning with Java for Fumankaitori.com
Real world machine learning with Java for Fumankaitori.com
Mathieu Dumoulin
 
Why you don't need maths to get benefits of ml
Why you don't need maths to get benefits of mlWhy you don't need maths to get benefits of ml
Why you don't need maths to get benefits of ml
Aseem Bansal
 
Building A Machine Learning Platform At Quora (1)
Building A Machine Learning Platform At Quora (1)Building A Machine Learning Platform At Quora (1)
Building A Machine Learning Platform At Quora (1)Nikhil Garg
 
Prototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, PrototypesPrototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, Prototypes
Marta Soncodi
 
General introduction to AI ML DL DS
General introduction to AI ML DL DSGeneral introduction to AI ML DL DS
General introduction to AI ML DL DS
Roopesh Kohad
 

Similar to Scaling Recommendations at Quora (RecSys talk 9/16/2016) (20)

Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15
Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15
Xavier Amatriain, VP of Engineering, Quora at MLconf SF - 11/13/15
 
10 more lessons learned from building Machine Learning systems
10 more lessons learned from building Machine Learning systems10 more lessons learned from building Machine Learning systems
10 more lessons learned from building Machine Learning systems
 
10 more lessons learned from building Machine Learning systems - MLConf
10 more lessons learned from building Machine Learning systems - MLConf10 more lessons learned from building Machine Learning systems - MLConf
10 more lessons learned from building Machine Learning systems - MLConf
 
Open source ml systems that need to be built
Open source ml systems that need to be builtOpen source ml systems that need to be built
Open source ml systems that need to be built
 
AI hype or reality
AI  hype or realityAI  hype or reality
AI hype or reality
 
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning InfrastructureML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
 
Sf big analytics: bighead
Sf big analytics: bigheadSf big analytics: bighead
Sf big analytics: bighead
 
Future of ai on the jvm
Future of ai on the jvmFuture of ai on the jvm
Future of ai on the jvm
 
BIG2016- Lessons Learned from building real-life user-focused Big Data systems
BIG2016- Lessons Learned from building real-life user-focused Big Data systemsBIG2016- Lessons Learned from building real-life user-focused Big Data systems
BIG2016- Lessons Learned from building real-life user-focused Big Data systems
 
Production-Ready BIG ML Workflows - from zero to hero
Production-Ready BIG ML Workflows - from zero to heroProduction-Ready BIG ML Workflows - from zero to hero
Production-Ready BIG ML Workflows - from zero to hero
 
Staying Shallow & Lean in a Deep Learning World
Staying Shallow & Lean in a Deep Learning WorldStaying Shallow & Lean in a Deep Learning World
Staying Shallow & Lean in a Deep Learning World
 
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
 
Machine Learning: Artificial Intelligence isn't just a Science Fiction topic
Machine Learning: Artificial Intelligence isn't just a Science Fiction topicMachine Learning: Artificial Intelligence isn't just a Science Fiction topic
Machine Learning: Artificial Intelligence isn't just a Science Fiction topic
 
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
 
Context Aware Recommendations at Netflix
Context Aware Recommendations at NetflixContext Aware Recommendations at Netflix
Context Aware Recommendations at Netflix
 
Real world machine learning with Java for Fumankaitori.com
Real world machine learning with Java for Fumankaitori.comReal world machine learning with Java for Fumankaitori.com
Real world machine learning with Java for Fumankaitori.com
 
Why you don't need maths to get benefits of ml
Why you don't need maths to get benefits of mlWhy you don't need maths to get benefits of ml
Why you don't need maths to get benefits of ml
 
Building A Machine Learning Platform At Quora (1)
Building A Machine Learning Platform At Quora (1)Building A Machine Learning Platform At Quora (1)
Building A Machine Learning Platform At Quora (1)
 
Prototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, PrototypesPrototyping Workshop - Wireframes, Mockups, Prototypes
Prototyping Workshop - Wireframes, Mockups, Prototypes
 
General introduction to AI ML DL DS
General introduction to AI ML DL DSGeneral introduction to AI ML DL DS
General introduction to AI ML DL DS
 

Recently uploaded

Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
abdulrafaychaudhry
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 

Recently uploaded (20)

Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 

Scaling Recommendations at Quora (RecSys talk 9/16/2016)

  • 1. Scaling Recommendations at Quora Nikhil Dandekar @nikhilbd 9/16/2016
  • 2. Quora’s Mission “To share and grow the world’s knowledge” ● Millions of questions & answers ● Millions of users ● Over a million topics ● Growing exponentially...
  • 3. Lots of high-quality textual information
  • 4. Lots of data relations
  • 5. ● Scaling the home page feed ● Scaling the Machine Learning environment ● Pragmatism: aka don’t chase every new, shiny object Agenda
  • 7. Recommendations at Quora ● Home feed ● Digest emails ● Topics to follow ● Users to follow ● Related Questions ● Related Topics (topic → topic) ● Trending topics ● …..
  • 8.
  • 9. Home feed ● Goal: personalized, engaging experience for reading/writing ● Show a ranked list of stories (questions/answers) ● ML model predicts an interestingness score for each story ● Training data: ○ impression logs from the past ○ x: features about user/story/interactions ○ y: score based on actions (answer/follow, upvote/click)
  • 11. Performance and Cost Millions of questions and answers The best 20 questions and answers Personalized Ranking x millions of users Scaling challenge: ● Content growing exponentially ○ Time spent per ranking request growing exponentially ● Users growing exponentially ○ Number of ranking requests growing exponentially ● Computational resources spent on ranking growing quadratically with respect to user growth
  • 12. ● Solution: Multi-phase ranking! ● Use an unpersonalized model to reduce the number of candidates for the personalized model ● Cache the computed score in storage Performance and Cost Millions of questions and answers The best 20 questions and answers Ranking x millions of users Thousands of questions and answers Unpersonalized (1p) Personalized (2p)
  • 13. Feed backend system Aggregator 1 Aggregator 2 Aggregator 3 Leaf 1 Leaf 2 Leaf 3 Aggregator Leaf Requests from Web (python) ... ... ... user_id object_id
  • 15. ML applications ● Feed / digest ● Search ● Answer ranking / Answer collapsing ● User-user, user-topic recommendations ● Related questions ● Duplicate questions ● Question-topics ● Question quality ● Spam users / content ● ….and a lot more Machine Learning environment ML Models ● Logistic Regression ● Gradient Boosted Decision Trees ● LambdaMART ● Random Forest ● Matrix Factorization ● Deep Neural Networks ● LDA ● k-means ● k-NNs ● ...and others
  • 16. ● Productionizing ML training ○ Continuous retraining of models to adapt to new data ○ Use Luigi to keep track of task dependencies Machine Learning environment
  • 17. ● Productionizing ML training: ○ Continuous retraining of models to adapt to new data ○ Use Luigi to keep track of task dependencies ● Use Amazon EC2 spot instance for training tasks ○ Usually much cheaper than on-demand price ○ Can spawn multiple boxes at once and shut them down after training is complete Machine Learning environment
  • 18. ● Productionizing ML training: ○ Continuous retraining of models to adapt to new data ○ Use Luigi to keep track of task dependencies ● Use Amazon EC2 spot instance for training tasks ● Extremely important to have automatic monitoring of each task’s input/output ○ Data can change in unexpected ways ○ Don’t want bugs in upstream models to affect downstream models Machine Learning environment Data populator Training model 1 Training model 2 Training model 3
  • 19. ● Productionizing ML training: ○ Continuous retraining of models to adapt to new data ○ Use Luigi to keep track of task dependencies ● Use Amazon EC2 spot instance for training tasks ● Extremely important to have automatic monitoring of each task’s input/output ○ Data can change in unexpected ways ○ Don’t want bugs in upstream models to affect downstream models Machine Learning environment Data populator Training model 1 Training model 2 Training model 3 Verify data Verify metrics Counts, class proportions,... MSE, R2, AUC,...
  • 20. ● Need a ML platform that is ○ Easy to ramp up on ○ Easy to iterate on ○ Fast ○ Reliable ○ Reusable ○ Production-ready Machine Learning platform goals
  • 21. ● Have a centralized ML platform that is shared across teams ○ Write training scripts in C++/Python and run them on remote boxes ○ Provide Python wrappers with iPython integration ○ Store data on Redshift/S3 and have training boxes communicate with them directly Machine Learning platform Dev laptop Storage services (Redshift, S3…) Training boxes CPU/GPU
  • 22. ● In an IPython notebook Lego ML platform
  • 24. ● Single way to define and add ML features ● Features are reusable ○ Different ML applications do not define / calculate them separately ● Available both offline (training time) and online (prediction time) ● Single point for logging, monitoring, documentation etc. Alchemy Feature Engineering Framework
  • 26. ● Relevance ● Speed: Fast prediction, (relatively) fast training ● Fast development and iteration time ● Reliability / Robustness ● Cost ● Debuggability ● Low technical debt What all matters for your ML algorithm:
  • 27. Occam’s razor for Machine Learning ● Given two models that perform more or less equally, you should always prefer the less complex ● E.g. A Deep Learning model: ○ +1% in accuracy ○ 10x training time ○ 1.5x prediction time ○ Costly to store and maintain ● Look at all the factors, not just relevance
  • 28. Distributing ML training ● Distributed ML training helps you scale with data ● But most of what people do in practice can fit into a single, multi-core machine ● Trade-offs: ○ Relevance gains ○ Training speed ○ Development and iteration time ○ Costs ● Use what works best given these factors, with an eye out for the future
  • 29. ● Figure out how to scale up your data and your models ● But scaling is not just about data and the models ○ Think about your ML environment too ● Be Pragmatic ○ Don’t chase every new, shiny object In summary
  • 30. ● https://www.quora.com/careers ● Technical Lead - Machine Learning ● Software Engineer - Machine Learning ● Software Engineer - NLP ● Engineering Manager - Machine Learning We are hiring!