Skip to content

Add difsasrec#2211

Open
TalCordova wants to merge 2 commits intoRUCAIBox:masterfrom
TalCordova:add-difsasrec
Open

Add difsasrec#2211
TalCordova wants to merge 2 commits intoRUCAIBox:masterfrom
TalCordova:add-difsasrec

Conversation

@TalCordova
Copy link

Summary

Implements DIF-SASRec (Decoupled Side Information Fusion for Sequential Recommendation)
from Xie et al., SIGIR 2022.

DIF-SASRec extends SASRec by decoupling item, position, and optional side-information
attention scores so each source independently shapes the attention distribution before
the softmax — rather than fusing them in the input embedding.

Key features:

  • Three fusion strategies: sum, concat, gate
  • Optional context towers: any FLOAT / FLOAT_SEQ item feature fields (e.g. LLM
    embeddings) can be added as extra decoupled attention sources
  • Degrades gracefully to a pure DIF-SASRec (no side info) when context_fields: []

Files changed:

  • recbole/model/sequential_recommender/difsasrec.py — model implementation
  • recbole/model/sequential_recommender/__init__.py — registration
  • recbole/properties/model/DIFSASRec.yaml — default hyperparameters
  • tests/model/test_model_auto.py — integration tests (CE loss, BPR loss, concat fusion)
  • tests/model/test_difsasrec.py — standalone unit tests (no full pipeline required)

Reference code: https://github.com/AIM-SE/DIF-SR

Test plan

  • test_difsasrec — forward + CE loss, no side information
  • test_difsasrec_with_BPR_loss — BPR loss path
  • test_difsasrec_with_concat_fusion — concat fusion type
  • All three fusion types (sum / concat / gate) × CE and BPR loss — via test_difsasrec.py
  • Context towers (1 and 2 towers) with all fusion types
  • Output shapes verified: forward, predict, full_sort_predict
  • Context embedding weights confirmed frozen during training

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant