This repository contains the PyTorch implementation of the paper: "Context-Aware Sequential Model for Multi-Behaviour Recommendation" by Shereen Elsayed, Ahmed Rashed, and Lars Schmidt-Thieme. https://arxiv.org/abs/2312.09684
CASM is a sequential recommendation model that utilizes multiple user behaviors to capture complex patterns in historical interactions. It outperforms state-of-the-art approaches on four real-world datasets by leveraging context-aware multi-head self-attention layers and a weighted binary cross-entropy loss to support an arbitrary number of behaviors.
Our CASM model shows a performance improvement of up to 19.24% over CARCA on various datasets.
Method | MovieLens HR@10 | MovieLens NDCG@10 | Tianchi HR@10 | Tianchi NDCG@10 |
---|---|---|---|---|
Sequential Recommendation Methods | ||||
SASRec | 0.911 ± 1𝐸−3 | 0.668 ± 5.1𝐸−3 | 0.659 ± 3𝐸−3 | 0.495 ± 2𝐸−3 |
SSE-PT | 0.911 ± 7.1𝐸−3 | 0.657 ± 4.5𝐸−3 | 0.663 ± 1.2𝐸−2 | 0.468 ± 1.3𝐸−2 |
Context-Aware Recommendation Methods | ||||
CARCA | 0.906 ± 2𝐸−3 | 0.665 ± 1𝐸−3 | 0.713 ± 4𝐸−4 | 0.500 ± 1𝐸−3 |
Multi-Behavior Recommendation Methods | ||||
MATN | 0.847 | 0.569 | 0.714 ± 7𝐸−4 | 0.485 ± 2𝐸−3 |
KHGT | 0.861 | 0.597 | 0.652 ± 1𝐸−4 | 0.443 ± 1𝐸−4 |
MBHT | 0.913 ± 5.9𝐸−3 | 0.695 ± 7𝐸−3 | 0.725 ± 6.3𝐸−3 | 0.554 ± 4.8𝐸−3 |
CASM | 0.930 ± 6𝐸−4 | 0.713 ± 1.3𝐸−3 | 0.755 ± 9𝐸−4 | 0.584 ± 2.7𝐸−3 |
Improv.(%) | 1.86% | 2.44% | 2.99% | 5.95% |
-
Clone the repository:
git clone https://github.com/ariaattar/CASM-PyTorch.git cd CASM-PyTorch
-
Clone the repository:
unzip data/Tmall.zip -d data
-
Install the required packages:
pip install -r requirements.txt
-
Train the model:
python main.py
For the original TensorFlow implementation of the CASM model, please visit the following repository: CASM TensorFlow Implementation
If you use this code for your research, please cite our paper:
@article{elsayed2023casm,
title={Context-Aware Sequential Model for Multi-Behaviour Recommendation},
author={Elsayed, Shereen and Rashed, Ahmed and Schmidt-Thieme, Lars},
journal={arXiv preprint arXiv:2312.09684},
year={2023}
}
This project is licensed under the MIT License - see the LICENSE file for details.