MuLe

October 29, 2024 · View on GitHub

This is the official code for MuLe (Multi-Grained Graph Learning for Multi-Behavior Recommendation), accepted to CIKM 2024. overview

Prerequisties

You can install the required packages with a conda environment by typing the following command in your terminal:

conda create -n MULE python=3.9
conda activate MULE
pip install -r requirements.txt

Datasets

The statistics of datasets used in MuLe are summarized as follows. The percentage of each auxiliary behavior is the ratio of target intersected interactions (e.g., view and buy).

DatasetUsersItemsViewsCollectsCartsBuys
Taobao15,44911,953873,954 (9%)-195,476 (10%)92,180
Tmall41,73811,9531,813,498 (12%)221,514 (12%)1,996 (15%)255,586
Jdata93,33424,6241,681,430 (16%)45,613 (43%)49,891 (57%)321,883

We gathered Tmall and Jdata datasets from CRGCN and Taobao dataset from MBCGCN. To preprocess the datasets for use in our code, type the following command:

python ./data/preprocess.py

Usage

Train our model from scratch

You can train the model with the best hyperparameters for each dataset by typing the following command in your terminal:

Train MuLE in the Taobao dataset

python ./src/main.py --dataset taobao \
                     --lr 1e-4 \
                     --weight_decay 0 \
                     --tda_layers 4 \
                     --gnn_layers 1 \
                     --emb_dim 64 \
                     --num_epochs 100 \
                     --batch_size 1024

Train MuLE in the Tmall dataset

python ./src/main.py --dataset tmall \
                     --lr 5e-4 \
                     --weight_decay 1e-5 \
                     --tda_layers 5 \
                     --gnn_layers 1 \
                     --emb_dim 64 \
                     --num_epochs 100 \
                     --batch_size 1024

Train MuLE in the Jdata dataset

python ./src/main.py --dataset jdata \
                     --lr 1e-3 \
                     --weight_decay 0 \
                     --tda_layers 5 \
                     --gnn_layers 1 \
                     --emb_dim 64 \
                     --num_epochs 100 \
                     --batch_size 1024

Use a pre-trained MuLe

Because of the volume limit of the github, we provide the pre-trained parameters of MuLe for each dataset in google drive. You can download the pre-trained files as follows:

gdown --folder https://drive.google.com/drive/folders/1L5wnVGQ6EhBy9wyPJTOxsU9JD7zIIvrc 

After downloading the pre-trained parameters, you can run the pre-trained model by adding --load_checkpoint option to the above training command.

Result of Pre-trained MuLe

The test performance of the pre-trained MuLE for each dataset is as follows:

DatasetHR@10NDCG@10
Taobao0.19390.1109
Tmall0.21090.1165
Jdata0.58200.4147

All experiments are conducted on RTX 4090 (24GB) with cuda version 11.8, and the above results were reproduced with the random seed seed=42.

The reported results in the paper are as follows:

HR@10TaobaoTmallJdata
LightGCN0.04110.03930.2252
CRGCN0.08550.08400.5001
MB-CGCN0.12330.09840.4349
HPMR0.11040.0956-
PKEF0.13850.12770.4334
MB-HGCN0.12990.14430.5406
MuLE0.19180.21120.5889
% diff38.5%44.6%10.3%
NDCG@10TaobaoTmallJdata
LightGCN0.02400.02090.1436
CRGCN0.04390.04420.2914
MB-CGCN0.06770.05580.2758
HPMR0.05990.0515-
PKEF0.07850.07210.2615
MB-HGCN0.06900.07690.3555
MuLE0.11030.11770.4061
% diff40.5%52.9%25.4%

Validated hyperparameters of MuLe

We provide the validated hyperparameters of MuLe for each dataset to ensure reproducibility.

Datasetη\etaλ\lambdaLtdaL_{\texttt{tda}}LlightL_{\texttt{light}}ddTTBB
Taobao1e-4041641001024
Tmall5e-41e-551641001024
Jdata1e-3051641001024

Description of each hyperparameter

  • η\eta: learning rate of the Adam optimizer (--lr)
  • λ\lambda: weight decay for L2-regularization (--weight_decay)
  • LtdaL_{\texttt{tda}}: number of TDA's layers (--tda_layers)
  • LlightL_{\texttt{light}}: number of LightGCN's layers (--gnn_layers)
  • dd: embedding dimension (--emb_dim)
  • TT: number of epochs (--num_epochs)
  • BB: batch size for target data (--batch_size)

Detailed Options

You can train and evaluate your own dataset with custom hyperparameters as follows:

OptionDescriptionDefault
datasetdataset nametaobao
data_dirdata directory path./data
checkpoint_dircheckpoint directory path./checkpoint
load_checkpointwhether to load the configuration used in a pre-trained modelFalse
batch_sizebatch size for target data1024
lrlearning rate0.0001
weight_decaystrength λ\lambda of L2 regularization0.00001
gnn_layersnumber of LightGCN layers1
tda_layersnumber of TDA layers4
emb_dimembedding dimension64
num_epochsnumber of epochs100
seedrandom seed; If None, the seed is not fixed42
devicetraining devicecuda:0
topkTop-k items10

Citation

Please cite the paper if you use this code in your own work:

@inproceedings{10.1145/3627673.3679709,
author = {Lee, Seunghan and Ko, Geonwoo and Song, Hyun-Je and Jung, Jinhong},
title = {MuLe: Multi-Grained Graph Learning for Multi-Behavior Recommendation},
year = {2024},
booktitle = {ACM International Conference on Information and Knowledge Management},
url = {https://doi.org/10.1145/3627673.3679709}
}