Official implementation of paper: SFT Memorizes, RL Generalizes: A Comparative Study of Foundation Model Post-training
333
stars
34
commits
Python
primary language
Apr 28, 2025
updated
Misc: We prompt DALL-E 3 via "Conceptual figure of 'SFT Memorizes, RL Generalizes', with trendlines and style of Hong Kong" but somehow skycrapters dominate the picture...
Our codebase is tested on H800 servers with python 3.13.0 torch 2.5.1+cu124.
git clone https://github.com/LeslieTrue/SFTvsRL.git
cd SFTvsRL
conda create -n SFTvsRL python==3.13 -y
conda activate SFTvsRL
pip install -r requirements.txt
cd gym
pip install -e . # install gym environment
cd ..
We instantiate RL experiments on top of SFT initialized checkpoints to guarantee model's basic instruction following capabilities. We provide all 4 initial checkpoints for {GeneralPoints, V-IRL}X{Language (-L), Vision-Language (-VL)}.
huggingface-cli download tianzhechu/GP-L-Init --local-dir YOUR_LOCAL_DIR
huggingface-cli download tianzhechu/GP-VL-Init --local-dir YOUR_LOCAL_DIR
huggingface-cli download tianzhechu/VIRL-L-Init --local-dir YOUR_LOCAL_DIR
huggingface-cli download tianzhechu/VIRL-VL-Init --local-dir YOUR_LOCAL_DIR
It's optional to download these checkpoints via huggingface CLI. You may directly specify repo_name as CKPT_NAME in shell scripts.
bash scripts/gp_training/language_train.shbash scripts/gp_training/vl_train.shrl/configs/llama_gp_*.yamlSTREETVIEWS=YOUR_PATH/nyc_1k_routes/street_views/GPS_TO_PANO=YOUR_PATH/nyc_1k_routes/gps_pano_mapping.pklROUTE_INFO=YOUR_PATH/nyc_1k_routes/route_infos.jsonbash scripts/virl_training/language_train.shbash scripts/virl_training/vl_train.shrl/configs/llama_virl_*.yamlscripts/gp_evaluation/*.sh: evaluate GeneralPointsscripts/virl_evaluation/*.sh: evaluate V-IRLscripts/recog_evaluation/*.sh: evaluate GeneralPoints recognitionCKPT_NAME in these shell scripts.** Note that our shell scripts support slurm clusters if launched via sbatch scripts/*/*.sh. Reproducing our training experiments require a node of 8 gpus with memory of 80GB each.
If you find this project useful for your research and applications, please cite using this BibTeX:
@misc{chu2025sftmemorizesrlgeneralizes,
title={SFT Memorizes, RL Generalizes: A Comparative Study of Foundation Model Post-training},
author={Tianzhe Chu and Yuexiang Zhai and Jihan Yang and Shengbang Tong and Saining Xie and Dale Schuurmans and Quoc V. Le and Sergey Levine and Yi Ma},
year={2025},
eprint={2501.17161},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2501.17161},
}
34 commits
Python
94.9%
Shell
5.1%
Official implementation of paper: SFT Memorizes, RL Generalizes: A Comparative Study of Foundation Model Post-training
333
stars
34
commits
Python
primary language
Apr 28, 2025
updated
Misc: We prompt DALL-E 3 via "Conceptual figure of 'SFT Memorizes, RL Generalizes', with trendlines and style of Hong Kong" but somehow skycrapters dominate the picture...
Our codebase is tested on H800 servers with python 3.13.0 torch 2.5.1+cu124.
git clone https://github.com/LeslieTrue/SFTvsRL.git
cd SFTvsRL
conda create -n SFTvsRL python==3.13 -y
conda activate SFTvsRL
pip install -r requirements.txt
cd gym
pip install -e . # install gym environment
cd ..
We instantiate RL experiments on top of SFT initialized checkpoints to guarantee model's basic instruction following capabilities. We provide all 4 initial checkpoints for {GeneralPoints, V-IRL}X{Language (-L), Vision-Language (-VL)}.
huggingface-cli download tianzhechu/GP-L-Init --local-dir YOUR_LOCAL_DIR
huggingface-cli download tianzhechu/GP-VL-Init --local-dir YOUR_LOCAL_DIR
huggingface-cli download tianzhechu/VIRL-L-Init --local-dir YOUR_LOCAL_DIR
huggingface-cli download tianzhechu/VIRL-VL-Init --local-dir YOUR_LOCAL_DIR
It's optional to download these checkpoints via huggingface CLI. You may directly specify repo_name as CKPT_NAME in shell scripts.
bash scripts/gp_training/language_train.shbash scripts/gp_training/vl_train.shrl/configs/llama_gp_*.yamlSTREETVIEWS=YOUR_PATH/nyc_1k_routes/street_views/GPS_TO_PANO=YOUR_PATH/nyc_1k_routes/gps_pano_mapping.pklROUTE_INFO=YOUR_PATH/nyc_1k_routes/route_infos.jsonbash scripts/virl_training/language_train.shbash scripts/virl_training/vl_train.shrl/configs/llama_virl_*.yamlscripts/gp_evaluation/*.sh: evaluate GeneralPointsscripts/virl_evaluation/*.sh: evaluate V-IRLscripts/recog_evaluation/*.sh: evaluate GeneralPoints recognitionCKPT_NAME in these shell scripts.** Note that our shell scripts support slurm clusters if launched via sbatch scripts/*/*.sh. Reproducing our training experiments require a node of 8 gpus with memory of 80GB each.
If you find this project useful for your research and applications, please cite using this BibTeX:
@misc{chu2025sftmemorizesrlgeneralizes,
title={SFT Memorizes, RL Generalizes: A Comparative Study of Foundation Model Post-training},
author={Tianzhe Chu and Yuexiang Zhai and Jihan Yang and Shengbang Tong and Saining Xie and Dale Schuurmans and Quoc V. Le and Sergey Levine and Yi Ma},
year={2025},
eprint={2501.17161},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2501.17161},
}
34 commits
Python
94.9%
Shell
5.1%