Meta's Generative Ads Recommendation Model (GEM), the foundation model for ads recommendations on Instagram and Facebook, has achieved a significant increase in training efficiency. The model now trains at LLM scale on several thousand of the latest-generation GPUs, doubling its end-to-end (E2E) training efficiency to 20–25% Model FLOPs Utilization (MFU).
Key Points
- GEM is the central recommendations foundation model for Meta's ads system.
- It features a hybrid architecture with trillions of sparse embedding parameters and billions of dense parameters.
- GEM is trained on ad content and user engagement data, incorporating sequence and non-sequence features.
- Customized attention mechanisms are applied to each feature group independently, enabling cross-feature learning.
- Training efficiency is measured by E2E MFU, which decomposes into Local MFU (compute efficiency) and Scaling Ratio (scaling efficiency).
- Meta developed a custom kernel library and an ultra-low-precision training recipe for recommendation workloads on the latest GPU hardware.
- JFA v4 (TLX), a custom FlashAttention implementation, achieves 40-140% TFLOPS improvement over JFA v2, contributing to an 18.5% relative local MFU gain and 12% QPS gain.
- An optimized GDPA kernel achieves 2x forward speedup (1,145 BF16 TFLOPs, ~97% Tensor Core utilization) and 1.6x backward speedup over baseline.
Context
According to Meta Engineering, recommendation workloads present a fundamentally different profile than typical LLM workloads, making it challenging to achieve high GPU compute utilization. The interplay between GEM's hybrid architecture and the properties of recommendation-domain data creates unique training challenges. Existing GPU software stacks are primarily optimized for LLM workloads, which often differ in data characteristics and user/ads signal interaction patterns.
Why It Matters
This advancement demonstrates how specialized optimizations can significantly improve the training efficiency of large-scale recommendation models, addressing the unique computational demands of such systems. For builders, this indicates that adapting hardware and software to specific workload characteristics can yield substantial performance gains, even when working with LLM-scale models.
What To Do
- Note that E2E MFU is decomposed into Local MFU and Scaling Ratio for optimization.
- Observe that custom kernel development, such as JFA and GDPA, can address specific workload challenges.
- Consider how specialized attention mechanisms can be optimized for varied sequence lengths and feature types.
- Watch for further details on ultra-low-precision training recipes tailored for recommendation workloads.
Keep Exploring
/atlas/llama-open /atlas/claude-family /atlas/**gemini**-family
