Saved in:
Bibliographic Details
Main Authors: Saket, Srijan, Ihara, Ikuhiro, Sharma, Vaibhav, Kalim, Danish
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2510.15308
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908599147560960
author Saket, Srijan
Ihara, Ikuhiro
Sharma, Vaibhav
Kalim, Danish
author_facet Saket, Srijan
Ihara, Ikuhiro
Sharma, Vaibhav
Kalim, Danish
contents In modern recommendation systems and social media platforms like Meta, TikTok, and Instagram, large-scale ID-based features often require embedding tables that consume significant memory. Managing these embedding sizes can be challenging, leading to bulky models that are harder to deploy and maintain. In this paper, we introduce a method to automatically determine the optimal embedding size for ID features, significantly reducing the model size while maintaining performance. Our approach involves defining a custom Keras layer called the dimension mask layer, which sits directly after the embedding lookup. This layer trims the embedding vector by allowing only the first N dimensions to pass through. By doing this, we can reduce the input feature dimension by more than half with minimal or no loss in model performance metrics. This reduction helps cut down the memory footprint of the model and lowers the risk of overfitting due to multicollinearity. Through offline experiments on public datasets and an online A/B test on a real production dataset, we demonstrate that using a dimension mask layer can shrink the effective embedding dimension by 40-50\%, leading to substantial improvements in memory efficiency. This method provides a scalable solution for platforms dealing with a high volume of ID features, optimizing both resource usage and model performance.
format Preprint
id arxiv_https___arxiv_org_abs_2510_15308
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Dimension Mask Layer: Optimizing Embedding Efficiency for Scalable ID-based Models
Saket, Srijan
Ihara, Ikuhiro
Sharma, Vaibhav
Kalim, Danish
Information Retrieval
In modern recommendation systems and social media platforms like Meta, TikTok, and Instagram, large-scale ID-based features often require embedding tables that consume significant memory. Managing these embedding sizes can be challenging, leading to bulky models that are harder to deploy and maintain. In this paper, we introduce a method to automatically determine the optimal embedding size for ID features, significantly reducing the model size while maintaining performance. Our approach involves defining a custom Keras layer called the dimension mask layer, which sits directly after the embedding lookup. This layer trims the embedding vector by allowing only the first N dimensions to pass through. By doing this, we can reduce the input feature dimension by more than half with minimal or no loss in model performance metrics. This reduction helps cut down the memory footprint of the model and lowers the risk of overfitting due to multicollinearity. Through offline experiments on public datasets and an online A/B test on a real production dataset, we demonstrate that using a dimension mask layer can shrink the effective embedding dimension by 40-50\%, leading to substantial improvements in memory efficiency. This method provides a scalable solution for platforms dealing with a high volume of ID features, optimizing both resource usage and model performance.
title Dimension Mask Layer: Optimizing Embedding Efficiency for Scalable ID-based Models
topic Information Retrieval
url https://arxiv.org/abs/2510.15308