Skip to content

Xiaozhiyao/TokenRec

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TokenRec

A LLM-based Recommender System with user&item Tokenizers and a generative retrieval paradigm. The overall framework of the proposed TokenRec, which consists of the masked vector-quantized tokenizer with a K-way encoder for item ID tokenization and the generative retrieval paradigm for recommendation generation. Our paper is available at arXiv-TokenRec.

1743834485885

An example of Implementation

Please download the checkpoints at Google Drive, and put them in the path of "checkpoints/".

  1. Go to the path of "code"
python cd code
  1. Whole Pipeline
python main.py --dataset=LastFM --vq --train_vq --vq_model=MQ --n_token=256 --n_book=3
  1. Train from checkpoint (LLM)
python main.py --dataset=LastFM --n_token=256 --n_book=3 --train_from_checkpoint
  1. Evaluation
python main.py --dataset=LastFM --no_train

Citation

If this project is helpful to your research, please cite our papers:

Qu, Haohao, Wenqi Fan, Zihuai Zhao, and Qing Li. "Tokenrec: learning to tokenize id for llm-based generative recommendation." arXiv preprint arXiv:2406.10450 (2024).

@article{qu2024tokenrec,
  title={Tokenrec: learning to tokenize id for llm-based generative recommendation},
  author={Qu, Haohao and Fan, Wenqi and Zhao, Zihuai and Li, Qing},
  journal={arXiv preprint arXiv:2406.10450},
  year={2024}
}

About

A LLM-based Recommender System with user&item Tokenizers and a generative retrieval paradigm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%