This repository contains the implementation code for the paper:
IGD: Token Decisiveness Modeling via Information Gain in LLMs for Personalized Recommendation
# Take the book dataset as an example
# Download the dataset
wget https://datarepo.eng.ucsd.edu/mcauley_group/data/amazon_v2/categoryFiles/Books.json.gz
wget https://datarepo.eng.ucsd.edu/mcauley_group/data/amazon_v2/metaFiles2/meta_Books.json.gz
# Unzip
gunzip Books.json.gz
gunzip meta_Books.json.gzconda create -n IGD python=3.10
conda activate IGD
pip install -r requirements.txt# Preprocess and extract Item-frequency information
bash compute_item_freq.shbash ig_monitor.shbetaadjusts the weight of zero-IG tokens.- To implement the baseline, set
beta=1.0. - For our method,
beta=0.1works well in general. You can grid search over:[0.08, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6]
bash evaluate.sh- Adjust the
alphaparameter in theevaluate.shscript:alpha=0.0is the baseline.- In the inference script, you can set:
(0.0 0.1 0.2 0.3 0.4) alpha=0.2generally yields the good results.
- For D3 method, set
length penaltyto0.0 - For BIGRec method, set the
length penaltyto1.0in the script.
- Uses
cft_monitor.py. According to the original paper, search over:beta = 0.09, 0.16, 0.29, 0.38, 0.5, 0.66, 0.9, 0.96alpha = 0.01, 0.02, 0.025, 0.05, 0.1, 0.2, 0.3
- Part of the CFT method. Set
alpha=0, and only tunebeta.
In our experiments, we trained our methods on an H100 96G GPU and tested on an A5000 GPU. Different hardware configurations may cause minor differences in results.