Chapter 2: Anatomy of a recommender system
This introduction presents the black box model of a recommender system as a way to focus on its input and output.
After this chapter you will be able to
- Recommender system black box. Explain the black box model of a recommender system, including its input, output, and purpose as an abstraction.
- Recommendation and search. Explain how a recommender system orders items and how its request differs from a search query.
- Users and flexible items. Explain what users and items mean in recommendation, including how a person can be an item.
- Producer and consumer roles. Describe the producer and consumer roles on social media and how one user can occupy both.
- Candidate Selection and Filtering. Explain how candidate generation and filtering narrow the items considered for recommendations, and why the initial reduction is needed.
- Ranking and Post-Processing. Distinguish heavy ranking from the optional post-processing step.
- Delivery and User Feedback. Describe what happens when recommendations are delivered and users' behavior is recorded.
- Candidate generation funnel. Explain why candidate generation narrows the items considered for ranking and what its resulting pool looks like.
- In-network and out-of-network candidates. Distinguish in-network from out-of-network content and explain how each can become a candidate.
- Filtering before ranking. Explain why a recommender system filters content before ranking, and describe examples of content it may remove.
- Filtering models and visibility. Explain why algorithmic filtering models are needed at scale and how their imperfections can affect visibility.
- Engagement Prediction for Ranking. Explain how heavy ranking scores the filtered candidate list using predicted probabilities of different user actions.
- Combining Action Scores. Describe how action-specific rankings are combined into one ranked list.
- Platform Values in Weights. Explain how designers' choice of engagement weights changes the ranking and expresses platform priorities.
- Feed spacing adjustments. Explain why post-processing may rearrange an engagement-ranked list before delivery, using repeated creator posts or adjacent ads as an example.
- Targeted ranking interventions. Describe how post-processing can boost or downrank particular posts without changing the more complex ranking step, using examples from the section.
- Reactions as system feedback. Explain how user reactions help platforms evaluate and develop their recommender systems.
- Ranking and consumed content. Explain why items ranked higher in a delivered feed tend to receive more attention.
- Implicit behavioral signals. Describe how interactions and dwell time act as implicit signals for future recommendations.
- Heavy ranking and scoring. Explain what heavy ranking does to a list of items.
- Interest and content matching. Explain how stated user interests and item labels can guide content-based recommendations.
- Labeling and scale limitations. Explain why detailed content labeling is difficult to scale, especially for user-generated content.
- Interaction data and signals. Distinguish explicit preference signals from implicit behavioral signals, and explain why interaction data suits large-scale recommendations.
- Collaborative filtering and interactions. Explain how collaborative filtering uses patterns among users or items to suggest recommendations, including the role of the user-item table.
- Collaborative filtering limitations. Describe the scaling and context limitations of the user-item table approach.
- Behavior as value proxy. Explain why platforms use behavioral signals to approximate recommendation value when explicit ratings are unavailable.
- Business objectives and engagement. Explain how a platform's business objective influences its optimization metric and how predicted engagement affects ranking.
- Data driven spam filtering. Explain how historical examples can be used to create a spam filter and why manually written word rules are brittle.
- Learned features in recommendations. Explain how deep learning can use platform behavior data to discover important features and their weights, and describe the reported effect on recommendations.
- Raw and derived signals. Distinguish raw ranking signals from derived signals, using examples of where they come from.
- Toxicity score in ranking. Explain how a separately trained toxicity model can provide a derived signal for ranking content.
- Signal dependency graphs. Explain why derived scores can make ranking dependencies difficult to trace.
- Platforms Beyond Single Recommenders. Explain why a platform’s impact and content amplification cannot be understood through a single recommender or isolated user action alone.
- Content Presentation and Experience. Describe how platform design concerns the presentation of content as well as the behind-the-scenes systems that make it available, using search as an example.
- Embeddings and recommendation distance. Explain how stored user and item embeddings are used to select recommendations when a user refreshes their feed.
- Embedding dimensions and nuance. Explain why two embedding dimensions can distinguish preferences that a single number obscures, using the cat-and-dog example.
- Learned and opaque representations. Describe how embeddings arise from a trained model and why their individual numbers are not generally human-readable.
What it builds on
- RecSys in social media (chapter 1) · The different models for recommending social media content.
Section by section
Introduction
This introduction presents the black box model of a recommender system as a way to focus on its input and output.
- Recommender system black box: Explain the black box model of a recommender system, including its input, output, and purpose as an abstraction.
Why it matters: This model lets you discuss what a recommender system does before examining how it does it.
Key terms: black box model, ranked list, recommendations
2.1 The user-and-item world
This section explains recommendation as ordering predefined items for users and distinguishes it from search, generative AI, and the producer and consumer roles users can play.
- Recommendation and search: Explain how a recommender system orders items and how its request differs from a search query.
Why it matters: This distinction clarifies what a recommendation is trying to do when you open a feed. - Predefined lists and fabrications: Distinguish the predefined lists used by recommendation and search from the lists a generative AI assistant might produce.
Why it matters: The distinction helps you understand the kind of material a recommender works with. - Users and flexible items: Explain what users and items mean in recommendation, including how a person can be an item.
Why it matters: These flexible roles let the same basic recommendation problem apply to many kinds of platform. - Producer and consumer roles: Describe the producer and consumer roles on social media and how one user can occupy both.
Why it matters: Seeing both roles helps distinguish the experience of making content from that of receiving it.
Key terms: recommender system, pre-specified metric, explicit query, implicit query, predetermined list of items, list-shuffling systems, fabrications, generative AI, user, item
2.2 Parts of a RecSys
This section outlines the interconnected phases that produce recommendations and record user feedback.
- Candidate Selection and Filtering: Explain how candidate generation and filtering narrow the items considered for recommendations, and why the initial reduction is needed.
Why it matters: These stages make a large collection manageable while removing unsuitable candidates. - Ranking and Post-Processing: Distinguish heavy ranking from the optional post-processing step.
Why it matters: These stages determine the ordering of the recommendations a user receives. - Delivery and User Feedback: Describe what happens when recommendations are delivered and users' behavior is recorded.
Why it matters: Delivery and recording connect the recommendations users receive with feedback to the system.
Key terms: candidate generation, filtering, ranking, heavy ranking, post-processing, predicted value, delivering, recording users’ behavior, feedback loop
2.2.1 Candidate generation
This section explains how candidate generation selects a manageable pool of potentially relevant content for later ranking.
- Candidate generation funnel: Explain why candidate generation narrows the items considered for ranking and what its resulting pool looks like.
Why it matters: This first selection both makes ranking practical and limits what can reach the feed. - In-network and out-of-network candidates: Distinguish in-network from out-of-network content and explain how each can become a candidate.
Why it matters: This distinction shows how an algorithmic feed can reach beyond a reader's direct connections. - Trending content feedback: Explain why trending content can become a candidate and how its exposure can reinforce popularity.
Why it matters: Popular content can gain further exposure through a self-reinforcing cycle. - Promoted content candidates: Describe how platforms select candidate ads and how those candidates relate to organic content.
Why it matters: Promoted content is another source of candidates, selected with the reader's likely interests in mind.
Key terms: candidate generation, funnel, ranking, in-network, out-of-network, Algorithmic model, Network and Subscription models, trending, feedback loop, ads
2.2.2 Filtering
This section explains how filtering removes unsuitable content before ranking and how imperfect filtering models influence what users see.
- Filtering before ranking: Explain why a recommender system filters content before ranking, and describe examples of content it may remove.
Why it matters: Filtering avoids spending ranking effort on content that should not reach the user. - Filtering models and visibility: Explain why algorithmic filtering models are needed at scale and how their imperfections can affect visibility.
Why it matters: The tools needed to manage content at scale also influence whose content reaches users.
Key terms: filtering, ranking, soft-block, terms of service, Not Safe For Work, NSFW, algorithmic models, biased
2.2.3 Heavy ranking
This section explains how heavy ranking predicts different kinds of engagement and combines them using weights that reflect platform priorities.
- Engagement Prediction for Ranking: Explain how heavy ranking scores the filtered candidate list using predicted probabilities of different user actions.
Why it matters: Separate predictions let a platform distinguish content a user may like from content they may reply to. - Combining Action Scores: Describe how action-specific rankings are combined into one ranked list.
Why it matters: The platform needs one order for delivery even when it predicts several kinds of interaction. - Platform Values in Weights: Explain how designers' choice of engagement weights changes the ranking and expresses platform priorities.
Why it matters: Ranking weights turn platform priorities into choices about what people see.
Key terms: heavy ranking, probability of engagement, Like model, Reply model, rankings, score, coefficient, weight, weights, value model
2.2.4 Post processing
This section explains how post-processing adjusts an already ranked feed before delivery, from spacing content to boosting or downranking particular posts.
- Feed spacing adjustments: Explain why post-processing may rearrange an engagement-ranked list before delivery, using repeated creator posts or adjacent ads as an example.
Why it matters: A good score for each individual item does not guarantee a good sequence for the reader. - Targeted ranking interventions: Describe how post-processing can boost or downrank particular posts without changing the more complex ranking step, using examples from the section.
Why it matters: These adjustments show how platform choices can make particular content more or less visible.
Key terms: post-processing, ranked list, intersperse, boosting, ranking score, downrank, shadowbanning
2.2.5 Delivering and recording
This section explains how delivered recommendations receive attention and how users’ reactions are recorded and used to improve recommender systems.
- Reactions as system feedback: Explain how user reactions help platforms evaluate and develop their recommender systems.
Why it matters: User reactions provide feedback for both judging and updating recommendations. - Ranking and consumed content: Explain why items ranked higher in a delivered feed tend to receive more attention.
Why it matters: Where an item appears affects its opportunity to be seen. - Implicit behavioral signals: Describe how interactions and dwell time act as implicit signals for future recommendations.
Why it matters: Even lingering on content can influence what the system recommends next.
Key terms: users’ reactions, training data, iteration, ranked higher, attention, single session, implicitly learn, interacted with, dwelled on, successful recommendation
2.3 Heavy ranking revisited: Training a RecSys
This section revisits heavy ranking and frames recommender-system training through a library book recommendation example.
- Heavy ranking and scoring: Explain what heavy ranking does to a list of items.
Why it matters: This identifies the ranking step’s role without assuming how its scores are produced. - Library recommendation example: Describe the users, items, and recommendation basis in the library example.
Why it matters: The example makes the users, items, and purpose of a recommendation concrete.
Key terms: heavy ranking, scoring, users, items, recommendations
2.3.1 Heuristics
This section explains an interest-and-label-based recommendation approach and its limitations for large collections, user-generated content, and users’ reading histories.
- Interest and content matching: Explain how stated user interests and item labels can guide content-based recommendations.
Why it matters: This shows how a recommender can use explicit interests and item descriptions to make suggestions. - Labeling and scale limitations: Explain why detailed content labeling is difficult to scale, especially for user-generated content.
Why it matters: The availability and consistency of labels limit where this recommendation approach can work at scale. - Reading history blind spot: Describe what the approach misses about a user’s past reading and why gathering that information through questions is burdensome.
Why it matters: Stated interests alone leave out potentially useful information about a reader’s past experiences.
Key terms: content-based approach, labeling, interests, user-generated content, publishers, gatekeepers, previously read item, questionnaire
2.3.2 Data-driven approaches
This section explains how recommender systems use interaction data, collaborative filtering, and optimization metrics to produce and rank recommendations.
- Interaction data and signals: Distinguish explicit preference signals from implicit behavioral signals, and explain why interaction data suits large-scale recommendations.
Why it matters: The signals a platform collects are the raw material for data-driven recommendations. - Collaborative filtering and interactions: Explain how collaborative filtering uses patterns among users or items to suggest recommendations, including the role of the user-item table.
Why it matters: Collaborative filtering shows how behavior alone can connect users to new items. - Collaborative filtering limitations: Describe the scaling and context limitations of the user-item table approach.
Why it matters: These limitations explain why a useful early approach became harder to apply as platforms grew. - Training optimization metrics: Explain why a training metric matters and illustrate equivalent optimization directions using digit-recognition accuracy and error.
Why it matters: The metric defines what improvement means during training. - Behavior as value proxy: Explain why platforms use behavioral signals to approximate recommendation value when explicit ratings are unavailable.
Why it matters: An observable action can stand in for value when platforms cannot directly obtain a rating. - Business objectives and engagement: Explain how a platform's business objective influences its optimization metric and how predicted engagement affects ranking.
Why it matters: The engagement a platform chooses to predict can shape what users see.
Key terms: explicit interactions, implicit signals, machine learning, collaborative filtering, user-item matrix, metadata, metric, success rate, error rate, value
2.4 How to train a machine learning model
This section explains how machine learning uses existing data to discover patterns, using spam filtering and recommendations as examples, and notes its lack of transparency.
- Data driven spam filtering: Explain how historical examples can be used to create a spam filter and why manually written word rules are brittle.
Why it matters: The spam example shows why learning from data can be preferable to writing rules by hand. - Learned features in recommendations: Explain how deep learning can use platform behavior data to discover important features and their weights, and describe the reported effect on recommendations.
Why it matters: This connects learning from data to how platforms improved recommendations without manually identifying every useful pattern. - Machine learning transparency limits: Describe the transparency drawback of the technology discussed in the section.
Why it matters: It highlights a limitation alongside the reported benefits of data-driven recommendations.
Key terms: machine learning, sample data, spam, deep learning, behavioral data, features, weight, transparency
2.5 Raw and derived scores
This section explains raw and derived ranking signals, how models combine and reuse them, and why their dependencies complicate AI governance.
- Raw and derived signals: Distinguish raw ranking signals from derived signals, using examples of where they come from.
Why it matters: This distinction shows what information ranking models can use and how some inputs are built from others. - Toxicity score in ranking: Explain how a separately trained toxicity model can provide a derived signal for ranking content.
Why it matters: The toxicity example makes clear how one model's output can influence another model's ranking. - Signal dependency graphs: Explain why derived scores can make ranking dependencies difficult to trace.
Why it matters: A ranking decision may depend on a web of shared and layered inputs rather than a single straightforward score. - Signal governance difficulties: Explain how organizational separation and independent updates make AI system governance difficult.
Why it matters: Understanding the organizational side helps explain why governing interconnected AI components is difficult.
Key terms: signals, features, raw signals, derived signals, toxic score, derived signal, ranking, derived scores, raw features, dependency graph
2.6 Platforms’ design and amplification
This section explains how platform design and multiple interacting features contribute to users’ experiences and content amplification beyond a single recommender system.
- Platforms Beyond Single Recommenders: Explain why a platform’s impact and content amplification cannot be understood through a single recommender or isolated user action alone.
Why it matters: It helps you see amplification as a product of the broader platform, not just one recommendation engine. - Content Presentation and Experience: Describe how platform design concerns the presentation of content as well as the behind-the-scenes systems that make it available, using search as an example.
Why it matters: It shows why the visible presentation of content matters alongside the invisible recommendation machinery.
Key terms: platforms, recommender, amplification of content, platform design, search functionality, content presentation
2.7 What happens when you refresh your feed
This section explains how embeddings represent users and content and how their distances help generate fast, personalized recommendations.
- Embeddings and recommendation distance: Explain how stored user and item embeddings are used to select recommendations when a user refreshes their feed.
Why it matters: This connects the numerical representations to what appears in a refreshed feed. - Embedding dimensions and nuance: Explain why two embedding dimensions can distinguish preferences that a single number obscures, using the cat-and-dog example.
Why it matters: The example shows why a richer representation can make more useful distinctions between users. - Embedding size tradeoff: Explain how engineers balance the information captured by embeddings against the costs of larger dimensions.
Why it matters: Embedding size affects both the richness of recommendations and the resources needed to deliver them. - Learned and opaque representations: Describe how embeddings arise from a trained model and why their individual numbers are not generally human-readable.
Why it matters: This distinguishes the illustrative cat-and-dog dimensions from embeddings learned by real models. - Speed and matching precision: Explain why a platform may use a fast but less precise search for nearby item embeddings.
Why it matters: This explains why a practical feed may favor speed over finding every best match.
Key terms: embeddings, vectors, distance, similarity, embedding dimension, cat affinity, dog affinity, embedding dimensions, memory, performance
2.8 Summary
Where this is used later
- Labeling (chapter 4) · Labeling content and users builds on distinguishing the entities involved in recommendation.
- Producer side amplification (chapter 5) · Producer-side amplification concerns the perspective of those creating content.
- Reader-side amplification: Feed analysis (chapter 5) · Reader-side amplification concerns the perspective of those consuming content.
- Feedback loops in recommender systems and social media (chapter 4) · Examines feedback loops in recommender systems and social media.
- Out-of-Network content (chapter 8) · Out-of-network content builds on the distinction between followed and unfollowed producers.
- Promoted content (chapter 6) · Promoted content builds on the role of paid posts in recommendations.
- Decisions and consequences (chapter 3) · Filtering can remove an item before ranking.
- The use of automation in content moderation (chapter 3) · Automated content moderation builds on the need to handle large amounts of content.
Concepts explained in this chapter
- deep learningA machine learning approach that uses multilayered neural networks to learn hierarchical representations from data.
- machine learningA computational approach in which models use data and interactions to learn patterns for generating predictions or recommendations.
- embeddingA learned numerical representation that maps a user, item, or other complex entity to a vector while preserving information relevant to a task.
- embedding distanceA distance calculated between embedding vectors to quantify how close their represented entities are in the embedding space.
- recommender systemA computational system that selects, ranks, or presents items to users based on inferred preferences or other criteria.
- accuracyThe proportion of predictions that are correct among all predictions made by a system.
- collaborative filteringA recommendation technique that infers preferences from the preferences or behaviors of users or items with similar interaction patterns.
- data-driven approachA computational approach that derives decisions or predictions from collected data rather than manually specified rules.
- error rateThe proportion of predictions that are incorrect among all predictions made by a system.
- explicit interactionA user action that directly communicates interest or preference, such as rating, liking, or disliking an item.
- implicit feedbackA user interaction inferred from behavior or non-explicit activity rather than directly stated as a preference.
- user-item interaction tableA tabular representation whose rows are items, columns are users, and cells record interactions between them.
- candidate sourcingA recommender-system stage that selects a relatively small set of potentially relevant items from a larger item collection.
- AI modelA learned computational representation that maps input data to predictions, classifications, or other outputs.
- out-of-network contentContent produced by users or sources that a reader does not directly follow.
- rerankingAn optional recommendation-system stage that adjusts an already ranked item list before results are delivered.
- data annotationThe process of assigning descriptive or evaluative labels to content so that it can be identified, classified, or analyzed.
- amplificationAn increase in the visibility, reach, or influence of information or viewpoints through a communication or distribution process.
- feedback loopA cyclic process in which a system's outputs influence subsequent inputs, causing later outputs to be shaped by earlier ones.
- rank orderAn ordering of items according to their relative position or assessed importance.
- recommendationA content or item suggestion generated by a recommender system for a particular user.
- in-network contentSocial-media content originating from users whom a reader explicitly follows, including content they reshare.
- promoted contentPaid content distributed by a platform to increase the reach or prominence of an otherwise regular post.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
