Skip to content

KDEGroup/HDRec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HDRec: Hybrid Dual-Semantics Modeling for Enhancing LLM-Based Recommendation

This repository contains the implementation of HDRec (WSDM 2026), a framework designed to enhance Large Language Model (LLM) based recommendation through hybrid dual-semantics modeling.


🚀 Getting Started

1. Environment Setup

We recommend using Conda to manage your environment. You can set up the environment directly using the provided hdrec.yml file:

# Create the environment from the yml file
conda env create -f hdrec.yml

# Activate the environment
conda activate hdrec

2. Data Preparation

  1. Download Raw Data: Obtain the original datasets from Amazon Product Data.
  2. Preprocessing: Run the following script to process the data into the required format:
python ./src/data/process_data_18.py
  1. Storage: Place the processed files in the ./data/ folder.

3. Model & Embedding Preparation

Pre-trained LLM

Download the backbone model from Hugging Face:

Collaborative Embeddings

We use RecBole to generate traditional collaborative filtering embeddings (e.g., SASRec).

  1. Train your preferred model (e.g., SASRec) using RecBole.
  2. Extract the embeddings and save them to: ./temp/SASRec/

4. Training and Evaluation

To start the training pipeline and run evaluations, use the provided shell script:

chmod +x run.sh
./run.sh

📑 Citation

If you find this work helpful, please cite our paper:

@inproceedings{liu2026hybrid,
  title={Hybrid Dual-Semantics Modeling for Enhancing Large Language Model Based Recommendation},
  author={Liu, Canyi and Li, Tianyi and Li, Wei and Zhang, Youchen and Li, Xiaodong and Li, Hui},
  booktitle={Proceedings of the Nineteenth ACM International Conference on Web Search and Data Mining (WSDM)},
  pages={396--405},
  year={2026},
  publisher={ACM}
}

About

Source code for WSDM'26 paper: "HDRec: Hybrid Dual-Semantics Modeling for Enhancing LLM-Based Recommendation".

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors