Sub topic 4
The Signals a Ranker Looks At
Assume you understand basic social media apps, probability as a number from 0 to 1, and short Python programs. This chapter focuses on the inputs a feed-ranking system uses to estimate whether a post is useful, interesting, or harmful for a particular person.
A ranking signal is a piece of evidence used to compare posts. A signal can describe the user, the author, the post, or the situation in which the post may be shown. Signals do not determine the result by themselves. A model combines many signals to make predictions such as the probability of a like, comment, share, or hide.
Four groups of signals
A feed system usually creates a feature set for each user-post pair. A feature is a measured value that represents one signal in a form a model can use.
| Signal group | Example features | What it can indicate |
|---|---|---|
| User | Topics followed, recent viewing history | The user's interests |
| Author | Relationship, past interactions | Whether the author matters to the user |
| Post | Media type, age, language | What the post contains |
| Context | Device, time, network, session position | Whether the moment is suitable |
The same post can receive different predictions for different users. A photo from an unfamiliar author might have a low predicted value for one person and a high value for another person who often comments on that author's posts.
User signals
User signals describe long-term preferences and recent behavior. They can include:
- Accounts, topics, or groups the user follows
- Posts the user viewed for a long time
- Recent likes, comments, shares, and saves
- Posts the user hid, muted, or reported
- Preferred languages and accessibility settings
- How often the user opens the app
Recent behavior often receives more weight than old behavior. Someone who usually reads sports posts may spend a week reading travel posts. A good system can adapt without forgetting every older preference.
However, behavior is ambiguous. A long view might mean interest, confusion, or that the user left the app open. A like might show agreement, politeness, or a habit of acknowledging friends. The model should avoid treating every action as a clear statement of preference.
Author signals
Author signals describe the relationship between the user and the account that created the post. Common examples include:
- Whether the user follows the author
- How often the user has interacted with the author
- Whether the author is a close contact
- Whether the user has hidden the author's posts
- How consistently the author receives meaningful interactions from this user
Author-level history can help distinguish a post from a close friend from a post by a rarely seen account. It can also create a risk: popular authors may keep receiving distribution simply because they were popular before. Ranking systems need tests and exploration so that less-established authors are not permanently invisible.
Post signals
Post signals describe the item itself. They may include:
- Text, topic, language, and detected entities
- Whether the post contains an image, video, link, or poll
- Post age and edit history
- Early interaction rates, adjusted for how many people saw it
- Quality, safety, spam, and duplication predictions
The system should distinguish raw counts from rates. A post with 10,000 likes may have reached millions of people. A post with 500 likes may have reached only 1,000 people. The second post could have stronger per-view performance.
Post age is also important. A fresh post may deserve a temporary boost, while an old post may still be relevant if users continue to discuss it.
Context signals
Context signals describe the current viewing situation:
- The current time and day
- The user's device and connection quality
- Whether the user is browsing quickly or reading carefully
- Which posts have already appeared in the session
- The position where the post would be inserted
Context changes what “useful” means. A long video may work well when someone is actively browsing on a fast connection but poorly during a brief mobile session. Context features must be handled carefully because they can encode sensitive information or create unfair differences between users.
Common errors
A ranker can fail when a signal is measured incorrectly or interpreted too broadly.
- Exposure bias occurs when the system learns from reactions only after it has already chosen what to show. A post cannot receive a like if it was never displayed.
- Leakage occurs when a feature contains information that would only be known after the prediction time, such as the final number of comments.
- Proxy bias occurs when an apparently neutral feature indirectly represents a protected or sensitive attribute.
- Popularity feedback occurs when showing popular posts creates more interactions, which then makes those posts look even more deserving of exposure.
A strong feature pipeline records when each value was known. Training data should represent the information available at the moment the feed decision was made.
from dataclasses import dataclass
@dataclass
class Features:
follows_author: int
user_author_comments: int
post_age_hours: float
video: int
recent_topic_match: float
session_minutes: float
def simple_interest_score(features: Features) -> float:
return (
2.0 * features.follows_author
+ 0.4 * min(features.user_author_comments, 5)
+ 1.5 * features.recent_topic_match
- 0.08 * features.post_age_hours
+ 0.2 * features.video
+ 0.1 * features.session_minutes
)
example = Features(1, 3, 2, 0, 0.8, 4)
print(round(simple_interest_score(example), 2))This score is only an illustration. Real systems learn weights from data, combine several predicted actions, and apply safety and diversity rules after scoring.
Exercise
Why can a post's raw like count be a misleading ranking signal?
Show answer
It does not account for how many people saw the post. A smaller post may have a higher like rate per view.