TL;DR
ELASTIC addresses the quadratic computational bottleneck of Transformer-based sequential recommenders by introducing a Linear Dispatcher Attention (LDA) mechanism coupled with a sparse Interest Memory Retrieval (IMR) layer. This architecture achieves linear time and memory complexity ($O(Nk)$) while maintaining a massive parameter capacity, slashing GPU memory usage by up to 90% and boosting inference speed by over 2.6x without sacrificing recommendation accuracy.
What Problem Does This Paper Address?
Modern sequential recommender systems (SRs) rely heavily on self-attention mechanisms (like SASRec or BERT4Rec) to capture user preferences from chronological interaction histories. However, standard self-attention scales quadratically ($O(N^2)$) with the sequence length $N$.
As online platforms collect longer user histories—often spanning thousands of actions over a user's life cycle—this quadratic complexity becomes a massive computational and memory bottleneck. This makes it impractical to scale up sequence lengths in production environments. While alternative "X-former" architectures attempt to solve this by sparsifying or approximating attention, they frequently sacrifice recommendation accuracy and stability.
Methods
ELASTIC decouples model capacity from computational cost using two core components:
- Linear Dispatcher Attention (LDA) Layer: Instead of computing all pairwise item-to-item interactions, LDA introduces a small, fixed number ($k \ll N$) of learnable "interest tokens" to serve as information bottlenecks. It first aggregates information from the $N$ sequence tokens into these $k$ tokens, and then dispatches the aggregated dependencies back to the sequence tokens. This reduces the complexity of the attention mechanism to $O(Nk)$.
- Interest Memory Retrieval (IMR) Layer: To prevent the fixed $k$ tokens from limiting the model's representational capacity, ELASTIC initializes a massive, learnable pool of "interest experts." A hierarchical query network compresses the user's history into a query vector, which is used to sparsely retrieve the top-$k$ most relevant interest representations. To keep retrieval computationally negligible, it uses a product key technique (Cartesian product of two smaller sub-key sets), reducing the search complexity from $O(Kd)$ to $O((\sqrt{K}+k^2)d)$.
Datasets
The authors evaluated ELASTIC on two real-world datasets:
- ML-1M (MovieLens): A standard benchmark containing ~1 million movie ratings from 6,040 users, with a relatively short average sequence length of 165.5 (max sequence length set to 256).
- XLong: A large-scale dataset from Alibaba's online advertising platform containing 66.8 million actions from nearly 70,000 users, characterized by extremely long historical sequences (average length of 958.8, max sequence length set to 1024).
Key Insights and Ideas
- Decoupling Capacity from Cost: Traditionally, adding parameters to an attention mechanism increases the computational burden. ELASTIC uses sparse retrieval (IMR) to maintain a massive bank of millions of potential user interests, but only activates a tiny fraction ($k$) per forward pass, keeping the computational cost strictly linear.
- Information Bottlenecks as Compressors: The LDA layer acts as an efficient aggregator/dispatcher. It proves that full $N \times N$ attention matrices are not strictly necessary to capture long-range user behavior; a small set of dynamic interest experts can act as an effective information highway.
- Shared vs. Biased Interests: Visualization of the expert activation patterns revealed that certain "hot experts" are frequently activated across many users (capturing global trends/common interests), while others are highly sparse, capturing niche, personalized user preferences.
Key Results
- Performance Boost: ELASTIC consistently outperformed strong baselines (including SASRec, BERT4Rec, and the recent linear model HSTU) across both datasets. On the long-sequence XLong dataset, it achieved an average performance improvement of 3.25% (e.g., NDCG@10 improved from 0.3122 for SASRec to 0.3507 for ELASTIC).
- Efficiency Gains: For a sequence length of 1024 on the XLong dataset, ELASTIC reduced GPU memory usage by roughly 90% and delivered a 2.68x inference speedup compared to SASRec.
- Linear Scaling: While SASRec's memory and latency grow quadratically, ELASTIC scales near-linearly with sequence length, making it highly viable for production scaling.
Limitations and Future Work
The authors note that while an excessively large interest pool expands capacity, expanding it too far (e.g., to a $512 \times 512$ key space on ML-1M) can introduce redundancy and slightly degrade performance due to underutilization of keys (only ~55.76% utilized at that scale). Consequently, the interest pool size $K$ and the number of retrieved heads $k$ require careful hyperparameter tuning. Future work could explore adaptive retrieval sizes or dynamic memory allocation strategies to automate this process.
Summary updated