Skip to content

🀹 MultiTRON: Pareto Front Approximation for Multi-Objective Session-Based Recommender Systems, submitted to ACM RecSys 2024.

License

Notifications You must be signed in to change notification settings

otto-de/MultiTRON

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MultiTRON: Pareto Front Approximation for Multi-Objective Session-Based Recommendation

GitHub stars Test suite Conference OTTO jobs

MultiTRON is a session-based transformer capable of computing an efficient approximation of the Pareto front on multi-objective session-based recommendation tasks. This repository contains the official PyTorch Lightning implementation for our paper, submitted to ACM RecSys 2024: Pareto Front Approximation for Multi-Objective Session-Based Recommender Systems, authored by Timo Wilm, Philipp Normann and Felix Stepprath.

🎯 Abstract

This work introduces MultiTRON, an approach that adapts Pareto front approximation techniques to multi-objective session-based recommender systems using a transformer neural network. Our approach optimizes trade-offs between key metrics such as click-through and conversion rates by training on sampled preference vectors. A significant advantage is that after training, a single model can access the entire Pareto front, allowing it to be tailored to meet the specific requirements of different stakeholders by adjusting an additional input vector that weights the objectives. We validate the model’s performance through extensive offline and online evaluation. For broader application and research, the source code is made available. The results confirm the model’s ability to manage multiple recommendation objectives effectively, offering a flexible tool for diverse business needs.

Evaluation results from the offline dataset and live A/B test Pareto fronts showing the tradeoff between clicks and orders
Evaluation results from the offline dataset and live A/B test. Points on the offline front translate into real-world trade-offs of CTR and CVR. The colored points correspond to differing values of preference vector, representing the four A/B test groups. The best performing Pareto fronts from the offline evaluation, which depicts 26 distinct points along the front to illustrate the tradeoffs between click loss and order loss across all three datasets: Diginetica, Yoochoose, and OTTO.

πŸš€ Quick Start

  1. Clone the repository:
git clone https://github.com/otto-de/MultiTRON.git
  1. Install the dependencies:
pip install pipenv
pipenv install --dev
  1. Execute the test scripts:
pipenv run pytest
  1. Install 7zip, gzip, and zip utilities on your system:
sudo apt-get install 7zip gzip unzip
  1. Prepare a dataset (e.g., diginetica, yoochoose or otto):
./prepare.sh yoochoose
  1. Run the main script with a configuration file:
pipenv run python -m src --config-filename yoochoose/tron_200hs_3l_256bs_10epoch_beta05_reg05
  1. After training compute the Pareto front for 25 points with the configuration file and a checkpoint:
pipenv run python -m src.pareto_front --config-filename yoochoose/tron_200hs_3l_256bs_10epoch_beta05_reg05 --checkpoint lightning_logs/version_1/checkpoints/multitron-yoochoose-epoch\=9-test_loss\=1.745.ckpt --number-points 25
  1. To visualize the Pareto Front run:
pipenv run python -m src.visualize --parteo-front-filename pareto-front.json --plot True

πŸ—‚οΈ Repository Structure

.
β”œβ”€β”€ Pipfile
β”œβ”€β”€ Pipfile.lock
β”œβ”€β”€ README.md
β”œβ”€β”€ configs                # Contains experiment configuration files
β”œβ”€β”€ doc                    # Contains the paper and related files
β”œβ”€β”€ prepare.sh             # Script to prepare datasets
β”œβ”€β”€ src                    # Source code for the models, Pareto front and visualization
└── test                   # Test scripts

βš™οΈ Config File Documentation

The config folder contains JSON configuration files for all experiments performed in our research. These configurations detail the model's parameters and options.

Here's an explanation of each parameter in the config file:

  • dataset: The dataset to be used for training (e.g., "diginetica", "yoochoose", "otto").
  • beta: The two dimensionel diriclet vector to draw samples from during training.
  • regularization: The penalty of the non-uniformity loss (approximated EPO loss) regularization term.
  • hidden_size: The size of the hidden layers and item embeddings.
  • num_layers: The number of layers in the model.
  • dropout: The dropout rate applied to the model's layers.
  • num_batch_negatives: The number of negative samples from the batch. Limited by batch_size - 1.
  • num_uniform_negatives: The number of uniformly sampled negatives.
  • reject_uniform_session_items: If true, items from the same session won't be used as uniform negatives. Becomes slow if num_uniform_negatives is large.
  • reject_in_batch_items: If true, items from the same session won't be used as batch negatives.
  • sampling_style: The style of negative sampling to use (e.g., "eventwise", "sessionwise", "batchwise"). Has significant impact on training speed.
  • topk_sampling: If true, top-k negative sampling is enabled.
  • topk_sampling_k: If topk_sampling is true, this parameter specifies the number of top k negative samples to be used for training.
  • loss: The loss function to use (e.g., only ssm_and_be is implemented).
  • max_epochs: The maximum number of training epochs.
  • batch_size: The batch size used for training and validation.
  • max_session_length: The maximum length of a session. Longer sessions will be truncated.
  • lr: The learning rate for the optimizer.
  • limit_val_batches: The fraction of validation data to use for the validation step.
  • accelerator: The device type to be used for training (e.g., "gpu", "cpu").
  • overfit_batches: The fraction or number of batches of training data to use for overfitting. Set to 0 for no overfitting. See PyTorch Lightning docs for more details.
  • share_embeddings: If true, the embedding weights are shared between the input and output layers.
  • output_bias: If true, includes bias in the output layer.
  • shuffling_style: The style of shuffling to use for the training dataset (e.g., "no_shuffling", "shuffling_with_replacement", "shuffling_without_replacement").
  • optimizer: The optimizer to use for training (e.g., "adam", "adagrad")

Example Config File for TRON on the OTTO Dataset

{
    "dataset": "otto",
    "beta": [0.5, 0.5],
    "regularization_penalty": 1.0,
    "hidden_size": 200,
    "num_layers": 3,
    "dropout": 0.05,
    "num_batch_negatives": 32,
    "num_uniform_negatives": 16384,
    "reject_uniform_session_items": false,
    "reject_in_batch_items": true,
    "sampling_style": "batchwise",
    "topk_sampling": true,
    "topk_sampling_k": 100,
    "loss": "ssm_and_be",
    "max_epochs": 10,
    "batch_size": 256,
    "max_session_length": 50,
    "lr": 0.0001,
    "limit_val_batches": 1.0,
    "accelerator": "gpu",
    "overfit_batches": 0,
    "share_embeddings": true,
    "output_bias": false,
    "shuffling_style": "no_shuffling",
    "optimizer": "adam"
}

For all config files used in our experiments, refer to the configs directory.

πŸ™Œ Contribution

Contributions to MultiTRON are welcome and appreciated. For issues or suggestions for improvements, please open an issue or create a pull request. We believe that open source knowledge sharing is the best way to advance the field of recommender systems.

πŸ“– Citing

If MultiTRON aids your research, please consider citing our work:

@inproceedings{wilm2024pareto,
  title={Pareto Front Approximation for Multi-Objective Session-Based Recommender Systems},
  author={Wilm, Timo and Normann, Philipp and Stepprath, Felix},
  year={2024}
}

πŸ“œ License

This project is MIT licensed.

πŸ“ž Contact

For any queries or questions, please reach out to us via our LinkedIn profiles:

For specific issues related to the codebase or for feature requests, please create a new issue on our GitHub page.

If this project aids your research or you find it interesting, we would appreciate it if you could star ⭐ the repository. Thanks for your support!