Exploring the Use of Invalid Action Masking in Reinforcement Learning: A Comparative Study of On-Policy and Off-Policy Algorithms in Real-Time Strategy Games
Open Access
- 18 July 2023
- journal article
- research article
- Published by MDPI AG in Applied Sciences
- Vol. 13 (14) , 8283
Abstract
Invalid action masking is a practical technique in deep reinforcement learning to prevent agents from taking invalid actions. Existing approaches rely on action masking during policy training and utilization. This study focuses on developing reinforcement learning algorithms that incorporate action masking during training but can be used without action masking during policy execution. The study begins by conducting a theoretical analysis to elucidate the distinction between naive policy gradient and invalid action policy gradient. Based on this analysis, we demonstrate that the naive policy gradient is a valid gradient and is equivalent to the proposed composite objective algorithm, which optimizes both the masked policy and the original policy in parallel. Moreover, we propose an off-policy algorithm for invalid action masking that employs the masked policy for sampling while optimizing the original policy. To compare the effectiveness of these algorithms, experiments are conducted using a simplified real-time strategy (RTS) game simulator called Gym-RTS. Based on empirical findings, we recommend utilizing the off-policy algorithm for addressing most tasks while employing the composite objective algorithm for handling more complex tasks.
Keywords
Funding Information
- National Natural Science Foundation of China (61703427)
This publication has 20 references indexed in Scilit:
- Gym-µRTS: Toward Affordable Full Game Real-time Strategy Games Research with Deep Reinforcement Learning2021
- Graph networks for molecular designMachine Learning: Science and Technology, 2021
- Deep reinforcement learning based lane detection and localizationNeurocomputing, 2020
- Implementing action mask in proximal policy optimization (PPO) algorithmICT Express, 2020
- Action Space Shaping in Deep Reinforcement Learning2020
- Mastering Complex Control in MOBA Games with Deep Reinforcement LearningProceedings of the AAAI Conference on Artificial Intelligence, 2020
- Attentive Relational State Representation in Decentralized Multiagent Reinforcement LearningIEEE Transactions on Cybernetics, 2020
- UAV Air Combat Autonomous Maneuver Decision Based on DDPG Algorithm2019
- Human-level control through deep reinforcement learningNature, 2015
- Hierarchical Reinforcement Learning with the MAXQ Value Function DecompositionJournal of Artificial Intelligence Research, 2000