Exploring Collaborative Filtering Applications
Background
In this blog post, I’ll work through the following prompt from the “Further Research” section at the end of Chapter 8 (Collaborative Filtering):
Find three other areas where collaborative filtering is being used, and identify the pros and cons of this approach in those areas.
I initially prompted Claude to brainstorm some ideas and got the following response:
- Social media content curation
- Method: Analyzes user interactions to recommend posts, articles, or accounts.
- Example: Facebook’s News Feed algorithm.
- Pros: Personalized content, increased engagement.
- Cons: Echo chambers, potential bias amplification.
- Job recruitment
- Method: Matches candidates to jobs based on similar profiles and preferences.
- Example: LinkedIn’s job recommendation system.
- Pros: Efficient candidate discovery, better job fit.
- Cons: May overlook unique candidates, potential for discrimination.
- Online dating
- Method: Suggests matches based on user preferences and behaviors.
- Example: Tinder’s match suggestions.
- Pros: Saves time, introduces compatible matches.
- Cons: May reinforce stereotypes, limits serendipitous encounters.
Those are all good examples and I think illustrate how collaborative filtering is used. I’ll do some further research (no pun intended) for each one.
Job Recruitment
I had much better luck finding more recent explicit references to collaborative filtering for LinkedIn’s recommendation systems. In this article written by LinkedIn’s Machine Learning Engineering Manager, she describes how collaborative filtering is used in their offline recommendation engine (italicized emphasis mine):
Collaborative Filtering: Collaborative filtering is a method of making automatic predictions (filtering) about the interests of a user by collecting preferences from many users (collaborating). In our framework, this model leverages past implicit engagement data of learners (i.e., course watches) to identify relevant courses. We learn a latent representation for each learner and each course and use similarities between these latent representations to predict member-course relevance.
The predictions from their collaborative filtering model are “blended” online (in realtime) with predictions from a classifier trained on “historical explicit engagement” of users with course materials. She lists the advantages of collaborative filtering as:
- the ability to capture recent interests by focusing on recent interactions.
- diversified recommendations, since they are based on similarity in course watch behavior, rather than the content of the courses.
- relying solely on engagement data, mitigating the need for domain knowledge.
Their collaborative filtering system relies on “members’ course-watching behavior for signals” with the downside that it has “relatively poor performance when recommending courses for new learners.”
Online Dating
This Vox article led me to this Wired story about Monster Match, a game funded by Mozilla with the intent to show “how dating app algorithms reinforce bias.” The game simulates a dating app where you swipe on different monsters to indicate that you want to “date” them and intermittently the game pauses to illustrate how your choices have affected the algorithm. For example, after swiping on a few profiles:
The algorithm had already removed half of Monster Match profiles from my queue—on Tinder, that would be the equivalent of nearly 4 million profiles. It also updated that queue to reflect early “preferences,” using simple heuristics about what I did or didn’t like. Swipe left on a googley-eyed dragon? I’d be less likely to see dragons in the future.
The mention that “When you first log in, your recommendations are almost entirely dependent on what other users think.” such that:
if you swipe right on a zombie and left on a vampire, then a new user who also swipes yes on a zombie won’t see the vampire in their queue.
The consequence (and downside) of this behavior is that “dating app users get boxed into narrow assumptions and certain profiles are routinely excluded.”
The article also connects this behavior to dating apps in real life, referencing a study which shows that on OKCupid, “black women receive the fewest messages of any demographic on the platform.” These apps allow for filtering by race, conducing behaviors which “reinforce racial inequalities in the real world”.
Predicting Sensor Array Values
I wanted to find an application of collaborative filtering that was more niche than product/profile/post recommendation systems so I googled around a bit and found the paper Collaborative Filtering to Predict Sensor Array Values in Large IoT Networks. In this fascinating work, they draw analogies between recommending products based on sparse user preference data (users don’t provide explicit feedback often) and predicting blanks in sparse sensor data (failed readings due to malfunction, extreme weather, network quality and other reasons) as both involve a correlation between the subject of interest (users or sensors):
The key idea of our proposal is that, fortunately, sensor array results are not completely independent from each other; e.g., readings from sensors under high environmental temperature in some area in China can help to predict readings of some other sensors that have reported failures in a high temperature area from Nevada; it can be done when a correlation in the sensor values of both areas occurs. This is precisely what CF RS are trained for: they predict item’s values that the users have not voted yet based on the rating values of the rest of the RS users.
They use PMF (Probabilistic Matrix Factorization) which, based on my understanding of their explanation, seems very similar (if not exactly the same) as the latent factor and dot-product prediction approach used in Chapter 8 of the fastai textbook—-in short, you generate random embeddings (or tensors) of size U (users) x N (latent factors) for users and I (items) x N (latent factors) for the items (like movies, songs, or products) and take the dot product of U and I to get the predicted ratings (or preference scores). Using gradient descent to minimize Root Mean Squared Error as a loss function, the model learns these latent factors and gets better at predicting a rating of an item by a user who has not explicitly rated the item (i.e. it gets better at predicting blank ratings).
In the paper they find that collaborative filtering (matrix factorization) works better for sparse sensor data, and KNN (K-Nearest Neighbor) works better with denser sensor data.
Final Thoughts
I always end up learning more than I expected to after working through these simple, short but open-ended “Further Research” prompts. The world of recommendation systems is way more interesting than I had imagined. I suppose I didn’t realize the importance of the systems part in “recommendation systems”—there are truly fascinating and complex AI systems being researched, built and deployed in this space and even a cursory review of some of the publications was really enjoyable. I look forward to revisit this topic in the future with a deeper dive.
I hope you enjoyed this blog post! Follow me on Twitter @vishal_learner.
Social Media Content Curation
I found this article which talks about Facebook’s News Feed algorithm at a high level but doesn’t mention collaborative filtering explicitly. This Meta AI blog mentions a lot of interesting tech, including the phrase “recommendation systems” but doesn’t mention collaborative filtering (I’m assuming not all recsys involve collaborative filtering).
I instead found a lot more content online explicitly mentioning collaborative filtering for music recommendation systems, specifically this paper from 2014 by Spotify in which they introduce Logistic Matrix Factorization “a new probabilistic model for matrix factorization with implicit feedback.” The motivation for using implicit feedback is that:
They “assume that we have a set of non-negative feedback values associated with each pair of users and items in our domain” and that “we don’t require the values to be integers but instead allow them to be any non-negative reals.”
The key contribution of this paper is to frame the probability of a user preferring an item as:
\[p(l_{ui}|x_u, y_i, \beta_i, \beta_j) = \frac{\exp(x_i y_i^T + \beta_u + \beta_i)}{1+\exp(x_u y_i^T + \beta_u + \beta_i)}\]
Where:
\(l_{ui}\) is the event that user \(u\) has chosen to interact with item \(i\)
\(x_u\) is the user data
\(y_i\) is the item data and
the \(\beta\)s are the biases.
And then learn \(X\), \(Y\) and \(\beta\) that maximizes:
\[\arg \max X,Y, \beta\log p(X,Y,\beta|R)\]
The metric they use is Mean Percentage Ranking “that evaluates a user’s satisfaction with an ordered list of recommended items.”
They find that Logistic MF beats a competing model (Implicit Matrix Factorization, IMF, which minimizes a weighted root mean squared error over the training data of binary preferences) and the performance of the models don’t improve beyond 100 latent factors.
While they don’t discuss limitations or downsides of this algorithm, as a Spotify user I have found their recommendations underwhelming. Of course their algorithms have changed since 2014 (the current Spotify Research page has publications on Reinforcement Learning, Graph-based Inductive Representations, and RNNs) and I am a “repeat listener” even by Spotify’s standards, so I use it more like a music player (like Winamp!) than for music discovery.