Skip to content

jieWANGforwork/MODT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MODT4R: Multi-Objective Decision Transformer for Recommendations

Paper: Beyond Accuracy: Decision Transformers for Reward-Driven Multi-Objective Recommendations


📖 Overview

MODT4R implements a novel multi-objective decision transformer framework for sequential recommendation systems. This work leverages decision transformers to optimize multiple objectives simultaneously, including accuracy, diversity, and novelty in recommendations.

Main Scripts

  • Training: MODT4R.py - Train the multi-objective decision transformer
  • Evaluation: test_MODT4R.py - Evaluate trained models on test data

🚀 Quick Start

🛠️ Environment Setup

Prerequisites

  • Python 3.8.5
  • CUDA 10+ (for GPU support)
  • Anaconda/Miniconda

Installation

# Create conda environment from yml file
conda env create -f conda_env.yml
conda activate decision-transformer-rec

Training

python MODT4R.py --dataset retail_rocket

Evaluation

python test_MODT4R.py --dataset retail_rocket

📁 Repository Structure

MODT4R_public/
├── models/                         # Model architectures
│   ├── MoTrans.py                  # Multi-objective Decision Transformer (main model)
│   ├── SASRecModules.py            # SASRec attention modules (User State Transformer)
│   ├── trajectory_gpt2.py          # GPT-2 backbone for trajectory modeling
│   └── model.py                    # Base model class
│
├── src/                             # Core utilities and functions
│   ├── evaluate_mo.py              # Multi-objective evaluation functions
│   └── util.py                     # Data processing and utility functions
│
├── MODT4R.py                       # 🎯 Main training script
├── test_MODT4R.py                  # 🧪 Main evaluation script
├── conda_env.yml                   # Conda environment configuration
└── README.md                       # This file

📊 Data Format

The data should contain the following fields:

  • state: User interaction history (sequence of items)
  • rewards: Reward signals (accuracy, novelty, diversity)
  • len_state: Length of the sequence
  • action: Next item to predict

🚀 Training

Train MODT4R

Use MODT4R.py for training the Multi-Objective Decision Transformer:

# Train on RetailRocket dataset
python MODT4R.py \
  --dataset retail_rocket \
  --hidden_factor 64 \
  --num_epochs 100 \
  --batch_size 256 \
  --lr 0.0001 \
  --embed_dim 128 \
  --n_layer 1 \
  --n_head 1 \
  --dropout 0.1 \
  --data_path /path/to/data/ \
  --models_path /path/to/save/models

🧪 Evaluation

Run Evaluation

Use test_MODT4R.py to evaluate trained MODT4R models:

# Evaluate model on RetailRocket dataset
python test_MODT4R.py \
  --dataset retail_rocket \
  --hidden_factor 64 \
  --embed_dim 128 \
  --n_layer 1 \
  --n_head 1 \
  --start_step 1 \
  --end_step 2
# Evaluate on RC15 dataset
python test_MODT4R.py \
  --dataset rc15 \
  --hidden_factor 64 \
  --embed_dim 128

Evaluation Metrics

The evaluation includes:

  • Accuracy Metrics: Hit Rate (HR@K), NDCG@K
  • Diversity Metrics: coverage
  • Novelty Metrics: long-tail coverage

📝 Citation

@article{wang2025beyond,
  title={Beyond Accuracy: Decision Transformers for Reward-Driven Multi-Objective Recommendations},
  author={Wang, Jie and Karatzoglou, Alexandros and Arapakis, Ioannis and Jose, Joemon M and Ge, Xuri},
  journal={IEEE Transactions on Knowledge and Data Engineering},
  year={2025},
  publisher={IEEE}
}

🤝 Acknowledgments

This work builds upon several foundational works:



📄 License

This project is released under the MIT License. See LICENSE file for details.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages