- The paper presents CoDiS, a novel framework that uses causal intervention to disentangle shared and domain-specific user preferences in sequential recommendations.
- It employs a context-aware mixture-of-experts architecture with dual variational encoders and adversarial regularization to mitigate gradient conflict and contextual confounding.
- Empirical results demonstrate that CoDiS outperforms state-of-the-art models in sparse domains and low user-overlap scenarios, ensuring robust cross-domain recommendation.
Context-Aware Disentanglement for Cross-Domain Sequential Recommendation: A Causal View
Problem Definition and Motivation
Cross-Domain Sequential Recommendation (CDSR) is tasked with predicting a user's next interaction in multiple domains by exploiting sequence data from each domain. Traditional CDSR approaches are encumbered by three critical issues: (1) failure to account for context-induced confounding, resulting in spurious cross-domain preference correlations; (2) entanglement of domain-shared and domain-specific preferences due to inter-domain gradient conflict and the "seesaw effect"; (3) heavy reliance on user-overlap assumptions that rarely hold in deployment environments. These issues are illustrated by the tendencies of existing models to learn correlations induced by transient contextual phenomena rather than true causal user preferences.
Figure 1: CDSR comparison of prior models and CoDiS under varying contexts: (a) prior models confuse spurious correlations with cross-domain preferences; (b) prior models misattribute domain-specific effects as shared preference.
The paper introduces CoDiS, a context-aware, causally-motivated disentanglement framework for CDSR. The approach modifies the core mechanism of cross-domain preference transfer by embedding a formal causal intervention scheme, dynamically isolating domain-shared and specific factors, and eliminating the dependency on explicit user overlap.
The theoretical backbone of CoDiS lies in modeling CDSR from a causal perspective. Real-world sequential data generation involves latent context variables C confounding both the latent preferences (shared Zsha and domain-specific ZspeA,ZspeB) and observable behaviors (SA,SB,YA,YB). In standard models, backdoor paths Y←C→Z cause the model to learn context-driven patterns as if they are causally invariant user preferences, breaking the disentanglement and transfer process.
Figure 2: A causal graph comparison of real-world data generation, the traditional model, and CoDiS in the CDSR setting.
CoDiS adopts an explicit backdoor adjustment—the context variable is inferred through a variational posterior Q(C∣S), enabling the estimation of causal effects by integrating over possible contexts. This not only blocks the spurious confounding path but provides unbiased identification of both domain-shared and domain-specific preferences. Context is treated as a latent, data-driven variable, circumventing the need for annotated contextual features.
CoDiS Framework Architecture
Context-Aware Mixture-of-Experts (MoE)
CoDiS unifies context-sensitive modeling and expert isolation through a context-aware MoE. The model instantiates N context experts, with R as shared and N−R as domain-specific, using a gating mechanism driven by a context router. This routing selects the most appropriate experts per time step, capturing dynamically shifting preferences and minimizing cross-domain gradient conflict.
Figure 3: (a) High-level architecture of CoDiS; (b) detailed structure of context-aware MoE Encoders; (c) structure of the variational disentangling module.
A context router Ψ produces soft expert assignment probabilities for each point in the user trajectory, with expert isolation ensuring mutually exclusive parameter updates for shared and specific experts—crucially mitigating the seesaw effect integral to prior multi-task CDSR models.
Variational Disentanglement and Adversarial Regularization
Preliminary separation via MoE encoders yields still-mixed latent factors. To enforce finer disentanglement, CoDiS introduces dual variational encoders (for Zsha0 and Zsha1), optimizing the Evidence Lower Bound (ELBO) with prior-regularized latent variables to encourage statistically independent, domain-specific representations.
Further, variational adversarial disentanglement is achieved via a domain discriminator with a Gradient Reversal Layer (GRL). The adversarial loss penalizes leakage of domain information into domain-shared representations, pushing the shared representation towards true invariance and impeding spurious domain leakage.
Training Loss Structure
The CoDiS loss comprises:
- InfoNCE-based recommendation losses for both shared and domain-specific representations;
- KL-regularized variational objectives on the context and domain-specific encoders;
- Adversarial domain classification loss with gradient reversal.
Importantly, domain-specific losses utilize stop-gradient on shared representations, abolishing conflicting backward signals.
Empirical Evaluation and Ablation
Experiments are conducted on three Amazon domain pairs, each posing challenges of data sparsity, context shift, and variable user overlap. Metrics include HR@K, NDCG@K, and MRR.
Key empirical findings:
Ablation analysis confirms that context-aware mechanisms, variational disentanglement, and adversarial regularization are all essential; removing any module results in significant performance drops. The context-aware router and expert isolation are specifically validated for their necessity in handling context shift and the gradient seesaw effect.
Figure 5: Performance Comparison under Increasing Noise, demonstrating CoDiS’s robustness to contextual perturbations.
Figure 6: Impact of the number of total (N), shared (R), and specific (K) experts on kitchen MRR; balanced expert composition is critical for optimal performance.
Context Dynamics and Representation Analysis
Case studies and visualization of the expert assignment probabilities over time demonstrate that CoDiS is able to detect and adapt to temporal context shifts. This dynamic context inference corresponds to human-understandable distribution shifts, validating the effectiveness of the learned context variable.
Figure 7: Visualization of probabilities for different contexts across timesteps, illustrating temporal context shift and adaptive expert selection.
Theoretical and Practical Implications
CoDiS establishes a new paradigm for CDSR: disentanglement not merely as a representational or regularization objective, but as a causal necessity. By explicitly modeling, inferring, and integrating over latent contexts, the framework blocks spurious correlations, enables robust transfer, and scales to scenarios with little or no observed user overlap. This opens the path for CDSR systems with greater reliability under non-stationary, context-rich, and deployment-agnostic conditions. The modular architecture is computationally efficient and can be extended for more granular context modeling or integrated with large pre-trained sequence encoders.
Conclusion
CoDiS is a causally-aware CDSR framework that advances the field by correcting for latent confounding via variational context estimation, enabling explicit disentanglement of shared and specific user preferences, and fortifying robustness to gradient conflict and user overlap artifacts. Empirical validation demonstrates superior performance and stability with negligible deployment-side computational cost. The methodology has broad implications for any recommendation scenario involving context shift, non-stationary environments, and sequence transfer under minimal overlap, anchoring future advances in causally-informed multi-domain recommendation systems.