2025-07-22Support for E2E AV is available now, with docπ!2025-05-07Explore our project page, now live hereπ!2025-05-07Our paper is available on arXivπ!
This repository contains the implementation of the paper.
RIFT: Group-Relative RL Fine-Tuning for Realistic and Controllable Traffic Simulation
Keyu Chen1 , Wenchao Sun1, Hao Cheng1, Sifa Zheng1
1School of Vehicle and Mobility, Tsinghua University
If you find our work useful, Please give us a star π!
π« RIFT achieve realistic and controllable traffic simulation by combining IL pre-training in a data-driven simulator for realism with RL fine-tuning in a physics-based simulator for controllability.
- full model checkpoint
- E2E AV (UniAD, VAD, SparseDrive)
- training code
- initial repo & paper
Recommended system: Ubuntu 20.04 or 22.04
Step 1: Install Carla
mkdir carla
cd carla
wget https://carla-releases.s3.us-east-005.backblazeb2.com/Linux/CARLA_0.9.15.tar.gz
tar -xvf CARLA_0.9.15.tar.gz
cd Import && wget https://carla-releases.s3.us-east-005.backblazeb2.com/Linux/AdditionalMaps_0.9.15.tar.gz
cd .. && bash ImportAssets.shUpdate your system's PYTHONPATH with the following paths:
export CARLA_ROOT=YOUR_CARLA_PATH
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carlaStep 2: Setup conda environment
conda create -n rift python=3.8
conda activate rift
echo "$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.15-py3.7-linux-x86_64.egg" >> YOUR_CONDA_PATH/envs/rift/lib/python3.8/site-packages/carla.pth # python 3.8 also works well, please set YOUR_CONDA_PATHStep 3: Clone this git repo in an appropriate folder
git clone git@github.com:CurryChen77/RIFT.git
cd RIFTStep 4: Install main packages
pip install -r requirements.txt
pip install -e .Step 5: Install E2E packages
Follow the documentation here to install E2E-related packages.
- Carla Map Data
| Name | Google Drive | Approx. Size | Storage Place |
|---|---|---|---|
| HD Map Data | Link | 714 MB | Folder |
| Speed Limits Data | Link | 79 MB | Folder |
- AV Checkpoint
| AV Name | Google Drive | Approx. Size | Storage Place |
|---|---|---|---|
| PlanT_medium | Link | 695 MB | Folder |
For the E2E AV Checkpoint, please check the documentation.
- CBV Checkpoint
| Name | Google Drive | Approx. Size | Storage Place |
|---|---|---|---|
| Pluto & Fine-Tuned Variants | Link | 166.2 MB | Folder |
Parallel execution of Python scripts is allowed as long as each script is assigned a different CUDA_VISIBLE_DEVICES.
# Train rift pluto
CUDA_VISIBLE_DEVICES=0 python scripts/run.py --ego_cfg pdm_lite.yaml --cbv_cfg rift_pluto.yaml --mode train_cbvMultiple Runs for Resume (Carla will crash for some reasons in Fine-tuning)
bash scripts/run_multi.sh \
-t 3 \ # max try
-e pdm_lite.yaml \ # ego file
-c rift_pluto.yaml \ # cbv file
-m train_cbv \ # run mode (train_cbv, train_ego, eval, collect_data)
-r 2 \ # scenario repeat time
-s 0 \ # random seed
-g 0 \ # GPU_ID
-v # render or not# Eval rift pluto
CUDA_VISIBLE_DEVICES=0 python scripts/run.py --ego_cfg pdm_lite.yaml --cbv_cfg rift_pluto.yaml --mode eval -rep 1- Plot Speed and Acceleration Distribution
python tools/plot/plot_distribution.py- Plot Evaluation Results
python tools/plot/plot_eval_results.pyEvaluation results of the paper are provided here.
# Eval rift pluto
CUDA_VISIBLE_DEVICES=0 python scripts/run.py --ego_cfg pdm_lite.yaml --cbv_cfg rift_pluto.yaml --mode eval --render -rep 1 # add --renderIf you find our paper useful, please kindly cite us via:
@misc{chen2025riftgrouprelativerlfinetuning,
title={RIFT: Group-Relative RL Fine-Tuning for Realistic and Controllable Traffic Simulation},
author={Keyu Chen and Wenchao Sun and Hao Cheng and Sifa Zheng},
year={2025},
eprint={2505.03344},
archivePrefix={arXiv},
primaryClass={cs.RO},
url={https://arxiv.org/abs/2505.03344},
}This implementation is based on code from several repositories. We sincerely thank the authors for their awesome work.



