You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code is tested on Ubuntu 22.04 with Python 3.10 and cuda 12.1. We run the experiments on A6000 and A100-80G GPU servers. Please make sure you have installed cuda >= 11.6 and satisfy the minimal requirement for flash attention.
You can use either
conda env create -f py310_env.yaml
to directly create the conda environment or manually install the required packages by running
Then please login the wandb account by running wandb login and huggingface account by running huggingface-cli login.
Usage
We use json configs to manage the experiment settings. You can find all the experiment configs in paper_experiment_configs/. To reproduce, first prepare the oracle-annotated dataset by running
python prepare_oracle_data.py
It would download and annotate the dataset then save it in statdata/prefer_skywork_Skywork/Skywork-Reward-Gemma-2-27B-v0.2. You can also pull it from huggingface hub by running
python prepare_oracle_data.py --built_from hub
To run the experiments, use torchrun or accelerate:
torchrun --standalone --nnodes 1 --nproc-per-node 1 run.py PATH/TO/CONFIG.JSON --seed 42 # for single gpu
accelerate launch run.py --mixed_precision=bf16 PATH/TO/CONFIG.JSON --seed 42 # for multi-gpu
We recommend running our experiments with the number of GPUs mentioned in config names to ensure the correct batch sizes.
If you have any questions, feel free to open an issue or contact us via email.
Acknowledgements
This codebase is built on top of RLHFlow. Special thanks to its creators for their valuable contributions and insights.
Citation
If you find this code useful for your research, please consider citing:
@article{liu2024rewardordinal,
title={Reward Modeling with Ordinal Feedback: Wisdom of the Crowd},
author={Liu, Shang and Pan, Yu and Chen, Guanting and Li, Xiaocheng},
journal={arXiv preprint arXiv:2411.12843},
year={2024}
}
About
Official codebase for paper "Reward Modeling with Ordinal Feedback: Wisdom of the Crowd".