This repository contains the official Pytorch implementation for the paper CIRS: Bursting Filter Bubbles by Counterfactual Interactive Recommender System. It also contains the two environments in the paper: VirtualTaobao (with the leave mechanism altered to penalize filter bubbles) and the proposed KuaishouEnv.
More descriptions are available via the paper and the slides.
If this work helps you, please kindly cite our papers:
@article{gao2023CIRS,
author = {Gao, Chongming and Wang, Shiqi and Li, Shijun and Chen, Jiawei and He, Xiangnan and Lei, Wenqiang and Li, Biao and Zhang, Yuan and Jiang, Peng},
title = {CIRS: Bursting Filter Bubbles by Counterfactual Interactive Recommender System},
journal = {ACM Transactions on Information Systems (TOIS)},
year = {2023},
volume = {42},
number = {1},
issn = {1046-8188},
url = {https://doi.org/10.1145/3594871},
doi = {10.1145/3594871},
month = {aug},
articleno = {14},
numpages = {27},
}
@inproceedings{gao2022kuairec,
author = {Gao, Chongming and Li, Shijun and Lei, Wenqiang and Chen, Jiawei and Li, Biao and Jiang, Peng and He, Xiangnan and Mao, Jiaxin and Chua, Tat-Seng},
title = {KuaiRec: A Fully-Observed Dataset and Insights for Evaluating Recommender Systems},
booktitle = {Proceedings of the 31st ACM International Conference on Information \& Knowledge Management},
series = {CIKM '22},
location = {Atlanta, GA, USA},
url = {https://doi.org/10.1145/3511808.3557220},
doi = {10.1145/3511808.3557220},
numpages = {11},
year = {2022},
pages = {540–550}
}
The details of VirtualTaobao can be referred to this repository. Note that we alter the exit mechanism to penalize filter bubbles. Specifically, in the original VirtualTaobao environment the length of interaction trajectory is fixed and predicted in advance, we change it so that the interaction will be terminated when the recommended items repeat in a short time.
Exiting mechanism: We compute the Euclidean distance between the recommended target and the most recent
KuaishouEnv is created by us in this project to evaluate interactive recommenders in video recommendation on Kuaishou, a video-sharing mobile App. Unlike VirtualTaobao which simulates real users by training a model on Taobao data, we use real user historical feedback in our environment.
It contains two matrices: big matrix and small matrix, where the latter is a fully filled user-item matrix. The statistics are shown in the following table. The details of data collection can be referred to the KuaiRec dataset (Webpage, Paper).
Exiting mechanism: For the most recent
-
Clone this git repository and change the directory to this repository:
git clone git@github.com:chongminggao/CIRS-codes.git cd CIRS-codes
-
A new conda environment is suggested.
conda create --name CIRS python=3.9 -y
-
Activate the newly created environment.
conda activate CIRS
-
Install the required
sh install.sh
Note that the implementation requires two platforms, DeepCTR-Torch and Tianshou. The codes of the two platforms have already been included in this repository and are altered here and there.
-
Download the compressed dataset
wget https://zenodo.org/records/10448452/files/"environment data.zip" # (md5:bb165aac072e00e5408ac5c159f38c1f)
(Download options: If the download via wget
is too slow, you can manually download the file to the root path of this repository)
-
Optional link 1: Google drive.
-
Optional link 2: Zenodo.
-
Optional link 3: USTC drive (for Chinese researchers)
-
Uncompress the downloaded
environment data.zip
and put the files in their corresponding positions.unzip "environment data.zip" mv environment\ data/KuaishouEnv/* environments/KuaishouRec/data/ mv environment\ data/VirtualTaobao/* environments/VirtualTaobao/virtualTB/SupervisedLearning/
If things go well, you can run the following examples now.
The following commands only give one argument --cuda 0
as an example. For more arguments, please kindly refer to the paper and the definitions in the code files.
-
Train the user model on historical logs
python3 CIRS-UserModel-taobao.py --cuda 0
-
Plan the RL policy using a trained user model
python3 CIRS-RL-taobao.py --cuda 0 --epoch 100 --message "my-CIRS"
-
Train the user model on historical logs
python3 CIRS-UserModel-kuaishou.py --cuda 0
-
Plan the RL policy using trained user model
python3 CIRS-RL-kuaishou.py --cuda 0 --epoch 100 --message "my-CIRS"
You can follow the guide to reproduce the main results of our paper, see this link.
Chongming Gao
USTC |
Shiqi Wang Chongqing University |