Faster and Memory-Efficient Training of Sequential Recommendation Models for Large Catalogs

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Zhelnin, Maxim, Redko, Dmitry, Volkov, Daniil, Volodkevich, Anna, Sokerin, Petr, Shevchenko, Valeriy, Shvetsov, Egor, Vasilev, Alexey, Denisova, Darya, Izmailov, Ruslan, Zaytsev, Alexey
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866917512810070016
author Zhelnin, Maxim
Redko, Dmitry
Volkov, Daniil
Volodkevich, Anna
Sokerin, Petr
Shevchenko, Valeriy
Shvetsov, Egor
Vasilev, Alexey
Denisova, Darya
Izmailov, Ruslan
Zaytsev, Alexey
author_facet Zhelnin, Maxim
Redko, Dmitry
Volkov, Daniil
Volodkevich, Anna
Sokerin, Petr
Shevchenko, Valeriy
Shvetsov, Egor
Vasilev, Alexey
Denisova, Darya
Izmailov, Ruslan
Zaytsev, Alexey
contents Sequential recommendations (SR) with transformer-based architectures are widely adopted in real-world applications, where SR models require frequent retraining to adapt to ever-changing user preferences. However, training transformer-based SR models often encounters a high computational cost associated with scoring extensive item catalogs, often exceeding thousands of items. This occurs mainly due to the use of cross-entropy loss, where peak memory scales proportionally to catalog size, batch size, and sequence length. Recognizing this, practitioners in the field of recommendation systems typically address memory consumption by integrating the cross-entropy (CE) loss with negative sampling, thereby reducing the explicit memory demands of the final layer. However, a small number of negative samples would degrade model performance, and as we demonstrate in our work, increasing the number of negative samples and the batch size further improves the model's performance, but rapidly starts to exceed industrial GPUs' size (~40Gb). In this work, we introduce the CCE- method, which offers a GPU-efficient implementation of the CE loss with negative sampling. Our method accelerates training by up to two times while reducing memory consumption by more than 10 times. Leveraging the memory savings afforded by using CCE- for model training, it becomes feasible to enhance its accuracy on datasets with a large item catalog compared to those trained with original PyTorch-implemented loss functions. Finally, we perform an analysis of key memory-related hyperparameters and highlight the necessity of a delicate balance among these factors. We demonstrate that scaling both the number of negative samples and batch size leads to better results rather than maximizing only one of them. To facilitate further adoption of CCE-, we release a Triton kernel that efficiently implements the proposed method.
format Preprint
id arxiv_https___arxiv_org_abs_2509_09682
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Faster and Memory-Efficient Training of Sequential Recommendation Models for Large Catalogs
Zhelnin, Maxim
Redko, Dmitry
Volkov, Daniil
Volodkevich, Anna
Sokerin, Petr
Shevchenko, Valeriy
Shvetsov, Egor
Vasilev, Alexey
Denisova, Darya
Izmailov, Ruslan
Zaytsev, Alexey
Information Retrieval
Sequential recommendations (SR) with transformer-based architectures are widely adopted in real-world applications, where SR models require frequent retraining to adapt to ever-changing user preferences. However, training transformer-based SR models often encounters a high computational cost associated with scoring extensive item catalogs, often exceeding thousands of items. This occurs mainly due to the use of cross-entropy loss, where peak memory scales proportionally to catalog size, batch size, and sequence length. Recognizing this, practitioners in the field of recommendation systems typically address memory consumption by integrating the cross-entropy (CE) loss with negative sampling, thereby reducing the explicit memory demands of the final layer. However, a small number of negative samples would degrade model performance, and as we demonstrate in our work, increasing the number of negative samples and the batch size further improves the model's performance, but rapidly starts to exceed industrial GPUs' size (~40Gb). In this work, we introduce the CCE- method, which offers a GPU-efficient implementation of the CE loss with negative sampling. Our method accelerates training by up to two times while reducing memory consumption by more than 10 times. Leveraging the memory savings afforded by using CCE- for model training, it becomes feasible to enhance its accuracy on datasets with a large item catalog compared to those trained with original PyTorch-implemented loss functions. Finally, we perform an analysis of key memory-related hyperparameters and highlight the necessity of a delicate balance among these factors. We demonstrate that scaling both the number of negative samples and batch size leads to better results rather than maximizing only one of them. To facilitate further adoption of CCE-, we release a Triton kernel that efficiently implements the proposed method.
title Faster and Memory-Efficient Training of Sequential Recommendation Models for Large Catalogs
topic Information Retrieval
url https://arxiv.org/abs/2509.09682