Feed Real-Time Ad Re-Ranking on Engagement Events
Built an event-driven ad re-ranking system at Meta that triggers fresh ranking on Share, Image Tap, and Video Tap signals to improve next-slot ad relevance.
Feed Eager Refresh
Company: Meta
Surface: Instagram Feed
Role: Android Software Engineer
Impact Area: Ad Relevance, Engagement-Signal-Driven Monetization
The Problem
Standard ad delivery in a content feed operates on a periodic refresh cycle. The client requests a batch of ranked ads, serves them in sequence as the user scrolls, and refreshes the batch at a fixed interval or when the content buffer approaches depletion. This model is reliable and efficient for steady-state delivery, but it is architecturally blind to something important: high-signal user engagement events that occur between refresh cycles.
When a user shares an ad, they found it valuable enough to send to someone else. When they tap into an image in an ad, they are examining the visual content with active curiosity. When they tap a video in an ad, they are choosing to engage more deeply with the creative. These are not passive scroll-past events. They are explicit, high-confidence engagement signals that the user is paying attention and receptive.
In the standard periodic model, the response to these signals is identical to the response to a passive scroll-past: serve the next pre-queued ad from the batch that was ranked minutes ago, with no awareness that the engagement event just changed the context.
That is a relevance miss at exactly the moment when relevance matters most.
The Three Trigger Events
I selected Share, Image Tap, and Video Tap as the three event types for Feed Eager Refresh based on their signal quality:
Share is the strongest engagement signal available on the Feed. It requires deliberate action, intention, and a specific target recipient. A user who shares an ad has processed it, evaluated it, and decided it is worth passing on. This is revealed preference at its clearest.
Image Tap indicates that the user paused their scroll to examine the visual content of the ad. They moved from passive consumption to active inspection. The ad captured enough attention to motivate a secondary action beyond the initial view.
Video Tap indicates that the user chose to engage with video content within the ad unit rather than passively letting it autoplay or scroll past. Intent to consume deeper content is a meaningful engagement elevation.
All three events share a common characteristic: they happen after the user has already processed the ad to some degree. The window immediately following these events is when ad relevance has the highest chance of converting engagement into further action.
How It Works
When any of the three trigger events fires on an ad unit in the Feed, the system:
-
Applies a debounce check to prevent duplicate triggers from a single multi-step interaction sequence (for example, a user tapping into an image and then tapping again within a short window).
-
Builds a fresh ad request with the interaction event type attached as an explicit signal in the request context.
-
Sends the request to the ad ranking server with an eager refresh priority flag.
-
On receiving the fresh ranked result, replaces the next queued ad in the feed injection queue with the fresh result.
-
Discards the displaced queued ad cleanly: it is removed from the queue, its pre-fetched resources are released, and it is not rescheduled for a later slot.
The entire cycle completes before the user finishes their current interaction with the triggering ad, meaning the next ad they encounter is already re-ranked and ready.
The Debounce Design
Debouncing was a critical engineering consideration. Without it, a user who interacts with multiple elements within a single ad (for example, tapping a video and then sharing the ad within seconds) would fire multiple ranking requests in rapid succession, each attempting to replace the same next slot.
I implemented a debounce window controlled via remote config, with a conservative default value that prevents duplicate triggers from the same interaction sequence. Only the first eligible event within the debounce window fires a refresh request. Subsequent events within the window are suppressed.
The debounce duration is remote-config-controlled because the right value depends on typical interaction duration patterns, which can vary by surface and by user behavior cohort. Remote config allows tuning without a code deploy.
Ranking Signal Integration
The eager refresh request carries the interaction event type as an explicit feature in the ranking signal sent to the server ranker. The ranker treats this signal as a revealed preference indicator, boosting ad categories and content types related to the interacted ad in the fresh ranked result.
A share event receives the strongest boost signal, reflecting its position as the highest-confidence engagement indicator. Image Tap and Video Tap receive proportionally calibrated boosts. The signal weighting was calibrated against experiment data on how well each event type predicts subsequent engagement with the next ad shown.
Slot Replacement Semantics
The displacement of the previously queued ad required careful design to avoid downstream issues. There were several approaches considered:
One option was to move the displaced ad to a later slot rather than discarding it. I rejected this because it would serve a stale ad that was explicitly bypassed for freshness reasons, undermining the purpose of the eager refresh.
Another option was to insert the fresh ad as an additional slot rather than a replacement, increasing total ad density. I rejected this because it changes the ad density contract of the session, which has implications for engagement metrics and requires a different experiment design.
The chosen approach, replacing the next queued ad, keeps ad density constant, ensures the fresh ad serves at the earliest possible moment after the trigger event, and avoids reintroducing stale inventory into the session.
Measurement and Experiment Design
Measuring the impact of Feed Eager Refresh required a specific experiment design. The treatment metric was ad relevance quality in the next-slot position after an eligible engagement event, measured via CTR, engagement rate, and relevance score on the fresh-ranked ad compared to the pre-queued ad it replaced.
The control group received standard next-slot delivery (the pre-queued ad) regardless of whether an eligible engagement event occurred. The treatment group received the fresh-ranked ad after eligible events.
Results confirmed that engagement-signal-driven re-ranking produces meaningfully higher-quality ad placements in the immediate post-interaction slot, validating the core hypothesis that revealed preference signals at interaction time translate into higher ad relevance when acted upon immediately.
Outcome
Feed Eager Refresh introduced an event-driven dimension to Feed ad delivery, layering real-time relevance signals on top of the existing periodic ranking cycle. The result is that the ad experience in the moments immediately following high-engagement interactions is meaningfully more relevant than what a stale batch ranking would have served.
The broader principle: periodic refresh is a floor for ad ranking freshness, not a ceiling. High-signal user events are opportunities to raise the relevance ceiling at the specific moments when the user is most receptive. A well-designed ads delivery system should be event-aware, not just time-aware.