/RLfinetuning_Diffusion_Bioseq

Code for the tutorial/review paper for RL-based-fine-tuniing. In this code, we especially focus on the design of biological sequences like DNA (enhancers) and RNA (UTRs) design.

Primary LanguageJupyter Notebook

RL-Based Fine-Tuning of Diffusion Models for Biological Sequences

This code accompanies the tutorial/review paper on RL-based fine-tuning, where the objective is to maximize downstream reward functions by fine-tuning diffusion models with reinforcement learning (RL). In this implementation, we focus on the design of biological sequences, such as DNA (enhancers) and RNA (UTRs).

Summary

Tutorials

See ./tutorials. Each notebook is self-contained.

The following compares the generated RNA sequences (UTR )before/after fine-tuning. We optimize towards MRL (activity level).

RNA output Chat UTR

The following compares the generated DNA sequences (enhancer) before/after fine-tuning. We optimize towards activity level in HepG2 cell line.

Remarks

  • We use Dirichlet Diffusion Models (Avedeyev et.al, 2023) as the backbone diffusion models. We acknowledge that our implementation is partly based on their codebase. We will implement more backbone diffusion models that are tailored to sequences.

  • Is over-optimization happening in the fine-tuning process?: Check paper BRAID (Uehera and Zhao et.al, 2024) on how to avoid it.

  • Lab-in-the-loop setting? : Check out SEIKO, implementation of online diffusion model fine-tuning, as well as the paper (Uehara and Zhao et.al, 2024).

Acknowledgement

Installation

Create a conda environment with the following command:

conda create -n bioseq python = 3.12.0
conda activate bioseq
pip install -r requirements.txt

Citation

If you find this work useful in your research, please cite:

@article{Uehara2024understanding,
  title={Understanding Reinforcement Learning-Based Fine-Tuning of Diffusion Models: A Tutorial and Review},
  author={Uehara, Masatoshi and Zhao, Yulai and Biancalani, Tommaso and Levine, Sergey},
  journal={arXiv preprint arXiv:2407.13734},
  year={2024}
}