dayuyang1999/ReGeS

71

stars

2

commits

Python

primary language

Sep 29, 2025

updated

README

ReGeS

This repository contains the official implementation of ReGeS — a domain-agnostic framework that unifies Retrieval and Generation in synergy for conversational recommender systems (CRS).

Overview

Modern RAG-based CRS often suffer from challenges in query reformulation and item generation, leading to less accurate recommendations. ReGeS addresses these challenges by integrating:

  • Generation-Augmented Query Reformulator: Transforms lengthy, noisy conversation text into concise, information-rich queries.
  • Efficient Retriever: Retrieves relevant candidate items based on the refined queries.
  • Retrieval-Augmented Item Generator: Distinguishes fine-grained differences among similar candidates to produce accurate recommendations.

ReGeS requires no additional human annotations or domain-specific feature engineering, making the approach flexible and applicable across diverse recommendation scenarios.

Datasets

Our evaluation of ReGeS covers extensive experiments on two widely used conversational recommendation datasets:

  • ReDial: Consisting of ~10K dialogues about movie recommendations. Although ReDial features more dialogues with shorter conversation turns, the candidate pool is large, making retrieval a challenging task.

    Example conversation from ReDial (showing typical short, less informative interaction):

    SEEKER: Hi I am looking for a movie like Super Troopers (2001)
    RECOMMENDER: You should watch Police Academy (1984)
    SEEKER: Is that a great one? I have never seen it. I have seen American Pie (1999)
    
  • INSPIRED: Comprising fewer but higher-quality dialogues with richer user preference details.

    Example conversation from INSPIRED (showing typical in-depth preference exploration):

    RECOMMENDER: Hi! I'm here to help you chose a movie!
    SEEKER: Terrific
    RECOMMENDER: What are some genres you like? What was the last movie you saw?
    SEEKER: the last movie i saw in the theater was Hustlers. I generally like comedy, drama and documentaries
    RECOMMENDER: How did you like Hustlers? It definitely has the drama aspect, did it leave you wanting more or was it not exactly what you were looking for?
    SEEKER: I liked it, it wasn't the most high-brow movie i've ever seen but it was fun. I like to just enjoy
    RECOMMENDER: And what are your thoughts on action in film?
    SEEKER: I like some action. Just not too violent
    

As shown in these examples, INSPIRED conversations typically feature more turns and deeper exploration of user preferences, while ReDial conversations tend to be shorter and more direct, making preference inference more challenging.

Evaluated Baselines

ReGeS is compared against three groups of methods:

  • Traditional Representation-Based Methods: Such as KBRD, KGSF, and UniCRS which integrate external knowledge bases like DBpedia and ConceptNet.
  • LLM-Based Methods: Including closed-source systems like GPT-3.5-turbo and GPT-4, as well as open-source models like Vicuna-13B.
  • Retrieval-Augmented Methods: Examples include RAMO and RARS, which combine retrieval results with large language models for final recommendations.

Implementation Details

We evaluate ReGeS with the following configurations:

  • LLMs:

    • Gemma-2B
    • LLaMA3.1-8B
    • Gemma-27B
  • Retrievers:

    • DPR (110M parameters; hidden dim = 768)
    • BGE-large-1.5-en (340M parameters; hidden dim = 1024)
    • OpenAI text-embedding-3-large (hidden dim = 3074)

Our baseline implementations follow published code for UniCRS, KBRD, and KGSF, while LLM-based and retrieval-augmented methods were re-implemented as described in prior works.

Environment Setup

  1. Create and activate the conda environment:

    conda env create -f environment.yml
    conda activate reages
    
  2. Clone LLaMA-Factory (required for model training):

    git clone --branch v0.9.1 --depth 1 https://github.com/hiyouga/LLaMA-Factory.git
    
  3. Set up your OpenAI API key:

    export OPENAI_API_KEY=<your_openai_api_key>
    
  4. Create required directories:

    mkdir -p data/saved_models data/saved_adaptors
    

Note: Ensure your working directory is set appropriately (e.g., ../ReGeS/) for correct relative path resolution.

Model Setup

Base Models

Download the following base models:

# Gemma-2B
huggingface-cli download google/gemma-2-2b-it --local-dir data/saved_models/gemma2b

# LLaMA 3.1-8B
huggingface-cli download meta-llama/Llama-3.1-8b-instruct --local-dir data/saved_models/llama3.1-8b-instruct

# Gemma-27B
huggingface-cli download google/gemma-2-27b-it --local-dir data/saved_models/gemma27b

Fine-tuned Models

Download the pre-trained models for each ReGeS module:

  1. Generation-Augmented Query Reformulator Models:

    huggingface-cli download Dylan1999/gemma2b_ssl --local-dir data/saved_models/gemma2b_ssl
    huggingface-cli download Dylan1999/llama3.1-8b-instruct_ssl --local-dir data/saved_models/llama3.1-8b-instruct_ssl
    huggingface-cli download Dylan1999/gemma27b_ssl --local-dir data/saved_models/gemma27b_ssl
    
  2. Retrieval-Augmented Item Generator Models:

    huggingface-cli download Dylan1999/gemma-2b_select --local-dir data/saved_models/gemma2b_select
    huggingface-cli download Dylan1999/llama-8b_select --local-dir data/saved_models/llama3.1-8b-instruct_select
    huggingface-cli download Dylan1999/gemma-27b_select --local-dir data/saved_models/gemma27b_select
    
  3. Chain-of-Thought (CoT) Models:

    huggingface-cli download Dylan1999/gemma-2b_cot --local-dir data/saved_models/gemma2b_cot
    huggingface-cli download Dylan1999/llama-8b_cot --local-dir data/saved_models/llama3.1-8b-instruct_cot
    huggingface-cli download Dylan1999/gemma-27b_cot --local-dir data/saved_models/gemma27b_cot
    

Running Experiments

Main Experiments

  1. Generate queries using the Generation-Augmented Query Reformulator:

    bash experiments/main/retrieval/G-enhanced-retrieval.sh
    
  2. Run the Retrieval-Augmented Item Generator:

    bash experiments/main/select/R-enhanced-generation.sh
    
  3. Evaluate recommendations:

    bash experiments/main/eval.sh
    

Chain-of-Thought (CoT) Experiments

  1. Run CoT experiments:

    bash experiments/cot/cot.sh
    
  2. Evaluate CoT results:

    python src/eval/cot_eval.py
    

Custom Model Training (Optional)

If you prefer training your own models rather than using the pre-trained versions, configuration files are provided in the configs/ directory.

Main Component Training

bash experiments/main/retrieval/G-enhanced-retrieval-ft.sh
bash experiments/main/select/R-enhanced-generation-ft.sh

CoT Training

bash experiments/cot/cot_ft.sh

Model Configurations

Following our paper, ReGeS is evaluated using three settings:

  • Small: DPR retriever (110M parameters) + Gemma-2B.
  • Middle: BGE-large-1.5-en retriever (340M parameters) + LLaMA3.1-8B.
  • Large: OpenAI text-embedding-3-large retriever + Gemma-27B.

Citation

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

@article{yang2025reges,
  title         = {ReGeS: Reciprocal Retrieval-Generation Synergy for Conversational Recommender Systems},
  author        = {Yang, Dayu and Fang, Hui},
  year          = {2025},
  month         = {sep},
  journal       = {arXiv preprint arXiv:2509.21371},
  archivePrefix = {arXiv},
  eprint        = {2509.21371},
  primaryClass  = {cs.IR},
  doi           = {10.48550/arXiv.2509.21371},
  url           = {https://arxiv.org/abs/2509.21371},
  note          = {Accepted at WISE 2025}
}

Contributors

dayuyang1999

2 commits

dayuyang1999/ReGeS

71

stars

2

commits

Python

primary language

Sep 29, 2025

updated

README

ReGeS

This repository contains the official implementation of ReGeS — a domain-agnostic framework that unifies Retrieval and Generation in synergy for conversational recommender systems (CRS).

Overview

Modern RAG-based CRS often suffer from challenges in query reformulation and item generation, leading to less accurate recommendations. ReGeS addresses these challenges by integrating:

  • Generation-Augmented Query Reformulator: Transforms lengthy, noisy conversation text into concise, information-rich queries.
  • Efficient Retriever: Retrieves relevant candidate items based on the refined queries.
  • Retrieval-Augmented Item Generator: Distinguishes fine-grained differences among similar candidates to produce accurate recommendations.

ReGeS requires no additional human annotations or domain-specific feature engineering, making the approach flexible and applicable across diverse recommendation scenarios.

Datasets

Our evaluation of ReGeS covers extensive experiments on two widely used conversational recommendation datasets:

  • ReDial: Consisting of ~10K dialogues about movie recommendations. Although ReDial features more dialogues with shorter conversation turns, the candidate pool is large, making retrieval a challenging task.

    Example conversation from ReDial (showing typical short, less informative interaction):

    SEEKER: Hi I am looking for a movie like Super Troopers (2001)
    RECOMMENDER: You should watch Police Academy (1984)
    SEEKER: Is that a great one? I have never seen it. I have seen American Pie (1999)
    
  • INSPIRED: Comprising fewer but higher-quality dialogues with richer user preference details.

    Example conversation from INSPIRED (showing typical in-depth preference exploration):

    RECOMMENDER: Hi! I'm here to help you chose a movie!
    SEEKER: Terrific
    RECOMMENDER: What are some genres you like? What was the last movie you saw?
    SEEKER: the last movie i saw in the theater was Hustlers. I generally like comedy, drama and documentaries
    RECOMMENDER: How did you like Hustlers? It definitely has the drama aspect, did it leave you wanting more or was it not exactly what you were looking for?
    SEEKER: I liked it, it wasn't the most high-brow movie i've ever seen but it was fun. I like to just enjoy
    RECOMMENDER: And what are your thoughts on action in film?
    SEEKER: I like some action. Just not too violent
    

As shown in these examples, INSPIRED conversations typically feature more turns and deeper exploration of user preferences, while ReDial conversations tend to be shorter and more direct, making preference inference more challenging.

Evaluated Baselines

ReGeS is compared against three groups of methods:

  • Traditional Representation-Based Methods: Such as KBRD, KGSF, and UniCRS which integrate external knowledge bases like DBpedia and ConceptNet.
  • LLM-Based Methods: Including closed-source systems like GPT-3.5-turbo and GPT-4, as well as open-source models like Vicuna-13B.
  • Retrieval-Augmented Methods: Examples include RAMO and RARS, which combine retrieval results with large language models for final recommendations.

Implementation Details

We evaluate ReGeS with the following configurations:

  • LLMs:

    • Gemma-2B
    • LLaMA3.1-8B
    • Gemma-27B
  • Retrievers:

    • DPR (110M parameters; hidden dim = 768)
    • BGE-large-1.5-en (340M parameters; hidden dim = 1024)
    • OpenAI text-embedding-3-large (hidden dim = 3074)

Our baseline implementations follow published code for UniCRS, KBRD, and KGSF, while LLM-based and retrieval-augmented methods were re-implemented as described in prior works.

Environment Setup

  1. Create and activate the conda environment:

    conda env create -f environment.yml
    conda activate reages
    
  2. Clone LLaMA-Factory (required for model training):

    git clone --branch v0.9.1 --depth 1 https://github.com/hiyouga/LLaMA-Factory.git
    
  3. Set up your OpenAI API key:

    export OPENAI_API_KEY=<your_openai_api_key>
    
  4. Create required directories:

    mkdir -p data/saved_models data/saved_adaptors
    

Note: Ensure your working directory is set appropriately (e.g., ../ReGeS/) for correct relative path resolution.

Model Setup

Base Models

Download the following base models:

# Gemma-2B
huggingface-cli download google/gemma-2-2b-it --local-dir data/saved_models/gemma2b

# LLaMA 3.1-8B
huggingface-cli download meta-llama/Llama-3.1-8b-instruct --local-dir data/saved_models/llama3.1-8b-instruct

# Gemma-27B
huggingface-cli download google/gemma-2-27b-it --local-dir data/saved_models/gemma27b

Fine-tuned Models

Download the pre-trained models for each ReGeS module:

  1. Generation-Augmented Query Reformulator Models:

    huggingface-cli download Dylan1999/gemma2b_ssl --local-dir data/saved_models/gemma2b_ssl
    huggingface-cli download Dylan1999/llama3.1-8b-instruct_ssl --local-dir data/saved_models/llama3.1-8b-instruct_ssl
    huggingface-cli download Dylan1999/gemma27b_ssl --local-dir data/saved_models/gemma27b_ssl
    
  2. Retrieval-Augmented Item Generator Models:

    huggingface-cli download Dylan1999/gemma-2b_select --local-dir data/saved_models/gemma2b_select
    huggingface-cli download Dylan1999/llama-8b_select --local-dir data/saved_models/llama3.1-8b-instruct_select
    huggingface-cli download Dylan1999/gemma-27b_select --local-dir data/saved_models/gemma27b_select
    
  3. Chain-of-Thought (CoT) Models:

    huggingface-cli download Dylan1999/gemma-2b_cot --local-dir data/saved_models/gemma2b_cot
    huggingface-cli download Dylan1999/llama-8b_cot --local-dir data/saved_models/llama3.1-8b-instruct_cot
    huggingface-cli download Dylan1999/gemma-27b_cot --local-dir data/saved_models/gemma27b_cot
    

Running Experiments

Main Experiments

  1. Generate queries using the Generation-Augmented Query Reformulator:

    bash experiments/main/retrieval/G-enhanced-retrieval.sh
    
  2. Run the Retrieval-Augmented Item Generator:

    bash experiments/main/select/R-enhanced-generation.sh
    
  3. Evaluate recommendations:

    bash experiments/main/eval.sh
    

Chain-of-Thought (CoT) Experiments

  1. Run CoT experiments:

    bash experiments/cot/cot.sh
    
  2. Evaluate CoT results:

    python src/eval/cot_eval.py
    

Custom Model Training (Optional)

If you prefer training your own models rather than using the pre-trained versions, configuration files are provided in the configs/ directory.

Main Component Training

bash experiments/main/retrieval/G-enhanced-retrieval-ft.sh
bash experiments/main/select/R-enhanced-generation-ft.sh

CoT Training

bash experiments/cot/cot_ft.sh

Model Configurations

Following our paper, ReGeS is evaluated using three settings:

  • Small: DPR retriever (110M parameters) + Gemma-2B.
  • Middle: BGE-large-1.5-en retriever (340M parameters) + LLaMA3.1-8B.
  • Large: OpenAI text-embedding-3-large retriever + Gemma-27B.

Citation

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

@article{yang2025reges,
  title         = {ReGeS: Reciprocal Retrieval-Generation Synergy for Conversational Recommender Systems},
  author        = {Yang, Dayu and Fang, Hui},
  year          = {2025},
  month         = {sep},
  journal       = {arXiv preprint arXiv:2509.21371},
  archivePrefix = {arXiv},
  eprint        = {2509.21371},
  primaryClass  = {cs.IR},
  doi           = {10.48550/arXiv.2509.21371},
  url           = {https://arxiv.org/abs/2509.21371},
  note          = {Accepted at WISE 2025}
}

Contributors

dayuyang1999

2 commits

Languages

Python

86.0%

Shell

14.0%