The Adversarial Implications of Variable-Time Inference

Dudi Biton, Aditi Misra, Efrat Levy, Jaidip Kotak, Ron Bitton, Roei Schuster, Nicolas Papernot, Yuval Elovici, Ben Nassi

Introduction

In adversarial machine learning, the security of a model is often evaluated based on the level of access granted to an attacker. "White-box" attackers possess full knowledge of model weights and gradients, while "black-box" attackers are limited to observing model outputs. A common assumption in the field is that "label-only" access—where an attacker only sees the final classification or detection label—provides a robust defense against sophisticated attacks.

However, this research demonstrates that label-only access is a misnomer. Every inference request carries a hidden side-channel: execution time. While the primary neural network computation is often constant-time, the post-processing algorithms required to interpret those results are frequently variable. By measuring these timing variations, an attacker can reconstruct internal model confidence and mount effective evasion and dataset inference attacks.

The NMS Side-Channel

The researchers focused their investigation on Non-Maximum Suppression (NMS), a critical post-processing step in object detection systems like YOLOv3. NMS is used to filter out redundant, overlapping bounding boxes generated by the neural network.

The core vulnerability lies in the fact that NMS runtime is not constant; it is roughly proportional to the number of candidate boxes the network produces. Because the number of candidate boxes correlates strongly with the model's internal confidence scores, the total execution time serves as a high-fidelity proxy for the model's hidden certainty. This turns a seemingly opaque black box into a transparent one where timing leaks the "secrets" of the internal math.

Attack Methodologies

The study introduces two primary methods for exploiting this timing leakage:

1. Timing-Leakage-Based Evasion

To bypass a detector without access to gradients, the authors employed an evolutionary genetic algorithm. In this setup, the execution time of the NMS algorithm serves as the "fitness function." The algorithm iteratively perturbs an image, favoring changes that result in shorter NMS runtimes. Shorter runtimes indicate fewer candidate boxes, suggesting that the object is successfully being obscured from the detector's internal logic. This allows for the creation of adversarial examples using only a stopwatch.

2. Dataset Inference

The researchers also demonstrated a privacy-invasive attack: determining if a specific image was used to train the target model. By profiling the distribution of NMS runtimes for known training members versus non-members, they could identify training set membership with high statistical confidence. As the size of the target image set increases, the false-positive rate of this inference drops exponentially.

Leakage Amplification via Tiling

A significant challenge for timing attacks is the "noise" introduced by network latency, system jitter, or VPNs. To overcome this, the authors developed a technique called tiling. By concatenating the same image multiple times into a larger grid (e.g., a 4x4 grid of the same input), they force the NMS algorithm to process the same features repeatedly. This amplifies the millisecond-scale timing signal into a second-scale signal, making the attack viable even over unstable internet connections.

Experimental Results

The attacks were evaluated using the COCO-MS benchmark and a custom dataset of YouTube Street Views (2,000 images from seven cities).

  • Stealthier Evasion: The timing-based evasion attack produced adversarial examples with significantly lower $L_2$ perturbation compared to standard decision-based attacks. This means the timing signal allows attackers to find more subtle, less visible ways to fool the model.
  • High-Accuracy Membership Inference: The researchers showed that NMS runtime is highly pathologically dependent on the input. This variability is "loud" enough to allow for near-perfect dataset inference as the sample size grows.
  • Viability of Side-Channels: The results prove that even if an API only returns a binary detection label (e.g., "Object Detected"), the metadata of the request provides sufficient signal to compromise the system.

Conclusion and Future Work

This research highlights a critical oversight in machine learning security: the vulnerability of non-neural post-processing code. While significant effort is spent hardening neural weights, the "boring" algorithms like NMS remain a potent security hole.

Future research is needed to explore similar timing leaks in Generative AI and Large Language Models (LLMs), where sampling and early-exit strategies may introduce similar variabilities. While developing constant-time NMS alternatives is a potential defense, the authors note that such solutions often default to "worst-case" execution times, which may be too slow for real-time applications. For now, the clock remains a powerful tool for the modern adversary.

Summary updated

BibTeX
@inproceedings{biton2023adversarial,
  author = {Dudi Biton and Aditi Misra and Efrat Levy and Jaidip Kotak and Ron Bitton and Roei Schuster and Nicolas Papernot and Yuval Elovici and Ben Nassi},
  title = {{The Adversarial Implications of Variable-Time Inference}},
  booktitle = {AISec@CCS},
  year = {2023},
  doi = {10.1145/3605764.3623912},
}
Figure