Fisher-Weighted Merge of Contrastive Learning Models in Sequential Recommendation

Jung Hyun Ryu, JaeHeyoung Jeon, Jewoong Cho, Myungjoo Kang

TL;DR

This paper introduces Fisher-weighted parameter merging to sequential recommendation, enabling multiple contrastive learning models to be combined into a single set of weights without inference overhead. To overcome the prohibitive computational cost of calculating the Fisher Information Matrix over thousands of candidate items and user sequences, the authors propose batching and item-sampling strategies—including a simple calculation restricted to the target item.

What Problem Does This Paper Address?

Sequential recommendation systems aim to predict a user’s next interaction given their past history. While contrastive learning approaches (like CL4SRec and DuoRec) have significantly mitigated user-item interaction sparsity, different frameworks rely on fundamentally distinct data augmentation strategies. These differing strategies lead to high error inconsistency across models—meaning models make errors on completely different samples, making them prime candidates for ensembling.

However, standard ensembles inflate inference latency and memory footprints linearly with the number of models. While weight-space merging (e.g., "Model Soups" or Fisher Merging) solves this by combining model weights into a single checkpoint, applying Fisher Merging directly to recommender systems introduces a massive computational barrier: calculating the Fisher Information Matrix (FIM) requires differentiating log-probabilities across every user sequence and every potential candidate item in the catalogue ($\mathcal{O}(|U| \cdot |V|)$).

Methods

The authors merge models that share the standard BERT4Rec backbone but are trained with different contrastive objectives (BERT4Rec baseline, CL4SRec, and DuoRec).

  1. Fisher-Weighted Averaging: Under a Laplace approximation of the posterior distribution for each model $m$, the optimal merged parameter $\theta^*$ is a weighted average of model parameters $\theta_m$, weighted by the diagonal elements of their empirical Fisher Information Matrix $F_m$: $$\theta^{*(j)} = \frac{\sum_m \lambda_m F_m^{(j)} \theta_m^{(j)}}{\sum_m \lambda_m F_m^{(j)}}$$
  2. Batch-wise Sequence Computation: To avoid calculating per-user gradients individually, sequences are grouped into batches, sorting prediction probabilities to minimize batch approximation error.
  3. Item Sampling Strategies: Rather than calculating expectations over all $|V|$ items, the authors evaluate four approximations:
  4. Random Sampling: Uniformly samples $n$ items.
  5. Top-$k$ Sampling: Evaluates only the $n$ highest-probability items.
  6. Model-based Sampling: Samples $n$ items proportional to model output probabilities $p_\theta(v_j | s_i)$.
  7. Calculate with Target Item: Only evaluates the gradient on the true ground-truth target item ($n=1$).

Datasets

  • MovieLens-1M: Approximately 6,000 users and 3,500 items. Evaluated on the standard leave-one-out next-item prediction task using ranking metrics (NDCG@10 and NDCG@20) across three candidate item evaluation pools: the full catalogue, 100 randomly sampled items, and the top 100 most popular items.
  • No new benchmarks were introduced.

Key Insights and Ideas

  • Severe probability skew justifies aggressive item sampling: In sequential recommendation, predicted probability mass is heavily concentrated on a tiny fraction of items; the rest are near zero. As a result, calculating the Fisher matrix using just the top-$k$ items (or purely the ground-truth target item) yields an accurate approximation of parameter uncertainty at a fraction of the compute time.
  • Robustness to weak components: Even when an underperforming model was included in the merge (e.g., an under-trained CL4SRec model achieving an NDCG@10 of only 0.0585), Fisher weighting effectively neutralized its noisy parameters, allowing the merged model (NDCG@10 = 0.1386) to still outperform the individual components.
  • Pre-training is critical for linear mode connectivity: Parameter merging failed when models were trained independently from scratch (baseline setting). It only succeeded in the fine-tuning regime, where all models branched from a shared pre-trained checkpoint and remained in the same loss basin.

Key Results

  • Overall Performance: In the fine-tuning regime, the Fisher-merged model achieved 0.1386 NDCG@10 on the full item set, outperforming the baseline (0.1350) and all individual fine-tuned variants (DuoRec unsupervised: 0.1358; CL4SRec: 0.0585).
  • Sampling Comparison:
  • Top-$k$ sampling ($n=50$) reached the highest score on the full item set (0.1387 NDCG@10), followed closely by the target item method (0.1386 NDCG@10).
  • On the random evaluation pool, Top-$k$ ($n=30$) achieved 0.5637 NDCG@10 versus the baseline's 0.5573.
  • Efficiency: While random, top-$k$, and model-based sampling scaled linearly in time as $n$ grew from 10 to 50, computing solely on the target item required only a constant $n=1$ evaluation, achieving competitive accuracy with minimal computation time.

Limitations and Future Work

  • Single Dataset Evaluation: Experiments were restricted to MovieLens-1M; behavior on larger-scale datasets with hundreds of thousands of items (e.g., Amazon, Taobao) remains unverified.
  • Diagonal Assumption: The method restricts the Fisher Information Matrix to diagonal elements, ignoring off-diagonal parameter correlations.
  • Prerequisite for Shared Pre-training: Merging relies on fine-tuning from a common baseline; it cannot merge independently initialized models without explicit alignment.

Summary updated

BibTeX
@inproceedings{ryu2023fisher,
  author = {Jung Hyun Ryu and JaeHeyoung Jeon and Jewoong Cho and Myungjoo Kang},
  title = {{Fisher-Weighted Merge of Contrastive Learning Models in Sequential Recommendation}},
  booktitle = {MFPL @ ICML},
  year = {2023},
  url = {https://openreview.net/forum?id=3dsjDJEVHp},
}
Figure