MetaBy Steven De Gryze, Parshva Doshi, Sean O'Byrne, Arnold Overwijk, Dinesh Ramasamy, Lee XiongExplainer
From User Sequences to Scaling Laws: A Multi-Stage Architecture for Meta’s Ads Ranking
Summary
Meta’s ads ranking systems process millions of candidates per second under millisecond latency budgets, creating tension between richer sequence models and efficient serving. The post presents a multi-stage architecture that moves long-history user modeling into asynchronous offline transformers, caches user-level embeddings, and combines them with fresh user and ad signals in an online ranking model. Dense tokenization places sparse features and behavioral sequences in one vocabulary, while target-aware multi-head attention learns higher-order interactions between historical behavior and the candidate ad. On real-world ads traffic, performance follows a log-linear relationship with compute across depth, enrichment, width, and sequence length, with balanced growth and diverse sequences identified as scaling levers. Together with broader model innovations, the approach contributed to a cumulative 6% conversion lift on Instagram, 3% on Facebook, and 3.5% lift in Facebook ad clicks, and serves as a core component of GEM.
Context
Ads recommendation systems must rank thousands of ads within milliseconds while processing millions of candidates per second. Earlier hybrid sequence-model approaches introduced lossy knowledge transfer, continued reliance on manual feature engineering, and scaling ceilings caused by interference between sequence and ranking components.
Approach / What changed
The architecture separates sequence learning into asynchronous offline user modeling and latency-sensitive online ranking. Deep upstream transformers process long user histories and cache user-level embeddings independently of ad candidates; online models combine those representations with fresh user signals and candidate information. Dense tokenization and target-aware multi-head attention learn sparse feature and behavioral interactions directly from data.
Takeaways
The offline stage processes sequences with lengths in the thousands, generates user-level embeddings, and caches them before online ranking, allowing model capacity to increase without a proportional rise in serving resources.
Dense tokenization combines sparse features with behavioral sequences in a single dense vocabulary, while target-aware attention weighs past behaviors against the specific ad being scored.
On real-world ads traffic, performance showed a log-linear relationship with compute; balanced growth across depth, width, and sequence length, plus diverse action sequences, were identified as scaling levers.
Source and freshness
- Source
- engineering.fb.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.