Abstract
Variational AutoEncoders (VAEs) are highly effective for collaborative filtering but face a significant computational challenge known as the "softmax bottleneck." In large-scale recommendation systems, training time scales linearly with the number of items due to the expensive normalization of the multinomial distribution. We present FastVAE, a framework that utilizes an Inverted Multi-Index (MIDX) to achieve sublinear-time sampling. By approximating the softmax distribution with high fidelity, FastVAE achieves up to a 6x speedup in training while maintaining or even improving recommendation accuracy.
Introduction
The Multinomial VAE (Mult-VAE) has emerged as a state-of-the-art model for collaborative filtering, treating user interaction history as a bag-of-words. However, its reliance on a full softmax over the entire item catalog creates a bottleneck. For a catalog of $M$ items, the model must compute $M$ inner products per training step, which is computationally prohibitive for catalogs with millions of items. While sampled softmax techniques exist, standard uniform or popularity-based samplers often fail to capture the underlying distribution, leading to biased gradients and suboptimal performance.
Methodology: FastVAE and MIDX Sampling
FastVAE addresses the softmax bottleneck through a novel sublinear-time sampling strategy based on the Inverted Multi-Index (MIDX). The approach decomposes the item space using Product Quantization (PQ), where item vectors are split into subvectors and quantized into codebooks.
As illustrated in Figure 1, the sampling process is executed in three distinct stages:
- Stage 1: A cluster index is sampled from the first codebook.
- Stage 2: A second cluster index is sampled from the second codebook, conditioned on the first.
- Stage 3: A specific item is sampled from the resulting "bucket" of items sharing these cluster assignments.
By leveraging this hierarchical structure, the complexity of sampling is reduced from $O(M)$ to $O(DK + K^2)$, where $K$ is the codebook size. We introduce two variants: MIDX_Uni (uniform sampling in the final stage) and MIDX_Pop (popularity-based sampling in the final stage).
Key Results
Efficiency and Scalability
FastVAE demonstrates significant improvements in training efficiency. As the number of items increases, the speedup relative to the standard full-softmax Mult-VAE becomes more pronounced. On the Amazon dataset (1.5 million items), FastVAE achieved a 6x speedup.
Recommendation Accuracy
Despite being an approximation, FastVAE often outperforms the full-softmax baseline. On average, the model saw relative improvements of up to 2.61% in NDCG@50. This suggests that the MIDX sampling process may provide a beneficial regularization effect, helping the model focus on "hard negatives" that are more relevant to the user's latent preferences. Unlike static samplers, MIDX-based samplers are "dynamic"—they adapt as the model learns because they are based on the evolving item embeddings themselves.
Conclusion and Future Work
FastVAE successfully breaks the softmax bottleneck, enabling the training of powerful VAE models on massive item catalogs. While the current implementation uses two codebooks and requires periodic index updates, future work could explore deeper hierarchies for even larger scales and further optimize GPU-based multi-stage sampling pipelines.
Summary updated