• Stars
    star
    205
  • Rank 187,137 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created about 1 year ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[ECIR'24] Implementation of "Large Language Models are Zero-Shot Rankers for Recommender Systems"

LLMRank

LLMRank aims to investigate the capacity of LLMs that act as the ranking model for recommender systems.

See our paper: Large Language Models are Zero-Shot Rankers for Recommender Systems

The code here is aligned with the new version in submission, please refer to [arxiv-branch] for the code that is aligned with our arXiv paper.

๐Ÿ›๏ธ LLMs as Zero-Shot Rankers

We use LLMs as ranking models in an instruction-following paradigm. For each user, we first construct two natural language patterns that contain sequential interaction histories and retrieved candidate items, respectively. Then these patterns are filled into a natural language template as the final instruction. In this way, LLMs are expected to understand the instructions and output the ranking results as the instruction suggests.

๐Ÿš€ Quick Start

  1. Write your own OpenAI API keys into llmrank/openai_api.yaml.
  2. Unzip dataset files.
    cd llmrank/dataset/ml-1m/; unzip ml-1m.inter.zip
    cd llmrank/dataset/Games/; unzip Games.inter.zip
    For data preparation details, please refer to [data-preparation].
  3. Install dependencies.
    pip install -r requirements.txt
  4. Evaluate ChatGPT's zero-shot ranking abilities on ML-1M dataset.
    cd llmrank/
    python evaluate.py -m Rank

๐Ÿ” Key Findings

Please click the links below each "Observation" to find the code and scripts to reproduce the results.

Observation 1. LLMs struggle to perceive order of user historie, but can be triggered to perceive the orders

LLMs can utilize historical behaviors for personalized ranking, but struggle to perceive the order of the given sequential interaction histories.

By employing specifically designed promptings, such as recency-focused prompting and in-context learning, LLMs can be triggered to perceive the order of historical user behaviors, leading to improved ranking performance.

Code is here -> [reproduction scripts]

Observation 2. Biases exist in using LLMs to rank

LLMs suffer from position bias and popularity bias while ranking, which can be alleviated by specially designed prompting or bootstrapping strategies.

Code is here -> [reproduction scripts]

Observation 3. Promising zero-shot ranking abilities

LLMs have promising zero-shot ranking abilities, especially on candidates retrieved by multiple candidate generation models with different practical strategies.

Code is here -> [reproduction scripts]

๐ŸŒŸ Acknowledgement

Please cite the following paper if you find our code helpful.

@article{hou2023llmrank,
  title={Large Language Models are Zero-Shot Rankers for Recommender Systems},
  author={Yupeng Hou and Junjie Zhang and Zihan Lin and Hongyu Lu and Ruobing Xie and Julian McAuley and Wayne Xin Zhao},
  journal={arXiv preprint arXiv:2305.08845},
  year={2023}
}

The experiments are conducted using the open-source recommendation library RecBole.

We use the released pre-trained models of UniSRec and VQ-Rec in our zero-shot recommendation benchmarks.

Thanks @neubig for the amazing implementation of asynchronous dispatching OpenAI APIs. [code]

More Repositories

1

LLMSurvey

The official GitHub page for the survey paper "A Survey of Large Language Models".
Python
9,332
star
2

RecBole

A unified, comprehensive and efficient recommendation library
Python
3,243
star
3

TextBox

TextBox 2.0 is a text generation library with pre-trained language models
Python
1,065
star
4

Awesome-RSPapers

Recommender System Papers
902
star
5

RecSysDatasets

This is a repository of public data sources for Recommender Systems (RS).
Python
739
star
6

CRSLab

CRSLab is an open-source toolkit for building Conversational Recommender System (CRS).
Python
474
star
7

LLMBox

A comprehensive library for implementing LLMs, including a unified training pipeline and comprehensive model evaluation.
Python
410
star
8

Top-conference-paper-list

A collection of classified and organized top conference paper list.
362
star
9

HaluEval

This is the repository of HaluEval, a large-scale hallucination evaluation benchmark for Large Language Models.
Python
298
star
10

Negative-Sampling-Paper

This repository collects 100 papers related to negative sampling methods.
173
star
11

DenseRetrieval

170
star
12

RecBole2.0

An up-to-date, comprehensive and flexible recommendation library
167
star
13

Awesome-KBQA

Paper list of KBQA
167
star
14

RecBole-GNN

Efficient and extensible GNNs enhanced recommender library based on RecBole.
Python
159
star
15

UniSRec

[KDD'22] Official PyTorch implementation for "Towards Universal Sequence Representation Learning for Recommender Systems".
Python
158
star
16

NCL

[WWW'22] Official PyTorch implementation for "Improving Graph Collaborative Filtering with Neighborhood-enriched Contrastive Learning".
Python
113
star
17

RSPapers

Must-read papers on Recommender System. ๆŽจ่็ณป็ปŸ็›ธๅ…ณ่ฎบๆ–‡ๆ•ด็†๏ผˆๅ†…ๅซ40็ฏ‡่ฎบๆ–‡๏ผŒๅนถๆŒ็ปญๆ›ดๆ–ฐไธญ๏ผ‰
89
star
18

RecBole-CDR

This is a library built upon RecBole for cross-domain recommendation algorithms
Python
78
star
19

CRSPapers

Conversational Recommender System (CRS) paper list. ๅฏน่ฏๆŽจ่็ณป็ปŸ่ฎบๆ–‡ๅˆ—่กจ
78
star
20

MVP

This repository is the official implementation of our paper MVP: Multi-task Supervised Pre-training for Natural Language Generation.
67
star
21

VQ-Rec

[WWW'23] PyTorch implementation for "Learning Vector-Quantized Item Representation for Transferable Sequential Recommenders".
Python
51
star
22

RecBole-PJF

Python
46
star
23

ChatCoT

The official repository of "ChatCoT: Tool-Augmented Chain-of-Thought Reasoning on Chat-based Large Language Models"
Python
41
star
24

CORE

[SIGIR'22] Official PyTorch implementation for "CORE: Simple and Effective Session-based Recommendation within Consistent Representation Space".
Python
38
star
25

Multi-View-Co-Teaching

Code for our CIKM 2020 paper "Learning to Match Jobs with Resumes from Sparse Interaction Data using Multi-View Co-Teaching Network"
Python
29
star
26

DCLR

Code of ACL 2022 paper Debiased Contrastive Learning of Unsupervised Sentence Representations
Python
29
star
27

JiuZhang

Our code will be public soon .
Python
25
star
28

ELMER

This repository is the official implementation of our EMNLP 2022 paper ELMER: A Non-Autoregressive Pre-trained Language Model for Efficient and Effective Text Generation
Python
24
star
29

BAMBOO

Python
23
star
30

Language-Specific-Neurons

Python
17
star
31

RecBole-DA

Python
17
star
32

CARP

Python
16
star
33

SAFE

The pytorch implementation of the SAFE model presented in NAACL-Findings-2022
Python
16
star
34

RecBole-TRM

Python
13
star
35

Erya

12
star
36

MML

Python
12
star
37

Context-Tuning

This is the repository for COLING 2022 paper "Context-Tuning: Learning Contextualized Prompts for Natural Language Generation".
11
star
38

UniWeb

The official repository for our ACL 2023 Findings paper: The Web Can Be Your Oyster for Improving Language Models
9
star
39

PPGM

[ICDM'22] PyTorch implementation for "Privacy-Preserved Neural Graph Similarity Learning".
Python
6
star
40

LIVE

The official repository our ACL 2023 paper: "Learning to Imagine: Visually-Augmented Natural Language Generation"."
Python
5
star
41

Social-Datasets

A collection of social datasets for RecBole-GNN.
5
star
42

M3SRec

4
star
43

FIGA

Python
3
star
44

Contrastive-Curriculum-Learning

Python
3
star
45

Data-CUBE

3
star
46

Div-Ref

The official repository of "Not All Metrics Are Guilty: Improving NLG Evaluation Diversifying References".
Python
2
star
47

GenRec

Python
1
star
48

ETRec

Python
1
star