Manuscript Offprint

arXiv:2609.31552

FragToken: Amplifying LLM Inference Costs through Noncanonical Token Generation

Zihan Wang, Rui Zhang, Xinyuan Qian, Qingchuan Zhao, Hongwei Li, Guowen Xu

ABSTRACT

As large language model (LLM) inference becomes increasingly expensive, resource-consumption attacks pose a growing threat to model providers. Existing attacks typically amplify cost by inducing abnormally long or repetitive outputs on attacker-controlled or triggered requests, making them easier to detect and limiting their deployment-wide impact when benign traffic dominates. In this work, we uncover a previously overlooked token-level attack surface arising from the many-to-one mapping from token sequences to decoded text. Although standard LLMs predominantly generate the canonical token sequences induced by their tokenizers, the same text can also be represented by substantially longer non-canonical sequences. This representational flexibility exposes a new avenue for resource-consumption attacks: an attacker can train the model to favor such sequences, systematically increasing the number of autoregressive decoding steps without a proportional increase in visible response length. However, we empirically find that directly maximizing token fragmentation substantially degrades model utility, producing conspicuous answer-quality failures that undermine attack stealthiness. To address this challenge, we propose FragToken, a training-time framework that combines source-model self-distillation, capacity-aware filtering and budgeting, and BPE-Aligned Merging to induce fragmented generation under ordinary prompts while largely preserving model utility. We evaluate FragToken on four LLMs across three benchmarks. Across the four models, FragToken achieves a three-benchmark average token inflation ratio (TIR) ranging from 1.99 to 2.46, while causing only minor degradation in model utility. Our work reveals a covert LLM supply-chain threat that increases inference cost without requiring large volumes of attack requests while largely preserving utility.

1 INTRODUCTION

Guided by empirical scaling laws, increasing model parameters has become a central approach to improving large language model (LLM) performance (Kaplan et al., 2020). However, larger models impose greater computational and memory demands during inference (Pope et al., 2023). When these models serve large volumes of requests, these resource demands translate into substantial and recurring inference costs for service providers (Kwon et al., 2023).

These recurring inference costs make resource-consumption attacks a threat to LLM service providers. Specifically, attackers can induce models to generate abnormally long outputs, thereby increasing compute consumption and inference time. Prior resource-consumption attacks can be broadly categorized into inference-time and training-time attacks according to where the adversarial manipulation is introduced. Inference-time attacks construct malicious queries in either white-box or black-box settings to induce the model to generate abnormally long responses (Shumailov et al., 2021; Feng et al., 2024; Dong et al., 2025; Zhang et al., 2025b; Kumar et al., 2025; Li et al., 2026b; Zhang et al., 2026), whereas training-time attacks implant malicious behaviors, such as repetitive generation or excessive reasoning, into the model to persistently inflate inference costs (Gao et al., 2024; Zhang et al., 2025a; Liu et al., 2026; Yi et al., 2026). Despite their different entry points, these approaches primarily amplify computational cost by increasing the amount of generated response or

Figure

Figure 1: A demonstration of FragToken.

reasoning content. These attacks can leave detectable input or output anomalies, such as unnatural prompts and unusually long or repetitive responses (Dong et al., 2025). Moreover, because they are request-conditioned, their impact is diluted by benign traffic in large-scale deployments, where malicious or trigger-bearing requests are unlikely to constitute a substantial fraction of total traffic. These limitations motivate investigating whether substantial generation overhead can persist across ordinary user traffic without requiring detectable content expansion or runtime activation. In this paper, we uncover a previously unexplored resource-consumption risk arising from the asymmetry between canonical tokenization and non-unique detokenization. Specifically, while a tokenizer maps a given text to a canonical token sequence, its deterministic decoder is non-injective, allowing the same textual content to be generated from multiple alternative token sequences (Figure 1). In practice, however, such trajectories are rarely observed, because LLMs are predominantly trained on canonically tokenized sequences and consequently develop a strong preference for canonical generation. This observation suggests a new attack surface in outsourced or third-party LLM deployment, where an upstream model supplier could modify a model before delivery to favor fragmented generation trajectories. Once deployed, the modified model could sustain resource amplification across ordinary user traffic without runtime triggers or dilution by a low malicious-request share, while avoiding proportional visible content growth.

To realize this attack, we first explore a straightforward approach that fully atomizes response labels by decomposing the target response tokens into the smallest units permitted by the tokenizer, while preserving the decoded text. However, we find that such aggressive atomization substantially degrades model utility. This result exposes the central challenge: increasing token fragmentation while maintaining compatibility with the model's learned output distribution and pretrained token structures. To address this challenge, we propose FragToken, a framework that steers LLMs toward highly fragmented generation trajectories while largely preserving model utility. Specifically, FragToken uses three label-construction designs. First, it uses responses generated by the source model as supervision, allowing fine-tuning to focus on learning fragmented representations of content already familiar to the model. Second, it adapts the fragmentation budget to each response's capacity and bounds the target ratio to balance attack effectiveness and training stability. Third, it applies BPE-Aligned Merging within canonical-token-aligned spans to support the transfer of existing knowledge to fragmented generation. Together, these designs enable FragToken to increase decoding costs under ordinary prompts while largely preserving response quality.

We evaluate FragToken on four LLMs across three benchmarks. Across the four LLMs, FragToken achieves three-benchmark average TIRs of 1.99–2.46 while largely preserving task utility. Under the evaluated defenses, its detection rate remains comparable to benign behavior and substantially lower than those of the existing resource consumption attacks. Its overhead also persists when benign requests dominate the traffic, whereas request-conditioned attacks become substantially less effective as the attack share decreases.

Our main contributions are summarized as follows:

• We identify a token-level resource-consumption attack that induces fragmented noncanonical generation under ordinary prompts, increasing overhead without proportional visible-text growth while largely retaining task utility.

• We design FragToken, which combines source-model self-distillation, capacity-aware filtering and budgeting, and BPE-Aligned Merging to balance token inflation with model utility.

• We comprehensively evaluate FragToken on four LLMs across three benchmarks, showing that it achieves an average TIR of 1.99–2.46 while causing only minor degradation in model utility.

References (85)