Exploring Hierarchical Interest Representation For Meta Ads Deep Funnel Optimization
Hierarchical Interest Representation is an upstream representation layer for Meta Ads. It learns unified embeddings for users, ads, advertisers and products over a typed, time-decayed heterogeneous engagement graph spanning billions of interactions. A graph transformer injects structural signals such as node-type transitions and shortest-path distance as attention biases, computed on the fly with FlexAttention over packed block-masked subgraphs. It is trained with self-supervised teacher-student cross-view distillation using Sinkhorn-Knopp balancing plus a supervised engagement-prediction objective, with LLM-processed multimodal content enriching sparse nodes. Pipelined data loading from the online graph engine gave a 30x training speedup, strict temporal cutoffs prevent leakage, and embeddings are quantized into Bag-of-Meaning tokens for inverted-index retrieval and use in GEM, Andromeda and ranking models.
Related posts
- From User Sequences to Scaling Laws: A Multi-Stage Architecture for Meta’s Ads Ranking
Meta Engineering hardMasterMeta scales sequence learning for ads ranking by splitting it into two stages: an offline transformer user model processes thousands of user events asynchronously and caches user-level embeddings, and a lightweight online ranking model combines those embeddings with fresh signals and ad candidates under strict latency budgets. Dense tokenization folds sparse features into a single vocabulary, and target-aware multi-head attention weighs past behavior against the ad being scored, so feature interactions are learned rather than hand-engineered. The system shows LLM-style log-linear scaling of normalized entropy with compute. Scaling works best when depth, width and sequence length grow together, and diverse action-type sequences beat homogeneous ones. Together with other model work it contributed to 6% more conversions on Instagram and 3% on Facebook.
- Sequence learning: A paradigm shift for personalized ads recommendations
Meta Engineering hardMasterMeta replaced its DLRM ads ranking models, which depended on thousands of hand-engineered aggregated sparse features, with sequence learning over event-based features (EBFs). These features preserve the order and fine-grained attributes of a person's engagement and conversion events. An event model compresses per-attribute embeddings and adds timestamp encodings, and a transformer-based sequence model uses multi-headed attention pooling keyed by the candidate ad, cutting attention cost from O(N²) to O(M·N). Variable-length sequences are made production-viable through jagged tensor support in PyTorch, GPU kernels, Jagged Flash Attention, quantization and vector quantization. The result was a 2-4% conversion lift on select segments, with plans to scale sequences 100x and explore linear attention and state space models.
- Meta’s Generative Ads Model (GEM): The Central Brain Accelerating Ads Recommendation AI Innovation
Meta Engineering hardMasterGEM is Meta's LLM-scale foundation model for ads recommendation, trained on thousands of GPUs and used as a teacher to improve hundreds of downstream vertical ranking models; it lifted ad conversions 5% on Instagram and 3% on Facebook Feed. The architecture handles non-sequence features with an extended Wukong design (stackable factorization machines), long user-behavior sequences with a pyramid-parallel structure, and cross-feature learning with InterFormer, plus multi-domain learning across surfaces, for 4x the efficiency of earlier ranking models. Knowledge reaches downstream models through direct and hierarchical transfer that combines distillation with a Student Adapter for stale supervision, representation learning and parameter sharing, which Meta reports as 2x as effective as standard distillation. A rebuilt training stack (HSDP for dense layers, 2D sharding of embedding tables, jagged-sequence kernels, FP8 activations, SM-free NCCLX collectives, compile caching) delivered 23x effective FLOPs with 1.43x MFU on 16x more GPUs.
- GenRecs Tokenization: Transforming Ads Recommendation at Meta with Stable Model Vocabulary
Meta Engineering hardMasterMeta's ads recommender replaces per-item IDs with GenRecs Tokenization, a stable semantic vocabulary. Each ad, product or page is encoded with pre-trained multimodal models, decomposed into subspaces (e.g. residual decomposition) and quantized against learned codebooks into short token sequences, so similar items share tokens. This lets new and tail items inherit what the model learned about related items, enabling cold-start generalization and cross-campaign transfer. Paired with GEM and the Adaptive Ranking Model it delivered a +0.35% conversion lift. Across eight tokenizer versions, intrinsic metrics (cluster purity, distribution balance, codebook utilization) correlated with downstream CTR accuracy, so the tokenizer can be iterated without full model retraining.
- User foundation models for Grab
Grab Engineering hardMasterGrab built a transformer-based user foundation model that jointly learns from tabular user attributes and time-series clickstream data to produce general-purpose user embeddings, replacing siloed hand-engineered features. A universal key:value tokenisation with custom positional embeddings and attention masks treats tabular columns as an unordered set and events as an ordered sequence. Modality-specific adapters (pre-trained language models for text, embedding layers for IDs, custom encoders for locations and numbers) feed an alignment layer before the transformer. Pre-training is unsupervised, combining masked token reconstruction with next-action prediction across verticals, so the embeddings serve many downstream tasks such as ads, fraud detection and churn prediction, or the model can be fine-tuned directly.