This article from Pinterest Engineering details how they addressed challenges in multi-epoch training of large ID embedding tables for their Homefeed ranking model. It explores overfitting issues and GPU waste from communication-bound training, proposing solutions like gradient isolation, delayed embedding adaptation, and semi-synchronous training to improve model quality and efficiency. The technical deep dive provides insights into architectural decisions for ML infrastructure.
Read original on Pinterest EngineeringLarge ID embedding tables are crucial for advanced recommendation models, like Pinterest's Homefeed ranking. However, fine-tuning these tables for more than one epoch historically leads to significant model quality degradation (e.g., a 6% decline in offline metrics) and substantial GPU waste due to communication bottlenecks. This single-epoch constraint severely limits model optimization on fresh datasets and impacts the effective learning of components like Vision Language Models (VLMs).
Through experimentation, Pinterest engineers identified the embedding table itself as the primary source of catastrophic overfitting. Freezing the embedding table entirely during multi-epoch training eliminated the regression and even led to gains, demonstrating that task-specific adaptation without overfitting was the core problem. This highlights the delicate balance between enabling model components to learn and preventing them from memorizing sparse data.
Key Learning from Gradient Isolation
Attempts to selectively control gradient paths (e.g., contrastive-only updates, selective candidate gradients through transformer or feature cross paths) helped mitigate overfitting but generally did not outperform a fully frozen embedding table. The transformer's inherent structure provided some regularization compared to the direct feature cross path, but the embedding table remained the bottleneck for effective multi-epoch training.
The most effective strategy discovered was delayed embedding adaptation. This involves freezing the embedding table for an initial epoch(s) and then allowing it to co-train with the rest of the model in later epochs. This approach allows the surrounding network to first learn more generalizable patterns from the pretrained representations before the embeddings adapt to task-specific signals. This yielded superior results compared to both single-epoch training and fully frozen embeddings, demonstrating a crucial architectural decision for deep learning pipelines.
Beyond overfitting, efficiency was a major concern. With embedding tables sharded across GPUs, distributed embedding lookups and synchronization caused significant idle periods. The article mentions adopting semi-synchronous training to reduce communication overhead and improve GPU utilization, a critical component of designing scalable distributed ML training infrastructure.