Abstract
In recent years, training adversarial agents has become an effective and practical approach for attacking neural network policies. However, we observe that existing methods can be further enhanced by distinguishing between states leading to win or lose and encouraging the policy training by reward engineering to prioritize winning states. In this paper, we introduce a novel adversarial training method with reward engineering for two-player competitive games. Our method extracts the historical evaluations for states from historical experiences with an episodic memory, and then incorporating these evaluations into the rewards with our proposed reward revision method to improve the adversarial policy optimization. We evaluate our approach using two-player competitive games in MuJoCo simulation environments, demonstrating that our method establishes the most promising attack performance and defense difficulty against the victims among the existing adversarial policy training techniques.
Introduction
Deep Reinforcement Learning (DRL) policies have demonstrated remarkable performance in complex games, yet they remain surprisingly fragile. In competitive environments, an "adversarial agent" can be trained to exploit these vulnerabilities, often by performing unusual behaviors that confuse a victim agent's policy. While existing adversarial training methods are effective, they often suffer from sample inefficiency and struggle with credit assignment—specifically, distinguishing between states that appear high-reward in isolation and those that actually lead to a victory.
Standard rewards in these games are often sparse or noisy. This paper addresses the gap by leveraging historical experience to prioritize specific sequences of actions that consistently lead to winning outcomes, rather than just maximizing immediate environmental feedback.
Proposed Method: Episodic Reward Engineering
The core contribution of this work is a framework that integrates standard policy optimization (like PPO) with a specialized Reward Engineering module. This module uses episodic memory to provide a more nuanced signal to the agent.
Neural Episodic Memory
The system employs an LSTM (Long Short-Term Memory) network to encode sequences of $k$ consecutive states into abstract vectors. These patterns are more informative than isolated states because failure or success in competitive games typically results from a series of decisions. An MLP (Multi-Layer Perceptron) then predicts a Historical Score for these patterns based on the average cumulative reward of past episodes in which they occurred.
Episodic Feedback and Reward Revision
To ensure the reward signal remains stable, the authors calculate "episodic feedback" as the difference between a pattern's historical score and the agent's current average performance. This relative signal helps identify actions that are better than the current baseline.
The framework then applies Conditional Reward Revision based on the game's outcome:
- Win: If the agent wins and the state pattern has positive feedback, the reward is increased.
- Loss: If the agent loses and the pattern has negative feedback, the reward is decreased (punishment).
- Neutral: Otherwise, the reward remains unchanged to prevent the agent from accidentally learning losing strategies that might contain high-reward sub-states.
Experimental Evaluation
The method was evaluated across two major benchmarks: MuJoCo Competitive Games (e.g., YouShallNotPassHumans, SumoAnts) and StarCraft II. The victims were high-performance "Zoo" agents.
Key Results
- Superior Win Rates: In MuJoCo, the proposed method achieved win rates of 88% and 89% in
YouShallNotPassHumansandKickAndDefend, respectively. This significantly outperforms previous state-of-the-art adversarial techniques. - Defense Difficulty: When victims were retrained to defend against these new adversaries, they found it much harder to recover their performance compared to defending against baseline adversaries, indicating that the exploits found are more robust.
- Scalability: In the high-dimensional environment of StarCraft II, the method achieved a 10% higher win rate than vanilla PPO, demonstrating its effectiveness in complex state spaces.
Conclusion and Future Work
By focusing on state patterns and aligning rewards with episodic outcomes, this method provides a more effective way to train adversarial agents. While the LSTM-based memory works well, the authors suggest that moving to a Transformer architecture could further improve performance in games with massive state vectors like StarCraft II. Additionally, further theoretical study into the impact of reward variance on the learning process remains an open area for exploration.
Summary updated