A Modular Framework for Recommender Systems in the Era of LLMs
gh repo clone Jyonn/Legommenders
cd Legommenders
pip install -r requirements.txt
python process.py --data mind
python embed.py --model bertbase
python trainer.py --data config/data/mind.yaml --model config/model/naml.yaml --hidden_size 256 --lr 0.001 --batch_size 64 --item_page_size 0 --embed config/embed/glove.yaml
python trainer.py --data config/data/mind.yaml --model config/model/nrms.yaml --hidden_size 256 --lr 0.001 --batch_size 64 --item_page_size 0 --embed config/embed/glove.yaml
python trainer.py
--data config/data/mind-lm.yaml
--model config/model/bert-naml.yaml
--hidden_size 256
--lr 0.0001
--batch_size 64
--item_page_size 128 # set it as large as possible based on your GPU memory
--embed config/embed/bert.yaml # generate the yaml first, by running python embed.py --model bertbase
--use_lora 1
--lora_r 8
--lora_alpha 128
--lm bert # indicate the language model
--tune_from -2 # freeze the first N-1 layers, and tune the last layer, it is the same as --tune_from 10
python trainer.py
--data config/data/mind-lm-prompt.yaml # for more powerful language models, we suggest to use the data concatenated with natural prompts
--model config/model/llama-naml.yaml
--hidden_size 256
--lr 0.0001
--batch_size 64
--item_page_size 64
--embed config/embed/llama.yaml # generate the yaml first, by running python embed.py --model llama1
--use_lora 1
--lora_r 32
--lora_alpha 128
--lm llama1
--tune_from -2 # freeze the first N-1 layers, and tune the last layer, it is the same as --tune_from 30
More documentations will be available soon.
- Legommenders v2.0 beta is released!
- LSTUR model is now re-added to the Legommenders package, which was not compatible from Jan. 2024.
- LLMs can be used for item encoder.
- Legommenders partially supports the flatten sequential recommendation model.
- New models are added, including: MaskNet, GDCN, etc.
- We clean the code and convert names of the item-side parameters.
- The first recommender system package, Legommenders, with a modular-design is released!
- Legommenders involves a set of recommender system algorithms, including:
- Matching based methods: NAML, NRMS, LSTUR, etc.
- Ranking based methods: DCN, DeepFM, PNN, etc.
Legommenders have served as a fundamental framework for several research projects, including ONCE, SPAR,GreenRec, and UIST. If you find Legommenders useful in your research, please consider citing our project:
@article{legommenders,
title={Legommenders: A Comprehensive Content-Based Recommendation Library with LLM Support},
author={Liu, Qijiong and Fan, Lu and Wu, Xiao-Ming},
journal={arXiv preprint arXiv:2412.15973},
year={2024}
}