RL-ATTACK: A Generalized Black-Box Adversarial Attack on Language Models via Reinforcement Learning
Abstract
Large language models (LLMs) exhibit vulnerabilities to adversarial perturbations that can induce unintended responses. These vulnerabilities can be identified via intentional attacks and subsequently used to improve model safety. In black-box settings where gradients are inaccessible, existing methods tend to guess adversarial transformations using external knowledge, ignoring the information provided by the target model. To mitigate this, we propose a trainable black-box framework based on reinforcement learning, which learns from the target model to generate tailored adversarial transformations. We demonstrate that our approach achieves lower post-attack accuracy, greater query efficiency and better semantic preservation on both natural language inference and generative Q&A tasks. On natural language inference, it drives post-attack accuracy to 2% within 20 queries. Against generative language models, our trained attacker consistently achieves lower post-attack accuracy than the untrained attacker and wins in 4 out of 6 settings when compared to a strong optimization-based baseline. We further experiment with multiple reward designs and training settings, and we find that no design or setting is consistently dominant. Our code is available at https://github.com/taikunudel/RL-ATTACK.
Create a lesson
Metadata
- Categories
- cs.CL, cs.CR
- Comments
- Accepted as a regular paper at IEEE EdgeCom 2026
Related papers
Exploring Multi-Player Social Games as Verifiable Training Grounds for Large Language Models
Shared title terminologycs.CLKeyu He, Michael Li, Jiarui Liu et al.
PazaBench: Large-Scale ASR Benchmark for Low-Resource Languages in Africa
Shared title terminologycs.CLMercy Muchai, Nick Mumero Mwangi, Kevin Chege et al.
DKnown-Jev-2: Article-Level Answer-Evidence Classification and Efficient Inference with a Pre-trained Language Model
Shared title terminologycs.CLQi Li, Jianjun Xu, Jiu Li et al.
LimeTree: Linear-Memory Graph Neural Networks over Tree-Graphs for Resource-Efficient Language Modeling and Context Extrapolation
Shared title terminologycs.CLElisabeth Fink
CocoonBench: Can Multilingual Search Agents Escape Language Information Cocoons?
Shared title terminologycs.CLHongchuan Zeng, Bowen Liu, Changjiang Gao et al.
From Rewarding What Models Say to How They Think: Attention Process Reward Model for LLM Reinforcement Learning
Shared title terminologycs.CLKairong Han, Nuanqiao Shan, Ziyu Zhao et al.