Safe and Efficient Multi-Epoch Embedding Training
Fine-tuning large pretrained ID embedding tables for more than one epoch in Pinterest's Homefeed ranking model caused about a 6% offline save regression. Freezing the table and isolating gradient paths traced the overfitting to the embedding table. The best recipe was delayed adaptation: keep the table frozen for early epochs and co-train it only in the final epoch. Update timing correlated roughly linearly with quality, and the recipe beat both the one-epoch and fully frozen models, with gains such as +1.16% on a 20-day window. To make longer training affordable, a semi-synchronous pipeline overlaps sharded embedding all-to-all lookups with compute using bounded one-step staleness, alongside fused ID lookups and a specialized cuEmbed singleton-row gather that keeps torch.compile tracing intact.
Related posts
- Integrating Netflix’s Foundation Model into Personalization applications
Netflix TechBlog hardMasterNetflix integrates its transformer-based personalization Foundation Model into production through three patterns: precomputed embeddings, embedding the model as a subgraph of downstream models, and fine-tuning it to power products directly. Embeddings come from the last-event hidden state and the item tower. A monthly pretrain plus daily fine-tune refreshes them, embedding stabilization maps each run into a consistent space, and the Embedding Store serves them. This is the cheap, default starting point, but it suffers from staleness. Subgraph integration removes staleness and allows end-to-end fine-tuning at the cost of heavier feature generation and inference, mitigated by running the subgraph once per profile per request. Fine-tuning gives the best task fit and a fast baseline for new applications but multiplies models to maintain, and Netflix is working on near-real-time embeddings and a distilled model to address the remaining tradeoffs.
- Beyond Two Towers: Launching the 3-Tower Engagement Co-Train Model (Part 2)
Pinterest Engineering hardMasterPinterest's ads lightweight ranking adds a third cross tower to its two-tower engagement model. The cross tower runs cross-attention between user sequences and candidate-derived query tokens, and a shared-bottom inter module jointly predicts CTR, gCTR30 and oCTR. Co-training keeps a fast two-tower head that scores all candidates, and the three-tower path rescores only a utility top-K subset. The three-tower predictions cut offline loss by about 30%. Serving optimizations brought P99 inference from over 200 ms to about 30 ms: caching Pin preprocessing in the Pin tower, BF16, late expansion of user features, and pre-layer normalization.
- 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.
- Parameter-Efficient Fine-Tuning using 🤗 PEFT
Hugging Face mediumAdeptHugging Face's PEFT library brings parameter-efficient fine-tuning methods (LoRA, Prefix Tuning, Prompt Tuning, P-Tuning) to Transformers and Accelerate. Most pretrained weights stay frozen and only a small set of extra parameters is trained, which gives performance comparable to full fine-tuning at a fraction of the compute and storage cost. A LoRA config on mt0-large trains about 0.19% of the parameters, and the saved adapters are only a few MB (19MB for T0_3B) instead of 40GB per-task checkpoints. Example use cases include tuning T0_3B on 11GB consumer GPUs with DeepSpeed offload, INT8 tuning of OPT-6.7b in Colab with bitsandbytes, and Stable Diffusion Dreambooth, plus code for training, saving and loading adapters.
- GEM Training: How Meta Doubled the Efficiency of Its LLM-Scale Ads Foundation Model
Meta Engineering hardMasterMeta doubled end-to-end training efficiency of GEM, its LLM-scale ads recommendation foundation model, to 20–25% MFU while scaling training FLOPs 4x in a year, by co-designing kernels, precision, parallelism, networking and memory. Compute efficiency came from custom recommendation kernels: Jagged Flash Attention (no padding, subtraction-based masking, split-dQ backward, TLX warp specialization), GDPA unifying non-softmax attention variants (up to 3.5x over FA4 on short K/V), and 64-token BlockAttention with fused RoPE, plus MXFP8 attention and MLP that avoid CTR/CVR quality regressions. Scaling efficiency came from topology-aware 5D parallelism (2D FSDP + expert parallelism for dense, fully sharded 2D model parallelism for sparse embeddings) with SM-free collectives. Framing E2E MFU as local MFU × scaling ratio turned a sprawling co-design effort into separable optimization levers.