TL;DR
StackRec is an efficient training framework that builds very deep sequential recommender (SR) models by iteratively "stacking" layers from shallower, pre-trained versions. By leveraging the high similarity between intermediate layers in deep networks, StackRec achieves up to a 3.5x training speedup while maintaining or even improving recommendation accuracy compared to training from scratch.
What Problem Does This Paper Address?
Sequential Recommendation (SR) models—which predict a user's next move based on their history—are becoming increasingly complex. While the computer vision field has long embraced networks with hundreds of layers, the recommendation community has typically stuck to fewer than 10.
The authors demonstrate that "going deep" (up to 128 layers) significantly improves accuracy. However, training such massive models on real-world datasets with billions of interactions is computationally grueling and slow. The challenge is: How can we reap the benefits of extremely deep architectures without the prohibitive time and hardware costs of training them from scratch?
Methods
The core of StackRec is Iterative Stacking. Instead of training a 64-layer model from day one, you start with a shallow 8-layer model, train it to convergence, and then use its learned weights to initialize a 16-layer model. This process repeats until the desired depth is reached.
The authors propose two specific stacking strategies:
- Adjacent-block stacking: Each block in the shallow model is copied to two successive positions in the deeper model (e.g., block 1 becomes new blocks 1 and 2).
- Cross-block stacking: The entire stack of $L$ blocks is copied and placed on top of the original $L$ blocks.
To make this transition smooth, they introduce a learnable weight ($\alpha$) in the residual blocks, initialized to zero. This ensures that when a model is first stacked, the new layers initially act as an identity function, preserving the performance of the shallow model before fine-tuning begins. This mathematical trick, known as maintaining dynamical isometry, prevents the "gradient shock" that usually occurs when suddenly doubling a network's depth.
Datasets
The researchers evaluated StackRec on three large-scale, real-world datasets:
- ML20 (MovieLens 20M): A standard benchmark for movie recommendations.
- Kuaibao: A massive feed recommendation dataset (news, micro-videos, ads) from Tencent, containing 22.7 million actions.
- ColdRec: A dataset specifically for transfer learning, featuring a source domain (QQ Browser news) and a target domain (Kandian news) to test how well pre-trained representations transfer to new users.
Key Insights and Ideas
- Layer Redundancy is a Feature, Not a Bug: The authors found that in well-trained deep SR models, the cosine similarity between the feature maps of adjacent blocks is over 90%. This "aha moment" suggests that deep models learn highly similar transformations across layers, making them perfect candidates for knowledge transfer via stacking.
- Depth is Necessary for SR: The paper provides some of the first clear evidence that SR models benefit from CV-style depth. For instance, on the Kuaibao dataset, a 128-layer model significantly outperformed its shallower counterparts.
- Stacking as a "Warm Start": Stacking provides a much better starting point for optimization than random initialization. It essentially acts as a form of curriculum learning, where the model first learns coarse patterns and then refines them as it grows deeper.
Key Results
- Substantial Acceleration: In "Training-from-Scratch" scenarios, StackRec reduced training time by 40% on ML20 and 35% on Kuaibao compared to standard training.
- Superior Efficiency in Continual Learning: In a "Continual Learning" scenario (where a model must grow as more data arrives), StackRec achieved speedups between 2.05x and 3.29x.
- No Accuracy Trade-off: In almost all tests, StackRec-trained models achieved comparable or slightly higher MRR@5 (Mean Reciprocal Rank) and Hit Ratio than models trained the traditional way.
- Broad Adaptability: While primarily tested on the CNN-based NextItNet, the authors showed StackRec works effectively with other state-of-the-art architectures like SASRec (Transformer-based) and SSEPT.
Limitations and Future Work
While StackRec is highly effective for CNN and Attention-based models, the authors note that RNN-based models (like GRU4Rec) are notoriously difficult to stack deeply due to vanishing/exploding gradients, and StackRec does not fully solve this for the RNN family.
Additionally, the current stacking schedule (doubling the layers) is intuitive but perhaps not optimal. Future research could explore automated stacking schedules—using reinforcement learning or neural architecture search to determine exactly when and how much to grow the network based on the incoming data stream.
Summary updated