---
title: "Safe and Efficient Multi-Epoch Embedding Training"
description: "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."
url: "https://swe.quest/articles/safe-and-efficient-multi-epoch-embedding-training-8bb4bc8c80d4baba"
canonical: "https://medium.com/pinterest-engineering/safe-and-efficient-multi-epoch-embedding-training-103bec2abc83"
source: "Pinterest Engineering"
published: "2026-11-06"
difficulty: "hard"
kind: "Case study"
reading_minutes: 12
tags: ["recommendation-systems","model-training","performance","ml-platform"]
---

# Safe and Efficient Multi-Epoch Embedding Training

A post on [Pinterest Engineering](https://swe.quest/sources/pinterest.md), published 2026-11-06, 12 min read, Case study. Original: [https://medium.com/pinterest-engineering/safe-and-efficient-multi-epoch-embedding-training-103bec2abc83](https://medium.com/pinterest-engineering/safe-and-efficient-multi-epoch-embedding-training-103bec2abc83)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Recommendations & ranking](https://swe.quest/tags/recommendation-systems.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [ML platforms](https://swe.quest/tags/ml-platform.md) (AI & ML)

## Prerequisites

- recommendation ranking models ([easy posts on Recommendations & ranking](https://swe.quest/tags/recommendation-systems.md?difficulty=easy))
- embedding tables and sharding ([easy posts on Distributed databases](https://swe.quest/tags/distributed-databases.md?difficulty=easy))
- distributed GPU training ([easy posts on Hardware](https://swe.quest/tags/hardware.md?difficulty=easy))
- PyTorch/TorchRec

## Keywords

Pinterest Homefeed, TorchRec, torch.compile, cuEmbed, NCCL, one-epoch phenomenon, VLM

## Related posts

- [Integrating Netflix’s Foundation Model into Personalization applications](https://swe.quest/articles/integrating-netflix-s-foundation-model-into-personalization-applications-c89e29b2d7755eab.md): Netflix TechBlog · 2026-10-14 · Hard · 7 min read · Recommendations & ranking, ML platforms, Inference & serving, Model training
  Netflix 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.
- [Beyond Two Towers: Launching the 3-Tower Engagement Co-Train Model (Part 2)](https://swe.quest/articles/beyond-two-towers-launching-the-3-tower-engagement-co-train-model-part-2-9d501e5f993d9614.md): Pinterest Engineering · 2026-09-17 · Hard · 13 min read · Recommendations & ranking, Ads, Inference & serving, Performance engineering, Machine learning
  Pinterest's ads lightweight ranking adds a third cross tower to its two-tower engagement model.
- [Meta’s Generative Ads Model (GEM): The Central Brain Accelerating Ads Recommendation AI Innovation](https://swe.quest/articles/meta-s-generative-ads-model-gem-the-central-brain-accelerating-ads-5d5a24731a15c0eb.md): Meta Engineering · 2025-11-10 · Hard · 10 min read · Recommendations & ranking, Ads, Model training, ML platforms
  GEM 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.
- [Parameter-Efficient Fine-Tuning using 🤗 PEFT](https://swe.quest/articles/parameter-efficient-fine-tuning-using-peft-5c28b9ec4e65b0a1.md): Hugging Face · 2023-02-10 · Medium · 5 min read · Model training, LLMs, Python
  Hugging Face's PEFT library brings parameter-efficient fine-tuning methods (LoRA, Prefix Tuning, Prompt Tuning, P-Tuning) to Transformers and Accelerate.
- [GEM Training: How Meta Doubled the Efficiency of Its LLM-Scale Ads Foundation Model](https://swe.quest/articles/gem-training-how-meta-doubled-the-efficiency-of-its-llm-scale-ads-foundation-1bf8547a323404ba.md): Meta Engineering · 2026-08-03 · Hard · 21 min read · Model training, Recommendations & ranking, Performance engineering, Hardware, Ads
  Meta 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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
