Advantage-based Temporal Attack in Reinforcement Learning
Organizations: the School of Computer Science and Engineering, Sun Yat-sen University, Guangzhou 510006, China
Abstract
Extensive research demonstrates that Deep Reinforcement Learning (DRL) models are susceptible to adversarially constructed inputs (i.e., adversarial examples), which can mislead the agent to take suboptimal or unsafe actions. Recent methods improve attack effectiveness by leveraging future rewards to guide adversarial perturbation generation over sequential time steps (i.e., reward-based attacks). However, these methods are unable to capture dependencies between different time steps in the perturbation generation process, resulting in a weak temporal correlation between the current perturbation and previous perturbations.In this paper, we propose a novel method called Advantage-based Adversarial Transformer (AAT), which can generate adversarial examples with stronger temporal correlations (i.e., time-correlated adversarial examples) to improve the attack performance. AAT employs a multi-scale causal self-attention (MSCSA) mechanism to dynamically capture dependencies between historical information from different time periods and the current state, thus enhancing the correlation between the current perturbation and the previous perturbation. Moreover, AAT introduces a weighted advantage mechanism, which quantifies the effectiveness of a perturbation in a given state and guides the generation process toward high-performance adversarial examples by sampling high-advantage regions. Extensive experiments demonstrate that the performance of AAT matches or surpasses mainstream adversarial attack baselines on Atari, DeepMind Control Suite and Google football tasks.
Figures & tables
| notation | Explanation |
|---|---|
| Markov Decision Process | |
| State space, action space, reward function, transition probaility, discount factor | |
| , , | Policy, trajectory, trajectory distribution under policy |
| Expected cumulative reward | |
| , | Adversarial perturbation at time |
| Adversarial state, |
| Breakout | ||||||||
|---|---|---|---|---|---|---|---|---|
| White-box | Black-box | |||||||
| Method | DQN | A3C | TRPO | PPO | DQN | A3C | TRPO | PPO |
| * FGSM Skip S-T EDGE PA-AD AdvRL-GAN TSGE PIA AAT | 355.83 0.89 34.30 3.78 31.45 4.15 57.68 5.61 43.26 3.51 46.35 4.31 32.44 5.42 6.42 4.21 35.17 4.44 6.56 2.54 | 384.52 1.45 35.45 4.05 32.46 4.33 55.44 2.78 46.32 3.49 53.87 3.27 9.11 2.56 15.29 3.42 27.84 4.23 8.21 3.51 | 415.64 2.73 34.58 4.54 38.79 3.98 58.47 3.12 44.89 4.27 47.96 4.32 33.98 3.75 25.46 4.21 40.51 3.41 5.98 3.81 | 426.58 2.14 40.56 3.82 38.42 4.08 44.36 3.84 50.33 4.35 65.73 3.91 38.21 2.74 34.32 3.27 53.47 2.83 6.88 2.56 | 355.83 0.89 118.32 8.32 88.46 7.74 68.32 5.24 56.88 6.13 98.48 7.88 40.60 9.56 43.73 6.02 53.45 7.23 28.32 6.21 | 384.52 1.45 120.42 9.84 90.34 9.47 68.21 8.54 60.36 7.43 123.63 6.83 45.28 7.47 53.46 8.23 48.72 9.01 20.36 7.14 | 412.64 2.73 128.24 4.32 92.34 10.56 70.24 11.05 59.86 9.35 113.74 8.46 46.68 9.37 52.61 7.83 63.47 8.42 22.22 8.73 | 426.58 2.14 130.26 7.68 95.42 8.75 69.21 9.42 60.84 8.35 99.87 9.84 48.23 7.81 89.36 8.43 100.47 9.41 20.21 7.21 |
| Pong | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Adversarial training | SA-MDP | POTBSG | ||||||||||
| Method | DQN | A3C | TRPO | PPO | DQN | A3C | TRPO | PPO | DQN | A3C | TRPO | PPO |
| * FGSM Skip S-T EDGE PA-AD AdvRL-GAN AAT | 17.88 0.33 16.08 0.32 16.11 1.45 15.12 0.86 10.12 1.33 -4.67 1.37 -3.56 1.54 - 10.21 0.67 | 20.10 0.40 19.19 0.58 18.11 0.64 19.98 1.47 5.34 1.57 -6.78 1.37 -2.41 1.43 - 8.15 1.52 | 19.92 0.35 18.78 0.64 18.13 0.37 18.68 0.62 3.73 1.35 -7.36 1.05 -5.76 0.94 - 12.06 1.34 | 20.96 0.05 18.86 0.74 19.38 1.01 20.11 0.32 -2.98 1.84 -4.62 2.01 -5.46 1.51 - 7.98 1.18 | 18.88 1.03 17.38 0.24 16.11 1.36 17.32 0.51 13.42 1.41 -1.41 1.74 -2.27 1.35 - 8.21 1.34 | 19.12 0.35 19.07 0.91 18.74 1.07 17.18 0.67 9.74 1.35 - 3.41 2.17 -1.21 2.36 -1.48 2.41 | 20.02 0.41 18.43 0.5 19.13 1.32 17.76 1.54 10.54 2.07 -8.13 1.87 -6.26 1.97 - 9.47 1.84 | 20.16 0.51 19.99 0.84 18.31 1.54 18.21 2.07 13.78 1.74 1.32 1.98 - 3.46 2.13 -3.24 2.07 | 17.96 1.52 16.63 1.69 16.41 2.04 14.12 1.87 12.42 1.64 -6.21 2.07 -9.56 1.73 - 9.74 2.13 | 18.74 0.25 16.04 0.74 17.41 1.86 16.13 1.62 8.44 1.73 - 7.37 1.61 -6.19 1.87 -4.15 1.92 | 19.12 0.53 17.01 1.02 17.19 0.98 18.18 1.41 18.41 1.23 -5.46 1.17 -7.21 1.32 - 9.67 1.12 | 19.46 0.34 17.43 2.4 18.74 1.52 18.22 2.14 -4.33 1.52 -6.74 1.74 - 7.88 1.32 -7.32 2.07 |
| Method | Pong | Breakout | Seaquest | Humanoid | Hopper | Walker |
|---|---|---|---|---|---|---|
| FGSM Skip S-T EDGE AdvRL-GAN AAT | 5.3 8.5 13.4 12.8 14.2 1.56 | 8.4 13.7 9.8 16.6 18.8 2.2 | 4.3 7.2 5.5 9.4 9.83 2.4 | 6.3 8.4 8.3 4.1 10.58 1.5 | 9.6 13.2 14.1 13.5 15.4 2.1 | 7.8 12.9 15.6 16.4 16.8 2.6 |
| Environments | Data type | DQN | A3C | TRPO | PPO |
|---|---|---|---|---|---|
| Seaquest | Expert data Medium data Random data | 359.82 367.41 2325.65 | 353.64 373.56 2354.29 | 360.23 359.89 2332.79 | 359.67 393.45 2467.83 |
| Qbert | Expert data Medium data Random data | 236.89 379.46 5020.57 | 183.92 245.67 5596.35 | 203.89 299.67 4478.36 | 211.67 374.56 6340.27 |
| Shenghong He is currently a PhD student under the supervision of Prof. Chao Yu in the School of Computer Science and Engineering, Sun Yat-sen University, China. He has published a few works at IEEE TDSC and TKDE, and is now working on the problem of offline learning and security with deep reinforcement learning. |
| Chao Yu received the Ph.D. degree in computer science from the University of Wollongong, Australia, in 2014. He is currently a professor at the School of Computer Science and Engineering, Sun Yat-sen University, China. He has published more than 100 papers in prestigious conferences and journals, such as ICML, AAAI, NeurIPS, IEEE TCYB, IEEE TVT, and IEEE TKDE. His research interests include multi-agent systems, reinforcement learning, and their wide applications in autonomous driving, smart grid, robotic control, and intelligent healthcare. |
| Danying Mo is currently a PhD student under the supervision of Prof. Chao Yu in the School of Computer Science and Engineering, Sun Yat-sen University, China. She is now working on the problem of Agent. |
| Yucong Zhang is currently a PhD student under the supervision of Prof. Chao Yu in the School of Computer Science and Engineering, Sun Yat-sen University, China. He has published a few works at AAMAS and is now working on the problem of deep reinforcement learning. |
| Yinqi Wei received the B.Sc. degree in engineering from Sun Yat-Sen University, Shenzhen, Guangdong, China, in 2024, and the M.Sc. degree in electronic from Nanyang Technological University, Singapore, in 2025, respectively. |
Appendix figures & tables23 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | |||
|---|---|---|---|
| GPT | Perturbation network | ||
| Name | value | Name | value |
| Number of layers | 6 | Linear layer | 128, 3136 |
| Attention heads | 8 | Aactivite function | Rlue |
| Embedding dimension | 128 | ConvTranspose2d | 64,32,4 |
| Batch size | Atari:128 DeepMind:256 | kernel_size | 3,4,8 |
| Pong | ||||||||
|---|---|---|---|---|---|---|---|---|
| White-box | Black-box | |||||||
| Method | DQN | A3C | TRPO | PPO | DQN | A3C | TRPO | PPO |
| * FGSM Skip S-T EDGE PA-AD AdvRL-GAN TSGE PIA AAT | 19.83 1.31 -20.31 0.48 -18.35 0.74 -17.86 1.23 -19.36 0.98 - 21.00 0.00 -12.44 0.22 -15.34 2.37 -17.23 1.95 -20.96 0.04 | 21.00 0.00 -20.35 0.25 -19.36 1.03 -10.84 3.41 -14.33 2.54 -19.8 0.21 -11.18 1.78 -12.47 2.44 -18.34 0.58 - 20.61 0.33 | 20.64 0.32 - 20.48 0.15 -18.79 0.27 -12.77 2.14 -14.89 1.95 -9.98 2.13 -18.4 1.21 -19.76 0.34 -17.41 1.43 -19.97 1.24 | 21.00 0.00 -19.56 0.24 -15.42 2.84 -14.66 2.31 -15.13 3.41 -10.08 3.42 - 20.12 0.24 -16.38 2.18 -17.73 0.31 -19.87 0.27 | 19.83 1.31 18.38 0.54 18.10 0.21 18.12 0.06 -9.22 3.45 -10.31 2.78 -13.56 1.44 -11.53 0.97 -9.87 0.12 - 18.34 0.43 | 21.00 0.00 20.25 0.14 20.21 0.34 19.65 0.46 -6.54 2.37 -9.31 3.56 -11.36 2.77 -8.24 3.07 -9.21 2.89 - 18.45 1.94 | 20.64 0.32 19.88 0.23 18.02 0.71 19.88 1.02 -8.98 3.07 -13.86 2.94 - 16.36 0.97 -13.36 1.41 -11.49 2.51 -16.06 1.35 | 21.00 0.00 20.26 0.34 19.18 0.81 20.01 0.43 -5.98 2.34 -15.67 1.95 -10.46 2.47 -10.73 2.85 -13.02 3.14 - 18.98 1.07 |
| Chopper Command | ||||||||
|---|---|---|---|---|---|---|---|---|
| White-box | Black-box | |||||||
| Method | DQN | A3C | TRPO | PPO | DQN | A3C | TRPO | PPO |
| * FGSM Skip S-T EDGE PA-AD AdvRL-GAN TSGE PIA AAT | 3555.83 23.54 401.32 14.53 770.21 15.39 1180.65 17.41 879.36 21.06 789.35 24.68 1461.37 19.46 876.34 23.44 854.37 19.81 408.68 19.74 | 3864.12 19.87 468.36 17.84 778.33 21.33 1098.46 17.49 906.24 20.19 1335.46 23.54 1389.56 23.78 1031.27 21.94 986.54 20.84 410.21 21.07 | 3615.44 26.41 470.32 19.97 789.34 21.42 1206.26 25.46 896.63 21.53 784.36 25.19 1280.62 22.97 987.31 22.43 1052.48 21.68 420.98 20.97 | 3842.52 28.33 469.36 20.89 780.56 21.41 1240.36 23.01 900.44 20.89 578.69 24.81 1350.43 23.07 1003.42 22.74 1203.47 20.08 418.36 19.35 | 3555.83 23.54 2015.46 29.35 2898.36 31.04 2754.38 28.74 2012.46 31.14 893.72 30.82 1864.32 31.79 1562.49 34.03 1671.39 29.04 568.56 27.89 | 3864.12 19.87 2212.42 31.81 2934.98 29.87 2856.42 30.47 2984.56 33.04 1893.67 31.78 1906.48 32.46 1935.47 32.75 2085.81 30.84 628.54 30.07 | 3615.44 26.41 2189.38 31.25 2856.94 32.18 2789.35 31.45 2365.38 32.85 1352.71 30.94 1832.91 29.67 1489.26 30.85 1793.91 32.42 609.88 30.33 | 3842.52 28.33 2306.85 30.84 2890.52 29.47 2745.35 33.42 2689.36 32.81 987.62 31.74 1896.54 32.83 1328.46 29.84 1573.23 33.45 635.86 29.04 |
| Seaquest | ||||||||
|---|---|---|---|---|---|---|---|---|
| White-box | Black-box | |||||||
| Method | DQN | A3C | TRPO | PPO | DQN | A3C | TRPO | PPO |
| * FGSM Skip S-T EDGE PA-AD AdvRL-GAN TSGE PIA AAT | 2385.32 15.43 17.35 3.56 89.42 3.02 150.35 2.97 75.46 4.03 18.97 0.98 108.23 4.56 19.32 2.78 23.71 3.54 18.34 1.07 | 2856.96 16.84 65.42 3.07 158.34 4.13 221.84 3.27 98.55 3.08 17.63 2.41 129.33 2.83 35.43 1.76 48.29 2.81 20.22 1.23 | 1856.89 14.87 77.54 3.21 198.33 3.44 210.04 2.97 98.45 3.12 23.54 2.87 119.83 3.04 54.82 2.14 49.41 2.52 19.84 2.03 | 2108.38 16.53 74.32 2.17 178.26 3.82 256.83 3.04 100.82 3.51 24.81 3.71 132.42 2.87 54.39 3.17 53.28 2.89 21.42 3.07 | 2385.32 15.43 290.32 5.74 300.48 6.52 328.18 4.31 298.43 7.98 178.46 5.04 245.44 6.15 167.89 6.71 216.74 7.16 80.45 5.34 | 2856.96 16.84 65.42 7.32 158.34 6.89 221.84 7.18 98.55 7.24 17.63 5.37 129.33 7.05 35.43 6.05 48.29 6.19 20.22 5.23 | 1856.89 14.87 77.54 6.83 198.33 8.47 210.04 5.24 98.45 6.53 23.54 4.32 119.83 3.56 54.82 5.41 49.41 4.32 19.84 3.17 | 2108.38 16.53 74.32 6.44 178.26 7.59 256.83 6.37 100.82 6.04 24.81 3.21 132.42 4.68 54.39 5.24 53.28 4.52 21.42 4.37 |
| Qbert | ||||||||
|---|---|---|---|---|---|---|---|---|
| White-box | Black-box | |||||||
| Method | DQN | A3C | TRPO | PPO | DQN | A3C | TRPO | PPO |
| * FGSM Skip S-T EDGE PA-AD AdvRL-GAN TSGE PIA AAT | 17890.93 2.35 165.43 2.49 678.35 3.13 543.44 2.87 235.68 3.04 152.34 2.89 124.82 1.87 48.39 4.46 98.93 3.51 50.56 1.74 | 21840.35 3.41 189.34 2.93 543.27 3.97 569.38 4.08 253.96 2.96 148.92 3.18 139.84 2.47 83.98 3.21 129.46 4.32 60.22 2.19 | 22840.56 1.52 205.33 3.01 667.32 2.95 510.35 3.17 199.84 3.46 175.62 3.58 129.83 4.02 58.01 3.96 109.49 2.34 58.42 2.78 | 2458.68 2.87 210.32 3.73 680.34 3.15 568.23 4.01 1246.21 2.77 101.23 3.28 130.58 3.92 94.35 2.81 117.43 3.07 54.32 2.81 | 17890.93 2.35 165.43 5.46 678.35 8.32 543.44 3.45 235.68 7.01 152.34 5.32 124.82 4.98 48.39 5.46 98.93 4.92 50.56 3.41 | 21840.35 3.41 189.34 6.42 543.27 6.51 569.38 6.73 253.96 5.82 148.92 7.03 139.84 6.54 83.98 4.98 129.46 5.94 60.22 5.33 | 22840.56 1.52 205.33 5.93 667.32 6.48 510.35 6.82 199.84 7.03 175.62 6.35 129.83 5.98 58.01 7.13 109.49 6.32 58.42 5.18 | 2458.68 2.87 210.32 6.25 680.34 5.48 568.23 6.95 1246.21 5.39 101.23 6.33 130.58 6.43 94.35 7.36 117.43 5.83 54.32 4.73 |
| Space Invaders | ||||||||
|---|---|---|---|---|---|---|---|---|
| White-box | Black-box | |||||||
| Method | DQN | A3C | TRPO | PPO | DQN | A3C | TRPO | PPO |
| * FGSM Skip S-T EDGE PA-AD AdvRL-GAN TSGE PIA AAT | 1005.38 2.41 123.50 3.42 169.80 4.57 210.32 2.78 156.33 4.02 151.27 2.54 160.32 3.87 103.42 2.74 123.57 1.98 59.59 2.03 | 1185.42 1.98 136.34 4.07 145.83 4.26 189.56 3.52 189.32 3.49 163.52 2.97 176.32 3.44 86.43 3.14 98.47 2.18 51.26 2.16 | 1456.26 2.74 138.23 3.78 141.56 4.01 208.93 3.42 172.34 2.97 132.84 3.15 166.26 3.28 79.98 3.61 104.72 2.73 60.35 2.32 | 1653.48 2.43 149.23 3.52 185.39 3.93 219.27 4.01 188.93 3.58 89.73 3.82 170.32 3.75 59.87 3.93 93.42 3.07 61.38 2.54 | 1005.38 2.41 123.50 5.43 169.80 7.02 210.32 6.54 156.33 5.93 151.27 6.28 160.32 4.35 103.42 5.28 123.57 6.53 68.59 4.02 | 1185.42 1.98 136.34 6.03 145.83 6.43 189.56 5.86 189.32 6.87 163.52 7.13 176.32 4.56 86.43 5.23 98.47 6.33 51.26 5.27 | 1456.26 2.74 138.23 5.91 141.56 6.23 208.93 5.97 172.34 6.37 132.84 6.84 166.26 5.36 79.98 6.38 104.72 5.86 60.35 4.89 | 1653.48 2.43 149.23 6.32 185.39 6.74 219.27 5.86 188.93 7.03 89.73 6.74 170.32 5.84 59.87 5.98 93.42 6.07 61.38 5.07 |
| Pong | ||||||||
|---|---|---|---|---|---|---|---|---|
| MF | MimicDiffusion | |||||||
| Method | DQN | A3C | TRPO | PPO | DQN | A3C | TRPO | PPO |
| 18.18 | 19.13 | 18.72 | 20.02 | 19.48 | 20.22 | 19.84 | 20.46 | |
| FGSM | 17.65 | 18.32 | 18.04 | 18.73 | 18.74 | 18.97 | 19.12 | 19.34 |
| Skip | 17.94 | 18.78 | 18.13 | 17.94 | 18.97 | 19.34 | 18.74 | 19.64 |
| S-T | 17.44 | 17.99 | 18.14 | 18.24 | 18.41 | 18.95 | 19.13 | 18.41 |
| Detection method | Environment | FGSM | Skip | S-T | EDGE | PA-AD | AdvRL-GAN | TSGE | PIA | AAT |
|---|---|---|---|---|---|---|---|---|---|---|
| Pong | 0.83 | 0.74 | 0.69 | 0.63 | 0.52 | 0.43 | 0.53 | 0.44 | 0.45 | |
| EPS-AD | Squest | 0.87 | 0.65 | 0.74 | 0.64 | 0.66 | 0.65 | 0.57 | 0.49 | 0.43 |
| Qbert | 0.79 | 0.67 | 0.73 | 0.61 | 0.59 | 0.56 | 0.48 | 0.44 | 0.47 | |
| Pong | 0.77 | 0.54 | 0.68 | 0.71 | 0.64 | 0.34 | 0.39 | 0.41 | 0.35 | |
| LR | Squest | 0.81 | 0.61 | 0.79 | 0.68 | 0.45 | 0.45 | 0.54 | 0.42 | 0.39 |
| Qbert | 0.80 | 0.69 | 0.82 | 0.72 | 0.47 | 0.35 | 0.48 | 0.39 | 0.35 |
| Environments | Data type | DQN | A3C | TRPO | PPO |
|---|---|---|---|---|---|
| Pong | -15.18 -9.36 -12.33 -9.67 | -13.27 -11.59 -10.64 -12.91 | -12.63 -10.84 -13.01 -10.79 | -14.14 -12.56 -10.01 -9.95 | |
| Chopper Command | 1457.34 1678.43 1832.56 1467.43 | 1356.98 1834.14 1754.36 1548.21 | 1543.55 1672.81 1854.66 1456.32 | 1437.63 1783.29 1659.26 1499.57 |
| Method | Pong | Breakout | Seaquest | Humanoid | Hopper | Walker |
|---|---|---|---|---|---|---|
| FGSM Skip S-T EDGE AdvRL-GAN AAT | 5.3 8.5 13.4 12.8 14.2 1.56 | 8.4 13.7 9.8 16.6 18.8 2.2 | 4.3 7.2 5.5 9.4 9.83 2.4 | 6.3 8.4 8.3 4.1 10.58 1.5 | 9.6 13.2 14.1 13.5 15.4 2.1 | 7.8 12.9 15.6 16.4 16.8 2.6 |
| White-box | Black-box | ||||
|---|---|---|---|---|---|
| Environment | Method | D4PG | A3C | D4PG | A3C |
| HalfCheetah | SA MSCSA | 51.25 25.56 | 42.34 25.17 | 52.23 46.59 | 56.37 40.27 |
| Hoper | SA MSCSA | 190.31 118.61 | 74.42 68.72 | 154.43 138.31 | 101.45 108.52 |
| Humanoid | SA MSCSA | 26.43 5.65 | 13.47 4.65 | 37.82 28.31 | 41.37 30.64 |
| Pendulum | SA MSCSA | 40.62 36.51 | 45.34 30.26 | 80.61 78.34 | 82.42 68.35 |
| Walker | SA MSCSA | 85.34 60.61 | 35.36 20.42 | 175.64 128.43 | 105.52 108.36 |
| Strategy | Window Seq. | Reward | Cost (ms) | Notes | |
|---|---|---|---|---|---|
| Exponential | 5 | [5, 10, 20] | 118.3 | 125 | Best trade-off of local and global modeling |
| Exponential | 8 | [8, 16, 32] | 108.7 | 356 | High cost with little gain |
| Linear | 5 | [5, 10, 15] | 235.6 | 119 | Less effective in modeling long-term context |
| Linear | 8 | [8, 12, 16] | 209.3 | 298 | Overhead increases without performance gain |
| Fixed | 5 | [5, 5, 5] | 583.1 | 89 | Poor modeling capacity, lacks multi-scale |
| Exponential | 2 | [2, 4, 8] | 629.8 | 90 | Efficient but may underutilize long-term info |
| White-box | Black-box | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Environment | Method | DQN | A3C | TRPO | PPO | DQN | A3C | TRPO | PPO |
| Pong | AAT-GA AAT-WA | -19.83 - 20.96 | -18.18 - 20.61 | - 19.98 -19.97 | -19.25 - 19.87 | -17.26 - 18.34 | -17.31 - 18.45 | -15.92 - 16.06 | -17.61 - 18.98 |
| Chopper Command | AAT-GA AAT-WA | 400.31 408.68 | 567.33 410.21 | 435.65 420.98 | 420.68 418.36 | 693.27 568.56 | 784.56 628.54 | 610.32 609.88 | 642.55 635.36 |
| Seaquest | AAT-GA AAT-WA | 19.32 18.34 | 20.11 20.22 | 21.52 19.84 | 23.01 21.42 | 90.23 80.45 | 84.51 70.89 | 79.46 60.42 | 79.87 73.58 |
| Qbert | AAT-GA AAT-WA | 69.35 50.56 | 60.03 60.22 | 65.46 58.42 | 71.21 54.32 | 635.67 598.55 | 535.34 478.35 | 635.78 483.21 | 638.42 556.34 |
| Space Invaders | AAT-GA AAT-WA | 70.23 59.59 | 63.46 51.26 | 68.35 60.35 | 73.21 61.38 | 110.42 103.66 | 134.58 126.31 | 124.68 109.84 | 136.27 118.28 |