PD 3 F: A Pluggable and Dynamic DoS-Defense Framework Against Resource Consumption Attacks Targeting Large Language Models

Yuanhe Zhang, Xinyue Wang, Haoran Gao, Zhenhong Zhou, Fanyu Meng, Yuyao Zhang, Sen Su · 2025

Read PD 3 F: A Pluggable and Dynamic DoS-Defense Framework Against Resource Consumption Attacks Targeting Large Language Models by Yuanhe Zhang, Xinyue Wang, Haoran Gao, Zhenhong Zhou, Fanyu Meng, Yuyao Zhang, Sen Su (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2505-18680.txt.

Introduction

Yuanhe Zhang and co-authors built a defense in 2025 for language model services against attacks that waste computer power. Such attacks can slow a server or crash it by forcing very long replies. Past work had few fixes for this threat, the authors say.

Their pluggable frame acts on both input and output. On input, an index of resource use guides how requests are polled and scheduled under heavy load. On output, a rule ends runaway replies from attackers early. Tests across six models showed user access rising as much as fivefold under attack load. The work is framed as a step toward sturdier, resource-aware service.

Catalog record

CREATORYuanhe Zhang, Xinyue Wang, Haoran Gao, Zhenhong Zhou, Fanyu Meng, Yuyao Zhang, Sen Su
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE72 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2505-18680

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

PD 3 F: A Pluggable and Dynamic DoS-Defense Framework Against Resource Consumption Attacks Targeting Large Language Models Yuanhe Zhang, Xinyue Wang, Haoran Gao, Zhenhong Zhou, Fanyu Meng, Yuyao Zhang, Sen Su Abstract Large Language Models (LLMs), due to substantial computational requirements, are vulnerable to resource consumption attacks, which can severely degrade server performance or even cause crashes, as demonstrated by denial-of-service (DoS) attacks designed for LLMs. However, existing works lack mitigation strategies against such threats, resulting in unresolved security risks for real-world LLM deployments. To this end, we propose the Pluggable and Dynamic DoS-Defense Framework ( PD 3 F ), which employs a two-stage approach to defend against resource consumption attacks from both the input and output sides. On the input side, we propose the Resource Index to guide Dynamic Request Polling Scheduling, thereby reducing resource usage induced by malicious attacks under high-concurrency scenarios. On the output side, we introduce the Adaptive End-Based Suppression mechanism, which terminates excessive malicious generation early. Experiments across six models demonstrate that PD 3 F significantly mitigates resource consumption attacks, improving users’ access capacity by up to 500 % 500\% during adversarial load. PD 3 F represents a step toward the resilient and resource-aware deployment of LLMs against resource consumption attacks. † † footnotemark: † † footnotetext: \star indicates equal contribution. \dagger indicates corresponding author. 1 Introduction Figure 1: This Figure illustrates the defense effect of PD 3 F against resource consumption attacks. Figure 2: The PD 3 F mitigation pipeline for resource consumption attacks consists of three stages: (1) request clustering based on a computed Resource Index; (2) dynamic scheduling and reordering of request queues; and (3) elastic output-length suppression to limit resource usage induced by adversarial prompts. Deployment of large language models (LLMs) remains heavily constrained by computational resource demands Chen et al. (2022) ; Zhao et al. (2023) ; Achiam et al. (2023) ; Chang et al. (2024) , with limited resource availability posing a critical bottleneck to broader adoption Gao et al. (2024a) . This challenge is further amplified by resource consumption attacks, which induce high-overhead inference processes to exhaust computational resources Shumailov et al. (2021) ; Shumailov et al. (2024) . The feasibility and impact of such attacks have been empirically demonstrated through denial-of-service (DoS) attacks specifically targeting LLMs Geiping et al. (2024) ; Dong et al. (2024) . Recent findings reveal that resource consumption attacks increase model response latency across multiple dimensions Gao et al. (2024a) ; Kumar et al. (2025) , rapidly depleting GPU resources Zhang et al. (2024e) . Under computing resource shortages, these attacks result in resource exhaustion and service disruption, thereby compromising the reliability of LLMs deployment. Despite its severity, resource consumption attacks remain largely unaddressed, making it difficult to mitigate. Prior defense techniques, including model checking and input disturbance Jain et al. (2023) ; Liu et al. (2024) , are bypassed by emerging attack strategies, leading to severe malicious resource consumption Zhang et al. (2024e) ; Kumar et al. (2025) . Furthermore, research on controlling consumption during generation rarely considers the impact of resource consumption attacks Wang et al. (2024) ; Wang et al. (2023) . Consequently, LLM applications struggle to suppress resource consumption threats, especially DoS attacks for LLMs. In this paper, we propose the Pluggable Dynamic DoS-Defense Framework (PD 3 F). To the best of our knowledge, PD 3 F is the pioneer framework to provide end-to-end protection against resource consumption attacks. At its core, PD 3 F introduces the Resource Index that quantifies the attack risks of incoming requests by leveraging high-dimensional GPU resource features, enabling user-level queue scheduling. Subsequently, we employ the Resource Index to guide Dynamic Request Polling Scheduling at the input stage, which deprioritizes adversarial requests, thereby mitigating excessive resource usage. On the output side, PD 3 F applies the Adaptive End-Based Suppression mechanism to shorten attack requests while reducing the resource consumption of individual requests. As a result, PD 3 F mitigates existing resource consumption attacks effectively while preserving the performance of benign queries. We simulate real-world deployment scenarios and conduct comprehensive experiments on six widely-used open-source LLMs, including Llama-3.1 Patterson et al. (2022) , Qwen2.5 Yang et al. (2024) , Mistral-v0.2 Jiang et al. (2023) . Experimental results demonstrate that PD 3 F effectively mitigates the impact of denial-of-service attacks for LLMs. Under attack scenarios, PD 3 F reduces the impact of DoS attacks by at least 50% \downarrow , while improving user request efficiency by 500% \uparrow . Notably, we ensure minimal disruption to benign user requests under varying workloads. In summary, our primary contribution lies in PD 3 F, which is the first universal defense against resource consumption attacks. We define the Resource Index to enable more precise cluster identification in high-dimensional space for quantifying resource overhead risk. Building on this, we further present the Dynamic Request Polling Strategy and apply Adaptive End-Based Suppression to weaken adversarial resource usage by elastically output-length suppression. We evaluate PD 3 F across six models, three attack types, and eight defense baselines, demonstrating its effectiveness. PD 3 F offers a novel perspective on LLM security defenses and improves the deployment robustness. 2 Related work Jailbreak attacks. Jailbreak attacks aim to bypass LLMs’ alignment safeguards to induce harmful outputs Wei et al. (2023) . Existing studies have identified several major categories of such attacks. Template-based and multi-turn attacks exploit structured or step-by-step prompting schemes to manipulate model behavior Gehman et al. (2020) ; Li et al. (2023) ; Zhou et al. (2024c) ; Zhu et al. (2025) . Automated adversarial prompt generation methods craft inputs that elicit harmful responses without manual intervention Chao et al. (2023) ; Liu et al. (2023a) ; Zou et al. (2023) . Training-time data poisoning introduces malicious patterns during model fine-tuning to compromise alignment Lermen et al. (2023) ; Xu et al. (2023) . Semantic-level red teaming techniques probe models with subtle prompts to reveal hidden vulnerabilities Perez et al. (2022) ; Casper et al. (2023) . Resource consumption attacks. Resource consumption attacks maliciously consume computational resources or bring down services Shumailov et al. (2021) . Among them, denial-of-service (DoS) attacks have been demonstrated as an effective and well-documented threat Zhang et al. (2024e) . For instance, large-scale adversarial suffix generation Liao and Sun (2024) can overwhelm models through massive input manipulation. Engorgio Prompts suppress end-of-sequence tokens, resulting in excessive outputs Dong et al. (2024) . Attacks like P-DoS and neural efficiency backdoors Gao et al. (2024b) ; Chen et al. (2023) embed persistent inefficiencies via poisoned fine-tuning. Mitigation. Safety alignment is a critical area for mitigating risks posed by attacks and enhancing model safety by aligning outputs with human values Ouyang et al. (2022) ; Bai et al. (2022) ; Dai et al. (2023) ; Liu et al. (2023b) . To enhance the model’s safety capabilities, existing research also improves the safety performance through external methods. For jailbreak attacks, input and output filtering can identify abnormal contents to reduce the harmful impact Alon and Kamfonas (2023) ; Phute et al. (2023) and input rewriting Kumar et al. (2025) ; Jain et al. (2023) ; Liu et al. (2024) mitigates the risk by paraphrasing or perturbing prompts. Other approaches help correct biases and malicious

Read the complete text