Mask-GCG: Are All Tokens in Adversarial Suffixes Necessary for Jailbreak Attacks?
On the map: LLM safety and security → Jailbreaking
Abstract (arXiv)
Jailbreak attacks on Large Language Models (LLMs) have demonstrated various successful methods whereby attackers manipulate models into generating harmful responses that they are designed to avoid. Among these, Greedy Coordinate Gradient (GCG) has emerged as a general and effective approach that optimizes the tokens in a suffix to generate jailbreakable prompts. While several improved variants of GCG have been proposed, they all rely on fixed-length suffixes. However, the potential redundancy within these suffixes remains unexplored. In this work, we propose Mask-GCG, a plug-and-play method that employs learnable token masking to identify impactful tokens within the suffix. Our approach increases the update probability for tokens at high-impact positions while pruning those at low-impact positions. This pruning not only reduces redundancy but also decreases the size of the gradient space, thereby lowering computational overhead and shortening the time required to achieve successful attacks compared to GCG. We evaluate Mask-GCG by applying it to the original GCG and several improved variants. Experimental results show that most tokens in the suffix contribute significantly to attack success, and pruning a minority of low-impact tokens does not affect the loss values or compromise the attack success rate (ASR), thereby revealing token redundancy in LLM prompts. Our findings provide insights for developing efficient and interpretable LLMs from the perspective of jailbreak attacks.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Placed in Jailbreaking, one of 12 directions in LLM safety and security. Builds on 30 of its 36 references that are in the map. First posted on arXiv 8 Sep 2025.
Builds on
30 of 36 references.
Closest ancestors · 8
Same direction, newest first
- 2025Unnatural Languages Are Not Bugs but Features for LLMs2 Mar
- 2025Reasoning-Augmented Conversation for Multi-Turn Jailbreak Attacks on Large Language Models16 Feb
- 2024Faster-GCG: Efficient Discrete Optimization Jailbreak Attacks against Aligned Large Language Models20 Oct
- 2024Improved Techniques for Optimization-Based Jailbreaking on Large Language Models31 May
- 2024Boosting Jailbreak Attack with Momentum2 May
- 2024AmpleGCG: Learning a Universal and Transferable Generative Model of Adversarial Suffixes for Jailbreaking Both Open and Closed LLMs11 Apr
- 2024Accelerating Greedy Coordinate Gradient and General Prompt Optimization via Probe Sampling2 Mar
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Models27 Jul
Other references · 22
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,626
- 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,403
- 2023A Survey of Large Language Modelscited by 2,576
- 2020A Primer in BERTology: What we know about how BERT workscited by 815
- 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compressioncited by 453
- 2023LongLoRA: Efficient Fine-tuning of Long-Context Large Language Modelscited by 244
- 2023PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Trainingcited by 111
- 2024Jailbreak Vision Language Models via Bi-Modal Adversarial Promptcited by 109
- 2025Token Reduction Should Go Beyond Efficiency in Generative Models -- From Vision, Language to Multimodalitycited by 50
10 more
- 2023Multimodal LLMs for health grounded in individual-specific datacited by 49
- 2025Manipulating Multimodal Agents via Cross-Modal Prompt Injectioncited by 44
- 2025AGENTSAFE: Benchmarking the Safety of Embodied Agents on Hazardous Instructionscited by 38
- 2023Information Retrieval Meets Large Language Models: A Strategic Report from Chinese IR Communitycited by 29
- 2025Towards Understanding the Safety Boundaries of DeepSeek Models: Evaluation and Findingscited by 27
- 2024When LLMs Meets Acoustic Landmarks: An Efficient Approach to Integrate Speech into Large Language Models for Depression Detectioncited by 17
- 2024DLP: towards active defense against backdoor attacks with decoupled learning processcited by 10
- 2023Attention Alignment and Flexible Positional Embeddings Improve Transformer Length Extrapolationcited by 9
- 2024NBA: defensive distillation for backdoor removal via neural behavior alignmentcited by 7
- 2023Stone Needle: A General Multimodal Large-scale Model Framework towards Healthcarecited by 4
Built on by
Citing papers per year: 2025: 3; 2026: 3.
6 papers.
- 2025SecureWebArena: A Holistic Security Evaluation Benchmark for LVLM-based Web Agentscited by 19
- 2026StealthGraph: Exposing Domain-Specific Risks in LLMs through Knowledge-Graph-Guided Harmful Prompt Generationcited by 4
- 2025Sequential Comics for Jailbreaking Multimodal Large Language Models via Structured Visual Storytellingcited by 2
- 2025Breaking Minds, Breaking Systems: Jailbreaking Large Language Models via Human-like Psychological Manipulationcited by 2
- 2026SlotGCG: Exploiting the Positional Vulnerability in LLMs for Jailbreak Attackscited by 2
- 2026Beyond Suffixes: Token Position in GCG Adversarial Attacks on Large Language Modelscited by 0
- 2026SlotGCG: Exploiting the Positional Vulnerability in LLMs for Jailbreak Attacks4 Jun 2026
- 2026Beyond Suffixes: Token Position in GCG Adversarial Attacks on Large Language Models3 Feb 2026
- 2026StealthGraph: Exposing Domain-Specific Risks in LLMs through Knowledge-Graph-Guided Harmful Prompt Generation8 Jan 2026
- 2025Breaking Minds, Breaking Systems: Jailbreaking Large Language Models via Human-like Psychological Manipulation20 Dec 2025
- 2025Sequential Comics for Jailbreaking Multimodal Large Language Models via Structured Visual Storytelling16 Oct 2025
- 2025SecureWebArena: A Holistic Security Evaluation Benchmark for LVLM-based Web Agents11 Oct 2025
Similar, not cited
Close in wording, no citation either way
- 2024Exploiting the Index Gradients for Optimization-Based Jailbreaking on Large Language Models
- 2026Breadth Beats Depth: Improving GCG-Based Jailbreak Optimization with Breadth-Oriented Suffix Search
- 2025The Resurgence of GCG Adversarial Attacks on Large Language Models
- 2025Universal Jailbreak Suffixes Are Strong Attention Hijackers
- 2024AmpleGCG-Plus: A Strong Generative Model of Adversarial Suffixes to Jailbreak LLMs with Higher Success Rates in Fewer Attempts
- 2025Advancing Jailbreak Strategies: A Hybrid Approach to Exploiting LLM Vulnerabilities and Bypassing Modern Defenses
- 2024Advancing Adversarial Suffix Transfer Learning on Aligned Large Language Models
- 2024AttnGCG: Enhancing Jailbreaking Attacks on LLMs with Attention Manipulation