Recommender systems: collaborative filtering, content signals, ranking

Updated

Recommender systems are machine learning applications that suggest items to users. They work in stages: candidate generation, scoring, and re-ranking. Collaborative filtering uses user and item similarities, while content and context filtering rely on item attributes and situational data.

How recommender systems work

A recommender system is an artificial intelligence application that suggests items such as movies, products, or songs to a user. According to IBM's overview of recommendation engines, these systems rely on analytics and machine learning to detect patterns in user behavior data. The engine can suggest the next video to watch, a similar song to listen to, or a product that complements a previous order.

A recommendation pipeline typically has three stages. Google's Recommendation Systems course identifies candidate generation, scoring, and re-ranking as the core components. The course also states that embeddings represent items and queries in a common space.

The system begins by collecting data. Explicit data includes ratings and reviews, while implicit data comes from clicks, browsing, and purchases. The data is stored and analyzed to find correlations, then filtered to produce a shortlist of items. This process is often iterative and refined over time.

Collaborative filtering

Collaborative filtering uses similarities between users and items simultaneously. Google's collaborative filtering basics explain that this method allows serendipitous recommendations, meaning a system can suggest an item based on what a similar user liked. The embeddings are learned automatically, without manual feature engineering.

In this approach, users and items are placed in a shared embedding space. The dot product of a user embedding and an item embedding predicts the user's likely interest. Training adjusts the embeddings to bring preferred items closer to the user.

Collaborative filtering can handle explicit ratings or implicit signals such as watching a video. The model learns from the feedback matrix and can infer preferences for items the user has not encountered.

Content and context filtering

Content filtering recommends items based on their attributes. NVIDIA's glossary on recommendation systems notes that this method compares item features such as genre or cast to the user's preferences. Context filtering adds situational data like device, time, or location to the prediction.

For example, a content-based recommender might suggest a movie with the same actors as one the user enjoyed. Context-aware systems can tailor suggestions to the current environment, such as recommending a news article based on the user's location.

Hybrid systems combine multiple approaches. By merging collaborative and content signals, they aim to reduce the cold start problem that affects new users or items without much history.

Candidate generation and ranking

Candidate generation is the first stage of a recommender, producing a set of relevant items. Google's candidate generation overview describes content-based and collaborative filtering as the two main approaches. Both map queries and items to an embedding space where a similarity measure determines closeness.

The choice of similarity measure influences the ranking. Dot product favors items with large embedding norms, which often correspond to popular items. Cosine similarity focuses on the angle and favors items with high semantic similarity. Euclidean distance prioritizes items that are physically closest in the embedding space.

After candidate generation, a scoring model assigns a relevance score to each candidate. Re-ranking then adjusts the final order based on additional constraints, such as diversity or business rules.

Model architectures and research

Early recommender systems often used matrix factorization. The paper on wide and deep learning presents a joint model that combines linear models with deep neural networks. This approach balances memorization of feature interactions with generalization to unseen combinations, and the authors report that it increased app acquisitions on Google Play compared to wide-only and deep-only models.

Neural collaborative filtering is another direction. An arXiv paper by He and others proposes a framework that replaces the inner product with a neural architecture. The authors use a multi-layer perceptron to model the user-item interaction, and experiments show that deeper layers improve performance.

Phases of a recommendation engineStep 1: Data gathering; Step 2: Storage; Step 3: Analysis; Step 4: Filtering; Step 5: RefiningPhases of a recommendation engineData gatheringStorageAnalysisFilteringRefining
Phases of a recommendation engine
Similarity measures for candidate generation
MeasureDefinitionBias
cosineCosine of the angle between two vectorsFavors items with high semantic similarity
dot productSum of the products of the vector componentsFavors items with large norms, often popular ones
Euclidean distanceThe usual distance in Euclidean spaceFavors items physically closest to the query

Frequently asked questions

What is collaborative filtering?

Collaborative filtering uses similarities between users and items to suggest items. It learns embeddings that map users and items into a shared space, allowing the model to recommend items based on the preferences of similar users.

What is the cold start problem?

The cold start problem occurs when a recommender has little data about a new user or item. Collaborative filtering suffers from this because it relies on historical interactions.

How do content and context filtering differ?

Content filtering uses item attributes like genre or cast, while context filtering adds situational data such as device, time, or location to personalize recommendations.

What is a hybrid recommender?

A hybrid recommender combines collaborative, content, and sometimes context filtering to mitigate the weaknesses of each approach, such as the cold start problem.

What are embeddings in recommender systems?

Embeddings are low-dimensional vectors that represent users and items in a shared space. Similar items are placed closer together, and the dot product of user and item embeddings indicates preference.