Abstract
Sequential recommendation systems often struggle with the "sparsity problem," where infrequent, long-tail items lack sufficient interaction data to generate accurate predictions. We present CaFe (Coarse-to-Fine), a sequential recommendation framework that addresses this by explicitly modeling user shopping intents (coarse-grained categories) alongside specific item interactions (fine-grained products). By using intents as semantic anchors, CaFe significantly improves recommendation accuracy, outperforming state-of-the-art models by over 44% on highly sparse datasets.
1. Introduction
Sequential recommendation aims to predict a user's next interaction by modeling their historical behavior. While self-attentive architectures like SASRec and BERT4Rec have set new benchmarks, their performance degrades sharply on sparse datasets. In real-world scenarios, the vast majority of items reside in the "long tail," appearing only a handful of times across millions of transactions. This sparsity leads to two primary failure modes in existing models:
- Attention Drift: In sparse environments, self-attention mechanisms often "collapse," focusing disproportionately on the most recent items while failing to capture meaningful long-term dependencies.
- Under-trained Embeddings: Because long-tail items appear rarely, their learned vector representations are often poor. While frequent items cluster logically by category in embedding space, sparse item embeddings often appear scattered and noisy.
CaFe addresses these issues by providing the model with "prior knowledge" in the form of coarse-grained intents, allowing the system to understand an infrequent item through its broader categorical context.
2. The CaFe Framework
The CaFe framework utilizes a dual-stream approach to bridge the gap between high-level user goals and specific item choices.
2.1 The Intent Encoder (Coarse-Grained)
This component models the sequence of user intents (e.g., "Laptops" or "Cameras"). Because the number of categories is significantly smaller than the number of unique items, the intent sequence is much denser and easier for the model to learn. This encoder captures the high-level "shopping mission" of the user, providing a stable foundation for prediction.
2.2 The Item Encoder (Fine-Grained)
The item encoder utilizes a directional Transformer enhanced with a specialized masking score. This score incentivizes the model to prioritize short-term dynamics, preventing the noise inherent in sparse historical data from overwhelming the signal of recent interactions.
2.3 Representation Fusion and Joint Inference
Rather than treating categories as simple metadata, CaFe fuses the intent representation ($R^c$) with the item representation ($R^v$). The final prediction is based on a joint probability of both the next item and its corresponding intent. This ensures that any recommended item is semantically consistent with the user's predicted next category, effectively using the intent as a constraint to filter out noisy, irrelevant candidates.
3. Experimental Evaluation
3.1 Datasets
The authors evaluated CaFe on two notoriously sparse, large-scale datasets:
- Amazon: 5.3 million interactions across 1.9 million items (density: $2 \times 10^{-5}$). Item categories served as intents.
- Tmall: 14.4 million interactions across 1.7 million items. Seller IDs served as the coarse-grained intent labels.
3.2 Key Results
CaFe demonstrated a substantial performance leap over baselines such as SASRec, BERT4Rec, and local-attention models like LOCKER:
- Amazon Dataset: CaFe achieved a 53.24% improvement in NDCG@5 over the strongest baseline.
- Tmall Dataset: CaFe showed a 34.82% improvement in NDCG@5.
- Sparsity Correlation: A critical finding was that the sparser the data subset, the higher the relative gain of CaFe. On the most sparse segments of the data, improvements exceeded 100%.
4. Discussion and Future Work
The success of CaFe highlights the importance of explicit intent modeling. While previous works attempted to infer intents implicitly, CaFe demonstrates that treating the intent sequence as its own temporal process provides the necessary "semantic anchor" for sparse data.
However, the model currently relies on predefined metadata (like categories or sellers) and assumes a one-to-one mapping between items and intents. Future research may explore multi-label intent modeling—where a smartphone might belong to both "Electronics" and "Gifts"—and the automatic discovery of "latent" intents from raw data to remove the dependency on human-labeled metadata.
5. Conclusion
CaFe provides a robust solution to the sparsity problem in sequential recommendation. By aligning fine-grained item predictions with coarse-grained intent modeling, the framework ensures that even long-tail items can be accurately recommended by leveraging the dense signals of their parent categories.
Summary updated