Skip to content
/ QT Public

ICML'2024: Q-value Regularized Transformer for Offline Reinforcement Learning

License

Notifications You must be signed in to change notification settings

charleshsc/QT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Q-value Regularized Transformer for Offline Reinforcement Learning

Version License

Shengchao Hu1,2, Ziqing Fan1,2, Chaoqin Huang1,2, Li Shen3,4*, Ya Zhang1,2, Yanfeng Wang1,2, Dacheng Tao5

1 Shanghai Jiao Tong University, 2 Shanghai AI Laboratory, 3 Sun Yat-sen University, 4 JD Explore Academy, 5 Nanyang Technological University.

Contents

Overview

Recent advancements in offline reinforcement learning (RL) have underscored the capabilities of Conditional Sequence Modeling (CSM), a paradigm that learns the action distribution based on history trajectory and target returns for each state. However, these methods often struggle with stitching together optimal trajectories from sub-optimal ones due to the inconsistency between the sampled returns within individual trajectories and the optimal returns across multiple trajectories. Fortunately, Dynamic Programming (DP) methods offer a solution by leveraging a value function to approximate optimal future returns for each state, while these techniques are prone to unstable learning behaviors, particularly in long-horizon and sparse-reward scenarios.

Building upon these insights, we propose the Q-value regularized Transformer (QT), which combines the trajectory modeling ability of the Transformer with the predictability of optimal future returns from DP methods. QT learns an action-value function and integrates a term maximizing action-values into the training loss of CSM, which aims to seek optimal actions that align closely with the behavior policy. Empirical evaluations on D4RL benchmark datasets demonstrate the superiority of QT over traditional DP and CSM methods, highlighting the potential of QT to enhance the state-of-the-art in offline RL.

Quick Start

When your environment is ready, you could run scripts in the "run.sh". For example:

python experiment.py --seed 123 \
    --env hopper --dataset medium   \
    --eta 1.0 --grad_norm 9.0 \
    --exp_name qt --save_path ./save/    \
    --max_iters 500 --num_steps_per_iter 1000 --lr_decay \
    --early_stop --k_rewards --use_discount  \

Citation

If you find this work is relevant with your research or applications, please feel free to cite our work!

@inproceedings{QT,
    title={Q-value Regularized Transformer for Offline Reinforcement Learning},
    author={Hu, Shengchao and Fan, Ziqing and Huang, Chaoqin and Shen, Li and Zhang, Ya and Wang, Yanfeng and Tao, Dacheng},
    booktitle={International Conference on Machine Learning},
    year={2024},
}

Acknowledgments

This repo benefits from DT and Diffusion-QL. Thanks for their wonderful works!

About

ICML'2024: Q-value Regularized Transformer for Offline Reinforcement Learning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published