Flow-based Time-aware Causal Structure Learning for Sequential Recommendation

Hangtong Xu, Yuanbo Xu, Huayuan Liu, En Wang

Introduction: The "Why" Behind the "What"

Traditional sequential recommendation (SR) systems excel at pattern matching—identifying that a user who buys a camera is likely to buy a lens. However, these models often overlook the underlying causal factors, or unobserved confounders, that drive both item availability and user preference. For instance, a seasonal trend or a shift in mood might be the true driver behind a sequence of purchases.

Causal graphs illustrating the role of unobserved confounders (c) and external noise (epsilon) in influencing item interactions (I) and outcomes (Y).

The authors of FCSRec argue that while time is often used as a feature, it is not the cause of behavior but rather a mirror of changing confounders. Simply merging time embeddings with item data can introduce noise, obscuring the core sequential dependencies.

Methodology: The FCSRec Framework

To address these challenges, the authors propose FCSRec (Flow-based Time-aware Causal Structure for Sequential Recommendation). The framework integrates three core components to explicitly model hidden causal influences.

The FCSRec architecture, featuring Time and Item Embedding layers, Causal Normalizing Flows, and a Classifier-free training strategy.

1. Causal Normalizing Flows

Since confounders are unobservable, FCSRec employs Autoregressive Normalizing Flows (ANFs). These flows transform simple random noise into complex representations of hidden factors. By assuming a topological causal order, the model learns the strength of causal paths between these factors dynamically.

2. Time-Conditioned Guidance

To ensure confounder representations are context-aware, temporal data (month, day, hour) is processed through a Multi-Layer Perceptron (MLP). This output serves as a "prior" for the Normalizing Flow, making the generated confounders sensitive to the specific timing of user interactions.

3. Classifier-free Training

Inspired by diffusion models, the authors utilize a "classifier-free" training paradigm. By randomly masking confounder influences during training, the model is forced to learn both pure item-to-item patterns and the impact of hidden confounders. A control factor ($\alpha$) allows for balancing these signals during inference.

Experimental Results

FCSRec was evaluated against state-of-the-art baselines like SASRec and TiSASRec across eight diverse datasets, ranging from movie recommendations (ML-100K, ML-1M) to location-based social networks (Gowalla).

Key findings include:

  • Significant Accuracy Gains: On the ML-100K dataset, FCSRec achieved a Recall@10 of 0.09752, nearly doubling the performance of SASRec.
  • Robustness Across Scales: The model consistently outperformed baselines regardless of dataset size or sparsity.
  • Meaningful Representations: T-SNE visualizations revealed that learned item representations naturally clustered by month, confirming the model's ability to capture time-sensitive nuances without explicit labels.

Conclusion and Future Directions

FCSRec demonstrates that modeling the "hidden causes" of user behavior through Normalizing Flows and time-aware guidance significantly improves recommendation quality. While the model currently focuses on the mathematical influence of confounders, future work aims to enhance the interpretability of these learned structures and explore more complex causal discovery techniques.

Summary updated

Abstract

Sequential models aim to predict future interactions based on users' historical interaction sequences. Traditional sequential methods primarily focus on capturing intra-historical sequence dependencies, overlooking the influence of unobserved confounders in recommendation scenarios. Recent studies incorporate time as additional information helps the model capture dynamic user preferences. However, time is just the external manifestation of the influence of confounders but not the actual cause of the dynamic of user preference. Additionally, improperly integrating time with item embeddings can obstruct the model's ability to capture sequence dependencies. To address these challenges, we first revisit the sequential recommendation problem from a causal perspective and incorporate confounders as a new task. We propose a new framework—Flow-based Time-aware Causal Structure for Sequential Recommendation (FCSRec)—explicitly incorporating unobserved confounders' influence in the recommendation process. Specifically, we use Normalizing Flows to learn the causal graph of confounders and incorporate time information as conditional info to capture confounders' time-sensitive representations. To balance the influence of confounders and sequence dependencies, we introduce a classifier-free training paradigm by randomly masking the influence of confounders during training to encourage the model to learn both sequence dependencies and confounders' influence equally. We validate FCSRec on manifold real-world datasets, and experimental results show that FCSRec outperforms several state-of-the-art methods in recommendation performance. Our code is available at Code-link.
BibTeX
@inproceedings{xu2025flow,
  author = {Hangtong Xu and Yuanbo Xu and Huayuan Liu and En Wang},
  title = {{Flow-based Time-aware Causal Structure Learning for Sequential Recommendation}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.24963/ijcai.2025/389},
}
Figure