Manuscript Offprint

arXiv:2610.31558

Diffusion Language Models for Perplexity-Aware Black-Box Attacks

Ali Al-Lawati, Elsayed Eshra, Dongwon Lee, Suhang Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Continuous-space attacks find prompts that trigger malicious behaviors, such as overthinking, in black-box LLMs by sampling or optimizing over a low-dimensional Gaussian latent space and decoding it to text through a random mapping and nearest-token lookup. Because the random mapping is not learned from language, its prompts can be highly unnatural, and as such easily detectable through input guardrails, and the risk estimates they yield are not grounded in natural prompts. In this paper, we demonstrate that the same continuous latent-space framework can be coupled directly to a learned generative distribution over language, a continuous diffusion language model (dLLM), which removes the artificial random mapping while preserving the standard-Gaussian latent formulation and the downstream sampling or optimization procedure. We evaluate this approach under two settings: sampling-based estimation using RareTrap and optimization-based search using ThinkTrap. We find that character-level perplexity drops from 103−10710^{3}-10^{7} to 3–5 in RareTrap and from 20–28 to 4.3–5.4 in ThinkTrap. We also find that model risk estimates can differ by an order of magnitude across the two mappings.

1 Introduction

A novel class of attacks on black-box LLMs has recently been introduced, showing effectiveness in triggering malicious behaviors, such as overthinking (Kumar et al., 2025; Li et al., 2025a), through optimization (Li et al., 2025b) or sampling (Eshra et al., 2026a). These attacks, which we refer to as continuous-space attacks, introduce a low-dimensional continuous latent space and use random projection matrices (Rahimi and Recht, 2007) to map latent vectors to discrete prompts. This reduces adversarial prompt search to a continuous low-dimensional space while allowing the target LLM to be queried only through its outputs.

Figure

Figure

Figure 1: (Top) The dLLM-based mapping substitutes random mapping, while the search and the target LLM are unchanged. (Bottom) It lowers hit-prompt character perplexity on target models.

We refer to this latent-to-prompt transformation as random mapping. Random mappings enable tractable continuous-space search on a black-box target model by decoupling the search process from the target model. However, despite their effectiveness, this class of attacks suffers from a key weakness: since random mappings are not learned from natural language, their geometry reflects the statistical structure of token embeddings rather than the structure of actual texts. Consequently, the discovered prompts from continuous-space attacks do not resemble natural language and, as a result, exhibit extremely high perplexity that makes them readily distinguishable from authentic instructions (Zhang et al., 2026). Thus, the prompts that trigger the attack may be easily flagged by the input guardrails.

of the LLM ecosystem. Moreover, because legitimate users are unlikely to issue prompts with such abnormally high perplexity, the LLM reliability estimates (Eshra et al., 2026a) based on a random mapping distribution do not provide an effective measure of LLM robustness to inputs that may organically occur in real deployment.

Therefore, it is critical to develop an effective framework that generates adversarial and more natural prompts that trigger malicious behaviors, e.g., overthinking, and that can either estimate how likely such behaviors are or search for prompts that maximize them. However, there are several challenges to developing such a framework: (i) the mapping must be deterministic and preserve continuity to enable effective optimization and probability estimation; (ii) the framework must make prompts natural without giving up black-box access. Continuous-space attacks offer a natural foundation for these tasks, but their effectiveness depends on the mapping from latent to prompt space.

To address these challenges, the recent introduction of continuous diffusion language models (dLLMs) motivates us to propose an embarrassingly simple yet effective framework. A dLLM can serve the role of the random mapping by transforming continuous noise into discrete text through a learned generative process, while additionally providing a representation shaped by language. Recent work demonstrates that dLLMs can generate almost entirely in continuous embedding space before realizing tokens (Hu et al., 2026), leverage learned embedding geometry for substantial likelihood gains (Yang et al., 2026), and formulate generation as a mapping from a latent prior to text (Guo et al., 2026). As a result, a representation learned directly for language modeling potentially offers a more natural decoding space for continuous-space attacks.

Therefore, in this paper, we investigate a novel problem of whether a dLLM-based representation can serve as a drop-in replacement for the random mapping used in continuous-space attacks (Figure 1). Using a pretrained dLLM's standard-Gaussian input noise as the latent keeps the mapping space continuous and keeps the attack black-box, since the dLLM needs no access to the target beyond its outputs. To this end, we ask two research questions. (RQ1) Can dLLMs provide a viable alternative to the random mapping in continuous-space attacks? (RQ2) Does using a dLLM-based mapping produce attack prompts that better resemble natural language? To answer these questions, we conduct a focused study using RareTrap (Eshra et al., 2026a), a sampling-based attack framework for targeted behavior evaluation, and ThinkTrap (Li et al., 2025b), an optimization-based attack. Together, these frameworks cover both sampling- and optimization-based approaches to continuous-space attacks, allowing us to evaluate dLLM-based representations across complementary search paradigms.

Our main contributions are: (i) We propose a plug-in framework in which a dLLM-based mapping substitutes the random mapping in both sampling- and optimization-based continuous-space attacks without changing the search procedure. RareTrap still finds over-generating prompts on nine of ten targets, ThinkTrap makes comparable progress across mappings, and the mapping adds only 3–11% to the compute of ThinkTrap (Findings 1, 2, and 4); (ii) We show that the dLLM-based mapping’s prompts are far closer to natural text. Hit prompts (that trigger over-generation) have character-level perplexity of 3–5 in RareTrap, against 10310^{3}– 10710^{7} under the random mapping, and 4.3–5.4 in ThinkTrap, against 20–28, and conditioning on the behavior selects more natural prompts (Findings 5–6); and (iii) We find that risk estimates built from unnatural prompts can misjudge a model’s risk on natural prompt inputs. The random mapping overstates over-generation on most targets and understates it on GPT-OSS-20B and Claude Sonnet 4.6. It places Claude Sonnet 4.6 about 40×40\times below GPT-5.4 in terms of over-generation risk, while under the dLLM-based mapping the two are within a factor of 1.6 (Finding 3).

Together, these results show that the mapping shapes both the prompts found by continuous-space attacks and the behavior their risk estimates characterize, independently of the search procedure. Replacing the random mapping with a pretrained dLLM preserves black-box access to the target, and adds little computational cost. Furthermore, it turns continuous-space sampling methods into more reliable tools to evaluate models, based on natural prompts.

References (41)