Home

Awesome

RLTF: Reinforcement Learning from Unit Test Feedback <a name="corl"></a>

This is the official code for the paper RLTF: Reinforcement Learning from Unit Test Feedback.

Installation

The code requires some dependencies as specified in requirements.txt. Please follow the relevant libraries to install or run:

pip install -r requirements.txt

Datasets

Download and unzip all files into the data folder.

Models

https://huggingface.co/Harvey6/RLTF_codet5

Processes

Surprised Finetune

Generating Programs Online

Online RL Finetune

After running the online generation for a short period and accumulating a certain number of samples:

Generate Program, Run Unit Test, Compute pass@k

Generate Program:

Run Unit Test:

Compute pass@k:

Citation

If you find the paper or the source code useful to your projects, please cite the following bibtex:

<pre> @misc{liu2023rltf, title={RLTF: Reinforcement Learning from Unit Test Feedback}, author={Jiate Liu and Yiqin Zhu and Kaiwen Xiao and Qiang Fu and Xiao Han and Wei Yang and Deheng Ye}, year={2023}, eprint={2307.04349}, archivePrefix={arXiv}, primaryClass={cs.AI} } </pre>

License

The code is released under BSD 3-Clause - see LICENSE.txt for details.

This code is developed from other open source projects: including CodeRL, APPS, and transformers. We thank the original contributors of these works for open-sourcing their valuable source codes.