Abstract
Red-teaming Large Language Models (LLMs) is a critical process for identifying safety vulnerabilities. Traditional white-box attacks often struggle with the trade-off between optimization efficiency and the fluency of the resulting adversarial prompts. This paper introduces LARGO (Latent Adversarial Reflection through Gradient Optimization), a novel technique that bridges the gap between continuous gradient optimization and discrete text generation. By optimizing adversarial attacks directly in an LLM's latent space and using the model's own self-reflective capabilities to decode these vectors into natural language, LARGO achieves superior attack success rates while maintaining high stealth and fluency.
Introduction
As Large Language Models (LLMs) are increasingly integrated into sensitive applications, ensuring their robustness against malicious prompts is paramount. Automated white-box attacks, such as Greedy Coordinate Gradient (GCG), have demonstrated that gradient-based searches can effectively find adversarial suffixes. However, because language is discrete, these methods often produce nonsensical "gibberish" strings that are easily detected by perplexity-based filters.
Conversely, agentic methods like AutoDAN or PAIR generate fluent, natural-sounding jailbreaks but often require complex setups, human-crafted prototypes, or separate attacker models. LARGO addresses this divide by leveraging the mathematical efficiency of continuous gradient optimization while producing human-readable prompts through the model's internal "self-reflection."
Methodology
LARGO treats the target LLM as a lens into its own internal states through a three-stage iterative process:
- Latent Prompt Optimization: Instead of searching for discrete tokens, LARGO appends a continuous latent vector (a sequence of embeddings) to a harmful query. It utilizes standard gradient descent (Adam) within this continuous space to find a vector that maximizes the probability of the model generating an affirmative response (e.g., "Sure, I can help with that.").
- Self-Reflective Decoding: To convert these continuous vectors into usable text, LARGO prompts the target LLM to translate the optimized vector into English. By feeding the vector into the model using a benign template—such as "Summarize the message:
<latent_vector>"—the LLM decodes its own adversarial "thought" into a discrete, natural language suffix. - Back-Projection and Iterative Refinement: The generated text suffix is projected back into the embedding space. The optimization and decoding steps are repeated iteratively (averaging 6.4 iterations) until a successful jailbreak is achieved.
Experimental Setup
The authors evaluated LARGO across several benchmarks and metrics:
- Datasets: A random sample of 200 prompts from AdvBench (covering profanity, cybercrime, and dangerous suggestions) and a 200-prompt subset from JailbreakBench.
- Metrics: Effectiveness was measured using Keyword-based Attack Success Rate (ASR) and StrongREJECT (a GPT-4 based evaluator). Stealth was measured via Perplexity (using GPT-2) to determine how natural the generated text appeared.
Key Results and Insights
Superior Performance and Stealth
LARGO significantly outperformed existing baselines in both effectiveness and fluency. On Llama-2-7B (AdvBench), LARGO achieved an ASR of 42.0%, surpassing GCG (39.0%) and AutoDAN (18.0%). On the Phi-3-4B model, the ASR reached 79.0%.
Crucially, LARGO's suffixes are highly stealthy. While GCG produces strings with a perplexity of 3249.92, LARGO’s suffixes maintain a perplexity of 64.88, making them indistinguishable from human-written text to most security filters.
The "Mind Reading" Exploit
A core insight of this research is that LLMs can interpret their own adversarial latent states. By forcing a model to "summarize" a malicious continuous vector, the model naturally generates a fluent suffix that triggers the intended malicious behavior. This suggests that the gradient search successfully encodes specific semantic adversarial patterns rather than mere noise.
Transferability and Universality
LARGO demonstrates high transferability across different model families. Suffixes optimized on Llama-2-13B successfully transferred to Llama-2-7B with a 31.37% success rate and to Qwen-2.5-14B with a 13.29% success rate. Furthermore, when optimizing a single universal suffix to work across multiple prompts, LARGO achieved 22.0% ASR on Llama-2-7B, compared to just 9.5% for GCG.
Discussion and Limitations
While highly effective, LARGO has certain constraints. There is a positive correlation between suffix length and success rate; the most effective attacks required 200-300 tokens. Additionally, the iterative refinement process involves a computational overhead of approximately 25 seconds per iteration.
Conclusion
LARGO highlights a critical vulnerability in current LLM alignment strategies: models are susceptible to adversarial influence at the latent representation level. The ability of a model to "decode" its own adversarial states into fluent text suggests that safety mechanisms must move beyond monitoring discrete input/output tokens and begin addressing the security of the continuous latent space.
Summary updated