Abstract
The growing deployment of deep learning models in real-world environments has intensified the need for efficient inference under strict latency and resource constraints. To meet these demands, dynamic deep learning systems (DDLSs) have emerged, offering input-adaptive computation to optimize runtime efficiency. While these systems succeed in reducing cost, their dynamic nature introduces subtle and underexplored security risks. In particular, input-dependent execution pathways create opportunities for adversaries to degrade efficiency, resulting in excessive latency, energy usage, and potential denial-of-service in time-sensitive deployments. This work investigates the security implications of dynamic behaviors in DDLSs and reveals how current systems expose efficiency vulnerabilities exploitable by adversarial inputs. Through a survey of existing attack strategies, we identify gaps in the coverage of emerging model architectures and limitations in current defense mechanisms. Building on these insights, we propose to examine the feasibility of efficiency attacks on modern DDLSs and develop targeted defenses to preserve robustness under adversarial conditions.
Introduction
As deep learning scales to meet the demands of real-time applications, researchers have increasingly turned to Dynamic Deep Learning Systems (DDLSs). These systems optimize performance by adjusting their computational effort based on the complexity of the input. For example, "early-exit" networks stop processing once a confidence threshold is met, and Mixture-of-Experts (MoE) models activate only relevant sub-networks.
However, this input-adaptive flexibility introduces a significant security vulnerability: Efficiency Attacks. Unlike traditional adversarial attacks that aim to cause misclassification (e.g., tricking a vision system into misidentifying a stop sign), efficiency attacks seek to maximize resource consumption. By introducing imperceptible perturbations, an attacker can force a model to traverse its most computationally expensive paths, leading to increased latency, energy drain, and potential Denial-of-Service (DoS) in critical systems like autonomous vehicles.
The DDLS Framework and Attack Surfaces
The authors categorize the dynamic behaviors of these systems into four distinct types, each representing a potential attack surface:
- D1 (Computation per inference): Adjusting execution depth through mechanisms like layer skipping or early exits.
- D2 (Inference iterations): Modifying the number of steps in iterative or autoregressive models.
- D3 (Output production): Increasing the volume of generated outputs, such as the number of bounding boxes in object detection tasks.
- D4 (Dynamic Gating): A newly identified category focusing on modules that decide whether an input requires heavy computation or can be filtered early.
The efficiency attack is formalized as a constrained optimization problem. The adversary seeks a small perturbation ($\delta$) that maximizes the computational cost ($C$) of a network ($N$) on specific hardware ($H$), while ensuring the perturbation remains within a threshold ($\epsilon$) to stay imperceptible to human observers.
Experimental Evaluation: Attacking LLaMA 3B
To evaluate these vulnerabilities, the researchers utilized LLMEffiChecker, a tool designed to generate perturbations that inflate the generation cost of Large Language Models (LLMs). Experiments were conducted on a LLaMA 3B model performing machine translation tasks.
The results demonstrate that efficiency attacks can significantly degrade system performance without alerting users through poor output quality. For instance, word-level attacks were found to increase GPU latency by up to 154.71% and computational load (FLOPs) by up to 46.8%.
Importantly, these attacks are feasible even in black-box settings. Attackers can leverage side-channel signals, such as power consumption or response time, to iteratively refine their inputs. Furthermore, the "correctness" of the output remains largely unaffected (maintaining high BLEU scores), making these attacks difficult to detect using standard performance metrics. Preliminary defense tests using input validation based on internal model "stress" achieved a detection accuracy of 87%, suggesting a viable path for mitigation.
Key Insights and Future Directions
The study highlights several critical challenges in securing DDLSs:
- Defense Fragility: Traditional defense mechanisms, such as JPEG compression used in computer vision, are often unsuitable for text-based models as they significantly degrade output quality.
- The Gating Vulnerability: Gating mechanisms (D4) are particularly sensitive. Tricking a "gatekeeper" module can force the entire downstream pipeline into unnecessary, high-cost processing.
- The Efficiency-Robustness Trade-off: There is a fundamental tension between system efficiency and security. Implementing exhaustive input validation may introduce enough overhead to negate the benefits of using a dynamic system in the first place.
Future research must address emerging architectures like Mixture-of-Experts (MoE) and gated transformers. The authors propose a research agenda focused on "behavior-aware" input validation and real-time energy-based monitoring to detect and mitigate efficiency attacks before they cause systemic failure.
Summary updated