Reading Notes on Practical Recommendation Systems
Notes from a book I took a long time to finish.
Translated from Chinese with AI · Read the original
A book I took a long time to finish.
Preface
My background is data engineering, mostly distributed computation engines, and I know relatively little about business domains, especially recommendation algorithms and engineering. I learned a great deal from this book. Many reviews on Zhihu and Douban call it too basic and say its references are the most useful part. For my extracurricular reading, however, it was enough.
Both its business and technical material helped me. Here is the outline:
(1) Good recommendation systems: Applications and evaluation across scenarios. (2) Using user behavior: Algorithms derived from behavioral data. (3) Cold starts: Information available for recommending to new users. (4) Using tags: Familiar profile-based recommendations. (5) Using context: Time, location, and related information. (6) Using social networks: Recommendations based on relationships. (7) A practical system: Engineering architecture. (8) Rating prediction: More theoretical and academic; I have not studied this deeply yet.
A Good Recommendation System
In an age of information overload, recommendation systems connect users with information.
They find information a user may like in an enormous collection and deliver it. This raises several questions:
- How do we identify a user’s interests?
- How do we store so much information and efficiently retrieve it by interest?
- How should recommendations be delivered and presented?
In engineering terms:
- How do we find features?
- How should storage be designed?
- What is the product format, and how explainable are recommendations?
Later chapters offer different answers. To me, finding features is central and requires strong engineering judgment and business sensitivity. As author Xiang Liang often says on Zhihu, understanding the business is an algorithm practitioner’s most important skill.
A good system can be assessed through:
- Precision and recall: Standard recommendation metrics, omitted here.
- Popularity: Can use the logarithm of item frequency. Higher popularity means recommendations favor popular items.
- Coverage: The fraction of all items recommended to users. At 100%, every item has been recommended at least once. An inverse-popularity factor can make this more informative.
Using User Behavior
User-Based Collaborative Filtering
Two main steps:
(1) Find users with interests similar to the target user’s. (2) Recommend items those users like that the target user has not encountered.
The key is calculating similarity between users’ interests.

- N(u) is the set of items purchased by user u.
Popular purchases can falsely suggest shared interests. We therefore include item popularity and reduce the weight of common items. The number of users buying x represents its popularity, with the inverse used as a weight. Since popularity has a long tail, a logarithm makes the distribution more even.

Item-Based Collaborative Filtering
Two main steps:
(1) Calculate item similarity. (2) Use the user’s history to recommend previously unseen items.

- N(i) is the set of users who purchased item i.
Similarly, unusually active users should contribute less weight. A user’s purchase count can represent their activity.
Graph-Based Models
Represent user u purchasing item i as the pair (u,i), forming an undirected graph that connects relationships among users and items.

To recommend to user A, start random walks at A with probability x. More distant items are less likely to be visited. Repeated trials estimate visitation probabilities, which can be ranked for recommendations.
- Formulating this as a matrix problem can produce results more quickly.
Cold Starts
This chapter is more business-oriented. There are three cold-start types:
- User cold start: For newly registered users, use registration information or ask them to choose interest tags, as many apps do, then recommend popular items under those tags.
- Item cold start: Randomly expose new items to some users, gathering enough behavior to assign tags and attributes. Articles and videos also often receive human-review labels, which can inform recommendations.
- System cold start: A new website or product has both new users and new items, combining the two problems above.
Using User Tags
This mainly concerns user-generated tags, like those added to Stack Overflow questions. Users label content to support later recommendations. So far, we have covered two main approaches:
- Recommend similar items based on user history.
- Find users with similar interests and recommend what they like.
Tags serve as item features, enabling recommendations of other items sharing features with those a user liked. Two questions arise:
- Why do users tag content?
- What tags should they use?
Why Tag Content?
Tags describe content features. NLP and image analysis can also extract features, but may miss the creator’s intended meaning. A flower photograph can mean different things on different holidays, leading to different user tags.
With these features, content can be organized and classified to improve recommendations.
What Tags Should Users Use?
Allowing arbitrary tags without processing leads to a growing, messy vocabulary. NLP techniques may be needed to handle synonyms and stop words.
Once items have tags, user u’s interest in item i can be expressed as:

n(u,b) counts how often user u applies tag b; n(b,i) counts how often item i receives tag b. Popular-item effects can be reduced as above. Normalizing further gives:

Probability that user u likes item i = probability that item i receives tag b * probability that user u applies tag b.
Using Social Networks
Social networks include interest graphs and social graphs, though products increasingly combine them. They reveal relationships between people: closer relationships may imply more similar tastes.
Represent users as nodes and relationships as directed or undirected edges. Let out(u) be u’s friends or followed users. User u’s interest in item i is:

This counts friends interested in i. We can weight friendships by familiarity, estimated through the proportion of mutual friends:

A Practical Recommendation System
Real systems use more than one algorithm. How can they be combined? The three approaches above can be abstracted as:

This suggests a feature-based architecture. When a user arrives, generate multiple features, retrieve relevant items for each, and build a recommendation list. The core task divides into:
- Generating features for users.
- Finding items from features.
Treat each feature-processing method as a pluggable recommendation engine. Filter and rank results from all engines to produce final recommendations.

The architecture of an individual engine:

The overall structure is now clear. Pay particular attention to:
- Behavior-type weights: Purchases should weigh more than views.
- Time weights: Recent behavior usually matters more.
- Behavior frequency.
- Popularity.
Summary

Above all, remember this diagram.