Collaborative Filtering at Spotify

Erik Bernhardsson
Erik BernhardssonHead of Engineering — we're hiring at Better Mortgage
Music recommendations at Spotify




                                   Erik Bernhardsson

                        erikbern@spotify.com
Recommendation stuff at Spotify
Collaborative filtering
Collaborative filtering

Idea:
- If two movies x, y get similar ratings then they are probably similar
- If a lot of users all listen to tracks x, y, z, then those tracks are
    probably similar
Get data
… lots of data
Aggregate data

Throw away temporal information and just look at the number of times
OK, so now we have a big matrix
… very big matrix
Supervised collaborative filtering is pretty much matrix completion
Supervised learning: Matrix completion
Supervised: evaluating rec quality
Unsupervised learning

-   Trying to estimate the density
-   i.e. predict probability of future events
Try to predict the future given the past
How can we find similar items
We can calculate correlation coefficient as an item similarity

-   Use something like Pearson, Jaccard, …
Amazon did this for “customers who bought this also bought”

-   US patent 7113917
Parallelization is hard though
Parallelization is hard though
Can speed this up using various LSH tricks

-   Twitter: Dimension Independent Similarity Computation (DISCO)
Are there other approaches?
Natural Language Processing has a lot of similar problems




…matrix factorization is one idea
Matrix factorization
Matrix factorization

-   Want to get user vectors and item vectors
-   Assume f latent factors (dimensions) for each user/item
Probabilistic Latent Semantic Analysis (PLSA)

-   Hofmann, 1999
-   Also called PLSI
PLSA, cont.




+ a bunch of constraints:
PLSA, cont.

Optimization problem: maximize log-likelihood
PLSA, cont.
Collaborative Filtering at Spotify
Collaborative Filtering at Spotify
Collaborative Filtering at Spotify
Collaborative Filtering at Spotify
“Collaborative Filtering for Implicit Feedback Datasets”

-   Hu, Koren, Volinsky (2008)
“Collaborative Filtering for Implicit Feedback Datasets”, cont.
“Collaborative Filtering for Implicit Feedback Datasets”, cont.
“Collaborative Filtering for Implicit Feedback Datasets”, cont.
“Collaborative Filtering for Implicit Feedback Datasets”, cont.
Here is another method we use
What happens each iteration




-   Assign all latent vectors small random values
-   Perform gradient ascent to optimize log-likelihood
What happens each iteration




-   Assign all latent vectors small random values
-   Perform gradient ascent to optimize log-likelihood
What happens each iteration




-   Assign all latent vectors small random values
-   Perform gradient ascent to optimize log-likelihood
Calculate derivative and do gradient ascent




-   Assign all latent vectors small random values
-   Perform gradient ascent to optimize log-likelihood
2D iteration example
Vectors are pretty nice because things are now super fast

-   User-item score is a dot product:




-   Item-item similarity score is a cosine similarity:




-   Both cases have trivial complexity in the number of factors f:
Example: item similarity as a cosine of vectors
Two dimensional example for tracks
We can rank all tracks by the user’s vector
So how do we implement this?
One iteration of a matrix factorization algorithm

“Google News personalization: scalable online collaborative filtering”
Collaborative Filtering at Spotify
So now we solved the problem of recommendations right?
Actually what we really want is to apply it to other domains
Radio

-   Artist radio: find related tracks
-   Optimize ensemble model based on skip/thumbs data
Learning from feedback is actually pretty hard
A/B testing
A/B testing
A/B testing
A/B testing
More applications!!!
Collaborative Filtering at Spotify
Collaborative Filtering at Spotify
Last but not least: we’re hiring!
Thank you
1 of 63

Recommended

Algorithmic Music Recommendations at Spotify by
Algorithmic Music Recommendations at SpotifyAlgorithmic Music Recommendations at Spotify
Algorithmic Music Recommendations at SpotifyChris Johnson
137.9K views42 slides
Music Personalization At Spotify by
Music Personalization At SpotifyMusic Personalization At Spotify
Music Personalization At SpotifyVidhya Murali
7.1K views35 slides
From Idea to Execution: Spotify's Discover Weekly by
From Idea to Execution: Spotify's Discover WeeklyFrom Idea to Execution: Spotify's Discover Weekly
From Idea to Execution: Spotify's Discover WeeklyChris Johnson
270.5K views50 slides
CF Models for Music Recommendations At Spotify by
CF Models for Music Recommendations At SpotifyCF Models for Music Recommendations At Spotify
CF Models for Music Recommendations At SpotifyVidhya Murali
1.6K views30 slides
Music Personalization : Real time Platforms. by
Music Personalization : Real time Platforms.Music Personalization : Real time Platforms.
Music Personalization : Real time Platforms.Esh Vckay
1.7K views44 slides
Music Recommendations at Scale with Spark by
Music Recommendations at Scale with SparkMusic Recommendations at Scale with Spark
Music Recommendations at Scale with SparkChris Johnson
58.6K views65 slides

More Related Content

What's hot

Music recommendations @ MLConf 2014 by
Music recommendations @ MLConf 2014Music recommendations @ MLConf 2014
Music recommendations @ MLConf 2014Erik Bernhardsson
28.6K views44 slides
Spotify Discover Weekly: The machine learning behind your music recommendations by
Spotify Discover Weekly: The machine learning behind your music recommendationsSpotify Discover Weekly: The machine learning behind your music recommendations
Spotify Discover Weekly: The machine learning behind your music recommendationsSophia Ciocca
2K views29 slides
Building Data Pipelines for Music Recommendations at Spotify by
Building Data Pipelines for Music Recommendations at SpotifyBuilding Data Pipelines for Music Recommendations at Spotify
Building Data Pipelines for Music Recommendations at SpotifyVidhya Murali
5.2K views58 slides
Interactive Recommender Systems with Netflix and Spotify by
Interactive Recommender Systems with Netflix and SpotifyInteractive Recommender Systems with Netflix and Spotify
Interactive Recommender Systems with Netflix and SpotifyChris Johnson
105K views100 slides
Recommending and Searching (Research @ Spotify) by
Recommending and Searching (Research @ Spotify)Recommending and Searching (Research @ Spotify)
Recommending and Searching (Research @ Spotify)Mounia Lalmas-Roelleke
5K views38 slides
Homepage Personalization at Spotify by
Homepage Personalization at SpotifyHomepage Personalization at Spotify
Homepage Personalization at SpotifyOguz Semerci
3.5K views26 slides

What's hot(20)

Music recommendations @ MLConf 2014 by Erik Bernhardsson
Music recommendations @ MLConf 2014Music recommendations @ MLConf 2014
Music recommendations @ MLConf 2014
Erik Bernhardsson28.6K views
Spotify Discover Weekly: The machine learning behind your music recommendations by Sophia Ciocca
Spotify Discover Weekly: The machine learning behind your music recommendationsSpotify Discover Weekly: The machine learning behind your music recommendations
Spotify Discover Weekly: The machine learning behind your music recommendations
Sophia Ciocca2K views
Building Data Pipelines for Music Recommendations at Spotify by Vidhya Murali
Building Data Pipelines for Music Recommendations at SpotifyBuilding Data Pipelines for Music Recommendations at Spotify
Building Data Pipelines for Music Recommendations at Spotify
Vidhya Murali5.2K views
Interactive Recommender Systems with Netflix and Spotify by Chris Johnson
Interactive Recommender Systems with Netflix and SpotifyInteractive Recommender Systems with Netflix and Spotify
Interactive Recommender Systems with Netflix and Spotify
Chris Johnson105K views
Homepage Personalization at Spotify by Oguz Semerci
Homepage Personalization at SpotifyHomepage Personalization at Spotify
Homepage Personalization at Spotify
Oguz Semerci3.5K views
Scala Data Pipelines for Music Recommendations by Chris Johnson
Scala Data Pipelines for Music RecommendationsScala Data Pipelines for Music Recommendations
Scala Data Pipelines for Music Recommendations
Chris Johnson163.6K views
The Evolution of Hadoop at Spotify - Through Failures and Pain by Rafał Wojdyła
The Evolution of Hadoop at Spotify - Through Failures and PainThe Evolution of Hadoop at Spotify - Through Failures and Pain
The Evolution of Hadoop at Spotify - Through Failures and Pain
Rafał Wojdyła5.5K views
Calibrated Recommendations by Harald Steck
Calibrated RecommendationsCalibrated Recommendations
Calibrated Recommendations
Harald Steck4.2K views
Machine learning @ Spotify - Madison Big Data Meetup by Andy Sloane
Machine learning @ Spotify - Madison Big Data MeetupMachine learning @ Spotify - Madison Big Data Meetup
Machine learning @ Spotify - Madison Big Data Meetup
Andy Sloane17.1K views
Big data and machine learning @ Spotify by Oscar Carlsson
Big data and machine learning @ SpotifyBig data and machine learning @ Spotify
Big data and machine learning @ Spotify
Oscar Carlsson4.1K views
Scala Data Pipelines @ Spotify by Neville Li
Scala Data Pipelines @ SpotifyScala Data Pipelines @ Spotify
Scala Data Pipelines @ Spotify
Neville Li51.4K views
Collaborative Filtering with Spark by Chris Johnson
Collaborative Filtering with SparkCollaborative Filtering with Spark
Collaborative Filtering with Spark
Chris Johnson46.7K views
Recent Trends in Personalization: A Netflix Perspective by Justin Basilico
Recent Trends in Personalization: A Netflix PerspectiveRecent Trends in Personalization: A Netflix Perspective
Recent Trends in Personalization: A Netflix Perspective
Justin Basilico30.3K views
How Apache Drives Music Recommendations At Spotify by Josh Baer
How Apache Drives Music Recommendations At SpotifyHow Apache Drives Music Recommendations At Spotify
How Apache Drives Music Recommendations At Spotify
Josh Baer5.8K views
Tutorial on Deep Learning in Recommender System, Lars summer school 2019 by Anoop Deoras
Tutorial on Deep Learning in Recommender System, Lars summer school 2019Tutorial on Deep Learning in Recommender System, Lars summer school 2019
Tutorial on Deep Learning in Recommender System, Lars summer school 2019
Anoop Deoras2.2K views
Time, Context and Causality in Recommender Systems by Yves Raimond
Time, Context and Causality in Recommender SystemsTime, Context and Causality in Recommender Systems
Time, Context and Causality in Recommender Systems
Yves Raimond5.9K views

Similar to Collaborative Filtering at Spotify

Chapter 02 collaborative recommendation by
Chapter 02   collaborative recommendationChapter 02   collaborative recommendation
Chapter 02 collaborative recommendationAravindharamanan S
115 views46 slides
Chapter 02 collaborative recommendation by
Chapter 02   collaborative recommendationChapter 02   collaborative recommendation
Chapter 02 collaborative recommendationAravindharamanan S
108 views46 slides
Summer internship 2014 report by Rishabh Misra, Thapar University by
Summer internship 2014 report by Rishabh Misra, Thapar UniversitySummer internship 2014 report by Rishabh Misra, Thapar University
Summer internship 2014 report by Rishabh Misra, Thapar UniversityRishabh Misra
355 views17 slides
Buidling large scale recommendation engine by
Buidling large scale recommendation engineBuidling large scale recommendation engine
Buidling large scale recommendation engineKeeyong Han
11.9K views27 slides
Btp 3rd Report by
Btp 3rd ReportBtp 3rd Report
Btp 3rd ReportDinesh Yadav
527 views7 slides
Recommendation System Explained by
Recommendation System ExplainedRecommendation System Explained
Recommendation System ExplainedCrossing Minds
10.7K views64 slides

Similar to Collaborative Filtering at Spotify(20)

Summer internship 2014 report by Rishabh Misra, Thapar University by Rishabh Misra
Summer internship 2014 report by Rishabh Misra, Thapar UniversitySummer internship 2014 report by Rishabh Misra, Thapar University
Summer internship 2014 report by Rishabh Misra, Thapar University
Rishabh Misra355 views
Buidling large scale recommendation engine by Keeyong Han
Buidling large scale recommendation engineBuidling large scale recommendation engine
Buidling large scale recommendation engine
Keeyong Han11.9K views
Recommendation System Explained by Crossing Minds
Recommendation System ExplainedRecommendation System Explained
Recommendation System Explained
Crossing Minds10.7K views
Models for Information Retrieval and Recommendation by Arjen de Vries
Models for Information Retrieval and RecommendationModels for Information Retrieval and Recommendation
Models for Information Retrieval and Recommendation
Arjen de Vries2.5K views
Apache Mahout Tutorial - Recommendation - 2013/2014 by Cataldo Musto
Apache Mahout Tutorial - Recommendation - 2013/2014 Apache Mahout Tutorial - Recommendation - 2013/2014
Apache Mahout Tutorial - Recommendation - 2013/2014
Cataldo Musto37.8K views
Tag And Tag Based Recommender by gu wendong
Tag And Tag Based RecommenderTag And Tag Based Recommender
Tag And Tag Based Recommender
gu wendong3.5K views
Recsys 2018 overview and highlights by Sandra Garcia
Recsys 2018 overview and highlightsRecsys 2018 overview and highlights
Recsys 2018 overview and highlights
Sandra Garcia145 views
Intelligent Search by Ted Dunning
Intelligent SearchIntelligent Search
Intelligent Search
Ted Dunning825 views
Igor Kostiuk “Как приручить музыкальную рекомендательную систему” by Dakiry
Igor Kostiuk “Как приручить музыкальную рекомендательную систему”Igor Kostiuk “Как приручить музыкальную рекомендательную систему”
Igor Kostiuk “Как приручить музыкальную рекомендательную систему”
Dakiry185 views
Collaborative Filtering Recommendation System by Milind Gokhale
Collaborative Filtering Recommendation SystemCollaborative Filtering Recommendation System
Collaborative Filtering Recommendation System
Milind Gokhale10.9K views
Item Based Collaborative Filtering Recommendation Algorithms by nextlib
Item Based Collaborative Filtering Recommendation AlgorithmsItem Based Collaborative Filtering Recommendation Algorithms
Item Based Collaborative Filtering Recommendation Algorithms
nextlib21.6K views
AI&BigData Lab 2016. Игорь Костюк: Как приручить музыкальную рекомендательную... by GeeksLab Odessa
AI&BigData Lab 2016. Игорь Костюк: Как приручить музыкальную рекомендательную...AI&BigData Lab 2016. Игорь Костюк: Как приручить музыкальную рекомендательную...
AI&BigData Lab 2016. Игорь Костюк: Как приручить музыкальную рекомендательную...
GeeksLab Odessa338 views
Recommendation Systems Roadtrip by The Real Dyl
Recommendation Systems RoadtripRecommendation Systems Roadtrip
Recommendation Systems Roadtrip
The Real Dyl187 views
Recommenders Systems by Tariq Hassan
Recommenders SystemsRecommenders Systems
Recommenders Systems
Tariq Hassan364 views

Recently uploaded

DALI Basics Course 2023 by
DALI Basics Course  2023DALI Basics Course  2023
DALI Basics Course 2023Ivory Egg
14 views12 slides
HTTP headers that make your website go faster - devs.gent November 2023 by
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023Thijs Feryn
19 views151 slides
Java Platform Approach 1.0 - Picnic Meetup by
Java Platform Approach 1.0 - Picnic MeetupJava Platform Approach 1.0 - Picnic Meetup
Java Platform Approach 1.0 - Picnic MeetupRick Ossendrijver
25 views39 slides
The details of description: Techniques, tips, and tangents on alternative tex... by
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...BookNet Canada
121 views24 slides
6g - REPORT.pdf by
6g - REPORT.pdf6g - REPORT.pdf
6g - REPORT.pdfLiveplex
9 views23 slides
Roadmap to Become Experts.pptx by
Roadmap to Become Experts.pptxRoadmap to Become Experts.pptx
Roadmap to Become Experts.pptxdscwidyatamanew
11 views45 slides

Recently uploaded(20)

DALI Basics Course 2023 by Ivory Egg
DALI Basics Course  2023DALI Basics Course  2023
DALI Basics Course 2023
Ivory Egg14 views
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn19 views
The details of description: Techniques, tips, and tangents on alternative tex... by BookNet Canada
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...
BookNet Canada121 views
6g - REPORT.pdf by Liveplex
6g - REPORT.pdf6g - REPORT.pdf
6g - REPORT.pdf
Liveplex9 views
AMAZON PRODUCT RESEARCH.pdf by JerikkLaureta
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdf
JerikkLaureta15 views
SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
Perth MeetUp November 2023 by Michael Price
Perth MeetUp November 2023 Perth MeetUp November 2023
Perth MeetUp November 2023
Michael Price15 views
Web Dev - 1 PPT.pdf by gdsczhcet
Web Dev - 1 PPT.pdfWeb Dev - 1 PPT.pdf
Web Dev - 1 PPT.pdf
gdsczhcet55 views
Case Study Copenhagen Energy and Business Central.pdf by Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana12 views
Transcript: The Details of Description Techniques tips and tangents on altern... by BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada130 views
Black and White Modern Science Presentation.pptx by maryamkhalid2916
Black and White Modern Science Presentation.pptxBlack and White Modern Science Presentation.pptx
Black and White Modern Science Presentation.pptx
maryamkhalid291614 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb12 views

Collaborative Filtering at Spotify