BlueGhostYi/ID-GRec

ID-based Graph Recommendation Framework (PyTorch)

Python

37

89 commits

updated Mar 25, 2026

See the code

README

ID-GRec

ID-based Graph Recommendation Framework (PyTorch)


ID-GRec is a graph recommendation framework based on Python and Pytorch, which contains the current mainstream and latest graph recommendation methods, the most classic datasets, evaluation metrics and testing processes. One of the advantages of ID-GRec is that it is easy to get started, with a simple configuration of the model parameters, and the training can be executed in a simple one-step commands without any other operations.

ID-GRec is dedicated to exploring the latest research results on graph-based recommender systems and comparing them in a unified framework. Therefore, we adopt LightGCN, a classic work on graph recommender systems, as a benchmark in ID-GRec and refer to a large number of related works and frameworks. Further, we roughly categorize the existing methods into graph neural network-based methods (GNN) and graph self-supervised learning-based methods (SSL). And they are compared under a unified framework, which includes publications in various flagship conferences and journals in recent years. In addition, we also simply implement BPRMF as a most basic comparison baseline as well as an extensible template.

Environment (based on our test platform)

python == 3.8.18
pytorch == 2.1.0 (cuda:12.1)
scipy == 1.10.1
numpy == 1.24.3
tdqm == 4.65.0

For some special models, additional third-party libraries may be required.

Examples to Run

Steps to run the code (MODEL_NAME is the name of the model):

  1. In the folder . /configure to configure the MODEL_NAME.txt file;
  2. Run main.py python main.py and select the identifier of MODEL_NAME or specify through the command line:python main.py --model=MODEL_NAME

Example: If you want to run LightGCN:

  1. In the folder . /configure to configure the LightGCN.txt file;
  2. Run main.py python main.py and select the identifier of LightGCN or specify through the command line:python main.py --model=LightGCN

Implemented Model List

Model NamePaperPublicationType
BPRMFBPR: Bayesian Personalized Ranking from Implicit Feedback [Paper]UAI'09base
GC-MCGraph Convolutional Matrix Completion [Paper]KDD'17GNN
LR-GCCFRevisiting Graph based Collaborative Filtering: A Linear Residual Graph Convolutional Network Approach [Paper]AAAI'20GNN
NGCFNeural graph collaborative filtering [Paper]SIGIR'19GNN
LightGCNLightGCN: Simplifying and Powering Graph Convolution Network for Recommendation [Paper]SIGIR'20GNN
IMP-GCNInterest-aware Message-passing GCN for Recommendation [Paper]WWW'21GNN
SGLSelf-supervised Graph Learning for Recommendation [Paper]SIGIR'21GNN+SSL
CVGARevisiting Graph-based Recommender Systems from the Perspective of Variational Auto-Encoder [Paper]TOIS'22GNN+SSL
SimGCLAre Graph Augmentations Necessary? Simple Graph Contrastive Learning for Recommendation [Paper]SIGIR'22GNN+SSL
DirectAUTowards Representation Alignment and Uniformity in Collaborative Filtering [Paper]KDD'22(GNN)+SSL
NCLImproving graph collaborative filtering with neighborhood-enriched contrastive learning [Paper]WWW'22GNN+SSL
HCCFHypergraph Contrastive Collaborative Filtering [Paper]SIGIR'22GNN+SSL
XSimGCLXSimGCL: Towards Extremely Simple Graph Contrastive Learning for Recommendation [Paper]TKDE'23GNN+SSL
LightGCLLightGCL: Simple Yet Effective Graph Contrastive Learning for Recommendation [Paper]ICLR'23GNN+SSL
DCCFDisentangled Contrastive Collaborative Filtering [Paper]SIGIR'23GNN+SSL
CGCLCandidate–aware Graph Contrastive Learning for Recommendation [Paper]SIGIR'23GNN+SSL
MAWUToward a Better Understanding of Loss Functions for Collaborative Filtering [Paper]CIKM'23GNN+SSL
RecDCLRecDCL: Dual Contrastive Learning for Recommendation [Paper]WWW'24GNN+SSL
BIGCFExploring the Individuality and Collectivity of Intents behind Interactions for Graph Collaborative Filtering [Paper]SIGIR'24GNN+SSL
SCCFUnifying Graph Convolution and Contrastive Learning in Collaborative Filtering [Paper]KDD'24(GNN)+SSL
LightGCN++Revisiting LightGCN: Unexpected Inflexibility, Inconsistency, and A Remedy Towards Improved Recommendation [Paper]RecSys'24GNN
LightGODEDo We Really Need Graph Convolution During Training? Light Post-Training Graph-ODE for Efficient Recommendation [Paper]CIKM'24GNN
EGCFSimplify to the Limit! Embedding-less Graph Collaborative Filtering for Recommender Systems [Paper]TOIS'24GNN+SSL
MixRecMixRec: Individual and Collective Mixing Empowers Data Augmentation for Recommender Systems [Paper]WWW'25(GNN)+SSL
LightCCFUnveiling Contrastive Learning’s Capability of Neighborhood Aggregation for Collaborative Filtering [Paper]SIGIR'25(GNN)+SSL
LightCSCFRevisiting Contrastive Learning in Collaborative Filtering via Parallel Graph Filters [Paper]AAAI'26(GNN)+SSL

Configuration File Description

The folder named “configure” contains the hyperparameters, datasets, and other miscellaneous settings for all implemented methods. Except for model-specific hyperparameters, the settings listed at the top are common to all models. Using LightGCN.txt as an example, the following provides an introduction to the common settings:

  1. dataset_path = ./dataset/`: Specifies the file path to the folder containing the dataset files.
  2. dataset = yelp2018: Sets the name of the dataset to be used, in this case, "yelp2018."
  3. top_K = [5, 10, 20]: Defines the list of top-K values for evaluation metrics, meaning the model will evaluate its performance using the top 5, top 10, and top 20 predictions.
  4. training_epochs = 1000: Specifies the number of training epochs, or iterations over the entire dataset, set to 1000.
  5. early_stopping = 10: Sets the early stopping criterion; training will halt if there's no improvement in performance for 10 consecutive tests.
  6. embedding_size = 64: Defines the size of the embeddings (or the dimensionality of the embedding vectors) for the model, set to 64.
  7. batch_size = 2048: Sets the number of samples in each batch for training, with 2048 samples per batch.
  8. test_batch_size = 200: Specifies the number of samples in each batch for testing, set to 200.
  9. learn_rate = 0.001: Sets the learning rate, which controls the step size during optimization, to 0.001.
  10. reg_lambda = 0.0001: Specifies the regularization parameter (often for weight decay), which helps prevent overfitting, set to 0.0001.
  11. GCN_layer = 3: Defines the number of graph convolutional network (GCN) layers in the model, set to 3.
  12. sparsity_test = 0: Indicates whether a sparsity test is performed. Setting this to 0 generally means the sparsity test is disabled. If you want to perform a sparsity test, please set it to 1.

Basic Comparisons

Taking the Yelp2018 dataset provided in the LightGCN paper as an example, the following table presents the reproduced results from ID-GRec with the results reported in the original paper (all publications that used the Yelp2018 dataset):

Model NameRecall@20 (paper)Recall@20 (ID-GRec)NDCG@20 (paper)NDCG@20 (ID-GRec)
BPRMF-0.0554-0.0453
NGCF0.05790.05730.04770.0465
LightGCN0.06390.06410.05250.0527
SGL-ED0.06750.06750.05550.0555
CVGA0.06940.06910.05710.0570
SimGCL0.07210.07220.06010.0599
XSimGCL0.07230.07240.06040.0599
EGCF0.07480.07490.06170.0619

Acknowledgement

ID-GRec is based on numerous outstanding existing works. We have mainly drawn on the following open-source frameworks and would like to express our sincere gratitude for their contributions:

LightGCN: https://github.com/gusye1234/LightGCN-PyTorch and https://github.com/kuandeng/LightGCN (Training process, testing metric calculations, and original datasets)

NGCF: https://github.com/xiangwang1223/neural_graph_collaborative_filtering (Sparsity testing process)

SelfRec: https://github.com/Coder-Yu/SELFRec (Framework design process)

SSLRec: https://github.com/HKUDS/SSLRec (Output log)

All the implemented methods in ID-GRec have been reproduced and integrated based on the source code provided by the original authors. Due to limitations in time and personal capabilities, there may be errors in the implementation of some models. We sincerely apologize if this causes any inconvenience to your research. If you have any questions regarding ID-GRec, please contact zhangyi.ahu@gmail.com.

Citation

If you find this work is helpful to your research, please consider citing our paper:

@article{zhang2024simplify,
  title={Simplify to the Limit! Embedding-less Graph Collaborative Filtering for Recommender Systems},
  author={Zhang, Yi and Zhang, Yiwen and Sang, Lei and Sheng, Victor S},
  journal={ACM Transactions on Information Systems},
  year={2024},
  publisher={ACM New York, NY}
}

Contributors

BlueGhostYi

89 commits

BlueGhostYi/ID-GRec

ID-based Graph Recommendation Framework (PyTorch)

Python

37

89 commits

updated Mar 25, 2026

See the code

README

ID-GRec

ID-based Graph Recommendation Framework (PyTorch)


ID-GRec is a graph recommendation framework based on Python and Pytorch, which contains the current mainstream and latest graph recommendation methods, the most classic datasets, evaluation metrics and testing processes. One of the advantages of ID-GRec is that it is easy to get started, with a simple configuration of the model parameters, and the training can be executed in a simple one-step commands without any other operations.

ID-GRec is dedicated to exploring the latest research results on graph-based recommender systems and comparing them in a unified framework. Therefore, we adopt LightGCN, a classic work on graph recommender systems, as a benchmark in ID-GRec and refer to a large number of related works and frameworks. Further, we roughly categorize the existing methods into graph neural network-based methods (GNN) and graph self-supervised learning-based methods (SSL). And they are compared under a unified framework, which includes publications in various flagship conferences and journals in recent years. In addition, we also simply implement BPRMF as a most basic comparison baseline as well as an extensible template.

Environment (based on our test platform)

python == 3.8.18
pytorch == 2.1.0 (cuda:12.1)
scipy == 1.10.1
numpy == 1.24.3
tdqm == 4.65.0

For some special models, additional third-party libraries may be required.

Examples to Run

Steps to run the code (MODEL_NAME is the name of the model):

  1. In the folder . /configure to configure the MODEL_NAME.txt file;
  2. Run main.py python main.py and select the identifier of MODEL_NAME or specify through the command line:python main.py --model=MODEL_NAME

Example: If you want to run LightGCN:

  1. In the folder . /configure to configure the LightGCN.txt file;
  2. Run main.py python main.py and select the identifier of LightGCN or specify through the command line:python main.py --model=LightGCN

Implemented Model List

Model NamePaperPublicationType
BPRMFBPR: Bayesian Personalized Ranking from Implicit Feedback [Paper]UAI'09base
GC-MCGraph Convolutional Matrix Completion [Paper]KDD'17GNN
LR-GCCFRevisiting Graph based Collaborative Filtering: A Linear Residual Graph Convolutional Network Approach [Paper]AAAI'20GNN
NGCFNeural graph collaborative filtering [Paper]SIGIR'19GNN
LightGCNLightGCN: Simplifying and Powering Graph Convolution Network for Recommendation [Paper]SIGIR'20GNN
IMP-GCNInterest-aware Message-passing GCN for Recommendation [Paper]WWW'21GNN
SGLSelf-supervised Graph Learning for Recommendation [Paper]SIGIR'21GNN+SSL
CVGARevisiting Graph-based Recommender Systems from the Perspective of Variational Auto-Encoder [Paper]TOIS'22GNN+SSL
SimGCLAre Graph Augmentations Necessary? Simple Graph Contrastive Learning for Recommendation [Paper]SIGIR'22GNN+SSL
DirectAUTowards Representation Alignment and Uniformity in Collaborative Filtering [Paper]KDD'22(GNN)+SSL
NCLImproving graph collaborative filtering with neighborhood-enriched contrastive learning [Paper]WWW'22GNN+SSL
HCCFHypergraph Contrastive Collaborative Filtering [Paper]SIGIR'22GNN+SSL
XSimGCLXSimGCL: Towards Extremely Simple Graph Contrastive Learning for Recommendation [Paper]TKDE'23GNN+SSL
LightGCLLightGCL: Simple Yet Effective Graph Contrastive Learning for Recommendation [Paper]ICLR'23GNN+SSL
DCCFDisentangled Contrastive Collaborative Filtering [Paper]SIGIR'23GNN+SSL
CGCLCandidate–aware Graph Contrastive Learning for Recommendation [Paper]SIGIR'23GNN+SSL
MAWUToward a Better Understanding of Loss Functions for Collaborative Filtering [Paper]CIKM'23GNN+SSL
RecDCLRecDCL: Dual Contrastive Learning for Recommendation [Paper]WWW'24GNN+SSL
BIGCFExploring the Individuality and Collectivity of Intents behind Interactions for Graph Collaborative Filtering [Paper]SIGIR'24GNN+SSL
SCCFUnifying Graph Convolution and Contrastive Learning in Collaborative Filtering [Paper]KDD'24(GNN)+SSL
LightGCN++Revisiting LightGCN: Unexpected Inflexibility, Inconsistency, and A Remedy Towards Improved Recommendation [Paper]RecSys'24GNN
LightGODEDo We Really Need Graph Convolution During Training? Light Post-Training Graph-ODE for Efficient Recommendation [Paper]CIKM'24GNN
EGCFSimplify to the Limit! Embedding-less Graph Collaborative Filtering for Recommender Systems [Paper]TOIS'24GNN+SSL
MixRecMixRec: Individual and Collective Mixing Empowers Data Augmentation for Recommender Systems [Paper]WWW'25(GNN)+SSL
LightCCFUnveiling Contrastive Learning’s Capability of Neighborhood Aggregation for Collaborative Filtering [Paper]SIGIR'25(GNN)+SSL
LightCSCFRevisiting Contrastive Learning in Collaborative Filtering via Parallel Graph Filters [Paper]AAAI'26(GNN)+SSL

Configuration File Description

The folder named “configure” contains the hyperparameters, datasets, and other miscellaneous settings for all implemented methods. Except for model-specific hyperparameters, the settings listed at the top are common to all models. Using LightGCN.txt as an example, the following provides an introduction to the common settings:

  1. dataset_path = ./dataset/`: Specifies the file path to the folder containing the dataset files.
  2. dataset = yelp2018: Sets the name of the dataset to be used, in this case, "yelp2018."
  3. top_K = [5, 10, 20]: Defines the list of top-K values for evaluation metrics, meaning the model will evaluate its performance using the top 5, top 10, and top 20 predictions.
  4. training_epochs = 1000: Specifies the number of training epochs, or iterations over the entire dataset, set to 1000.
  5. early_stopping = 10: Sets the early stopping criterion; training will halt if there's no improvement in performance for 10 consecutive tests.
  6. embedding_size = 64: Defines the size of the embeddings (or the dimensionality of the embedding vectors) for the model, set to 64.
  7. batch_size = 2048: Sets the number of samples in each batch for training, with 2048 samples per batch.
  8. test_batch_size = 200: Specifies the number of samples in each batch for testing, set to 200.
  9. learn_rate = 0.001: Sets the learning rate, which controls the step size during optimization, to 0.001.
  10. reg_lambda = 0.0001: Specifies the regularization parameter (often for weight decay), which helps prevent overfitting, set to 0.0001.
  11. GCN_layer = 3: Defines the number of graph convolutional network (GCN) layers in the model, set to 3.
  12. sparsity_test = 0: Indicates whether a sparsity test is performed. Setting this to 0 generally means the sparsity test is disabled. If you want to perform a sparsity test, please set it to 1.

Basic Comparisons

Taking the Yelp2018 dataset provided in the LightGCN paper as an example, the following table presents the reproduced results from ID-GRec with the results reported in the original paper (all publications that used the Yelp2018 dataset):

Model NameRecall@20 (paper)Recall@20 (ID-GRec)NDCG@20 (paper)NDCG@20 (ID-GRec)
BPRMF-0.0554-0.0453
NGCF0.05790.05730.04770.0465
LightGCN0.06390.06410.05250.0527
SGL-ED0.06750.06750.05550.0555
CVGA0.06940.06910.05710.0570
SimGCL0.07210.07220.06010.0599
XSimGCL0.07230.07240.06040.0599
EGCF0.07480.07490.06170.0619

Acknowledgement

ID-GRec is based on numerous outstanding existing works. We have mainly drawn on the following open-source frameworks and would like to express our sincere gratitude for their contributions:

LightGCN: https://github.com/gusye1234/LightGCN-PyTorch and https://github.com/kuandeng/LightGCN (Training process, testing metric calculations, and original datasets)

NGCF: https://github.com/xiangwang1223/neural_graph_collaborative_filtering (Sparsity testing process)

SelfRec: https://github.com/Coder-Yu/SELFRec (Framework design process)

SSLRec: https://github.com/HKUDS/SSLRec (Output log)

All the implemented methods in ID-GRec have been reproduced and integrated based on the source code provided by the original authors. Due to limitations in time and personal capabilities, there may be errors in the implementation of some models. We sincerely apologize if this causes any inconvenience to your research. If you have any questions regarding ID-GRec, please contact zhangyi.ahu@gmail.com.

Citation

If you find this work is helpful to your research, please consider citing our paper:

@article{zhang2024simplify,
  title={Simplify to the Limit! Embedding-less Graph Collaborative Filtering for Recommender Systems},
  author={Zhang, Yi and Zhang, Yiwen and Sang, Lei and Sheng, Victor S},
  journal={ACM Transactions on Information Systems},
  year={2024},
  publisher={ACM New York, NY}
}

Contributors

BlueGhostYi

89 commits

Languages

Python

100.0%