Adversarial Efficiency Attacks on Dynamic Neural Networks

31 concepts16 papers1 proposal

To deploy deep learning models on resource-constrained edge devices like smartphones, IoT sensors, and autonomous systems, researchers developed Dynamic Neural Networks (DyNNs). As detailed in a comprehensive survey by Gao Huang et al. (Dynamic Neural Networks: A Survey), traditional deep learning models are "static," executing the exact same computational graph and consuming the same amount of energy for every input. In contrast, dynamic networks adapt their architecture or execution path on the fly.

For instance, an "early-exit" network might process a clear, unambiguous image of a cat and terminate computation at layer 2, saving time and battery power. A blurry or complex image would instead proceed through all 50 layers.

However, this adaptive behavior introduces a critical security vulnerability. Instead of manipulating an input to change the model's final prediction (a traditional accuracy-targeted attack), an adversary can manipulate an input to maximize the model's computational cost. These are known as efficiency attacks or energy-depletion attacks, and they represent a form of algorithmic denial-of-service (DoS).


Why Efficiency Attacks Work: Exploiting Halting Signals

To understand why these attacks are so effective, we must look at how dynamic networks decide when to stop computing.

Dynamic networks rely on internal architectural signals—such as the entropy of a layer's output distribution, halting scores, or gating activation values—to determine whether an input requires further processing. If a model is highly confident at an early layer (low entropy), it exits early.

The core insight behind efficiency attacks is that these internal routing and halting mechanisms are differentiable and predictable. Because the routing decisions depend on mathematical functions of the network's internal states, an attacker can use gradient descent to optimize an input perturbation that specifically targets these mechanisms.

As shown by Cong Liu et al. in their work on Intermediate Output-Based Loss Function Optimization (ILFO: Adversarial Attack on Adaptive Neural Networks), an attacker does not need to measure physical hardware power consumption to drain a device's battery. Instead, they can treat internal halting scores as a proxy for energy. By optimizing a subtle, human-imperceptible perturbation to minimize early-exit confidence, the attacker forces the network to execute its most resource-intensive paths.

[Input Image] ---> [Layer 1] ---> [Early Exit Decision?] 
                         |                 |
                         | (Perturbation   | (Attacker maximizes entropy/
                         v  forces failure)v  lowers confidence score)
                   [Layer 2] ---> [Early Exit Decision?]
                         |                 |
                         v                 v
                   [Full Execution Path Triggered (Maximum Energy Cost)]

When an attacker backpropagates through these routing mechanisms, they can recover almost 100% of the computational complexity that the dynamic network was designed to skip. Frameworks like GradAuto (GradAuto: Energy-Oriented Attack on Dynamic Neural Networks by Jianhong Pan et al.) and GradMDM: Adversarial Attack on Dynamic Networks demonstrate that gradient-based optimization can systematically force adaptive models to activate all available computational units, completely neutralizing their efficiency benefits while preserving high image quality.


The Stealth Factor: Accuracy-Agnostic Exploitation

Traditional adversarial research focuses on compromising model integrity (e.g., making a model misclassify a panda as a gibbon). In contrast, specialized slowdown attacks are often accuracy-agnostic.

As Sanghyun Hong et al. demonstrated with DeepSloth (A Panda? No, It's a Sloth: Slowdown Attacks on Adaptive Multi-Exit Neural Network Inference), conventional accuracy attacks often inadvertently increase efficiency because high-confidence incorrect predictions can trigger early exits. DeepSloth, however, specifically targets the confidence mechanisms to prevent early termination while keeping the final classification correct.

This makes efficiency attacks incredibly stealthy. As noted by Navaneet K L et al. in SlowFormer: Adversarial Attack on Compute and Energy Consumption of Efficient Vision Transformers, because the model continues to output the correct answers, standard accuracy-based monitoring systems register zero anomalies. Meanwhile, the underlying hardware suffers from rapid battery depletion, severe latency delays, or thermal throttling (Energy-Latency Attacks to On-Device Neural Networks via Sponge Poisoning by Shuo Huang 0004 et al.).


Beyond Vision: Attacks Across Modalities and Architectures

The vulnerability to efficiency manipulation is not unique to computer vision early-exit networks; it spans across diverse architectures and modalities:

  • Vision Transformers (ViTs): Modern ViTs use token sparsification to drop unimportant patches of an image and save power. The DeSparsify attack (DeSparsify: Adversarial Attack Against Token Sparsification Mechanisms by Amit Baras et al.) fools these token-dropping modules into treating every single token as essential, causing a massive spike in computational overhead.
  • Natural Language Processing (NLP): Input-adaptive language models like multi-exit BERTs are equally vulnerable. Shengyao Zhang et al. developed SlowBERT (SlowBERT: Slow-down Attacks on Input-adaptive Multi-exit BERT), which perturbs text sequences to bypass early-exit shortcuts, inducing severe service delays in real-world NLP deployments.
  • Large Language Models (LLMs): Efficiency attacks have also scaled up to generative reasoning models. In BadThink: Triggered Overthinking Attacks on Chain-of-Thought Reasoning in Large Language Models, the authors introduced a training-time backdoor that forces LLMs to generate massive, redundant chain-of-thought reasoning traces. The final answer remains correct, but token generation and operational costs inflate by over 17x.

Alternative Threat Vectors: Black-Box and Backdoors

Attackers do not always require white-box access to a model's gradients to execute an energy-depletion attack.

In EREBA: Black-box Energy Testing of Adaptive Neural Networks, Cong Liu et al. proved that a black-box testing framework can train an external estimator model to predict a target network's energy consumption. By optimizing inputs against this surrogate estimator, they successfully triggered energy surges of up to 2,000% on target adaptive networks without direct architectural access.

Furthermore, these vulnerabilities can be baked directly into models during training via backdoors. The EfficFrog attack, presented by Cong Liu et al. in The Dark Side of Dynamic Routing Neural Networks: Towards Efficiency Backdoor Injection, demonstrates how a malicious trigger embedded in a clean-looking input can cause a dynamic routing network to completely abandon its power-saving features, creating a latent, triggerable denial-of-service condition.


The Open Challenge of Efficiency Robustness

As systematized by Ravishka Shemal Rathnasuriya et al. in SoK: Efficiency Robustness of Dynamic Deep Learning Systems, the AI security landscape is facing a critical defense gap. While decades of research have established robust defenses for model accuracy (such as adversarial training), protecting model efficiency remains an unresolved challenge.

The fundamental problem is a security tax: many intuitive defenses against energy depletion work by regularizing or restricting adaptive behaviors, which inadvertently increases the model's baseline computational overhead and strips away the exact efficiency benefits the architecture was built to provide. Developing architectures that are inherently robust to efficiency manipulation without sacrificing their green, edge-friendly advantages remains a vital frontier in deep learning security.

Key Foundational Work

ILFO: Adversarial Attack on Adaptive Neural Networks (2020) — contributed 5 concept elements to this direction.
A Panda? No, It's a Sloth: Slowdown Attacks on Adaptive Multi-Exit Neural Network Inference (2021) — contributed 2 concept elements to this direction.
Dynamic Neural Networks: A Survey (2021) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_energy_depletion_attack_986f4c22,
  title = {energy-depletion attack},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/energy-depletion-attack/rdr_986f4c2233344232bc7454b941e78688},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-20},
}

This exact version (version 1, frozen text):

@misc{lacuna_energy_depletion_attack_986f4c22_v1,
  title = {energy-depletion attack},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/energy-depletion-attack/rdr_986f4c2233344232bc7454b941e78688/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-20},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake