Multi-Exit Neural Networks (MENNs) have emerged as a powerful solution for efficient deep learning, particularly on resource-constrained devices. By incorporating "early exits" throughout the architecture, these models can terminate processing as soon as a sufficient confidence threshold is met. However, this efficiency comes with a significant security trade-off. Research presented at NeurIPS 2023 introduces NEO-KD, a training strategy designed to mitigate the inherent adversarial vulnerabilities of multi-exit architectures.
The Challenge: Adversarial Transferability
The primary security flaw in MENNs is adversarial transferability. Because early and late exits share the same underlying layers and parameters, an adversarial perturbation designed to fool the first exit is highly likely to fool subsequent exits as well.
Standard defense mechanisms often exacerbate this issue. Traditional adversarial training frequently employs "self-distillation," where internal exits are forced to mimic the predictions of the final, most accurate exit. While this improves clean accuracy, the authors demonstrate that it inadvertently synchronizes the error patterns across the network. This high correlation makes the entire model vulnerable to a single, simple attack that can "blind" every exit simultaneously.
The NEO-KD Approach
To break this dependency, the authors propose Neighbor Exit-wise Orthogonal Knowledge Distillation (NEO-KD). This framework replaces standard self-distillation with two specialized terms designed to enhance robustness and diversify exit behavior:
1. Neighbor Knowledge Distillation (NKD)
Rather than every exit learning exclusively from the final exit, NKD encourages each exit to learn from an ensemble of its immediate neighbors (the exits directly preceding and following it). By distilling the averaged predictions of clean "neighbor" exits into the adversarial prediction of the current exit, the model receives a more stable and high-quality teacher signal. This helps the internal layers distinguish between the true signal and adversarial noise more effectively than a single-teacher approach.
2. Exit-wise Orthogonal Knowledge Distillation (EOKD)
EOKD is the core innovation for reducing transferability. It forces the non-ground-truth predictions (the "wrong" answers) of different exits to be mutually orthogonal. If Exit 1 is manipulated into making an incorrect prediction (e.g., misclassifying a cat as a "dog"), EOKD pushes Exit 2 to consider a different incorrect class (e.g., "truck") if it is also going to be wrong. By diversifying these failure modes, the researchers create a "defense in depth," making it significantly harder for an attacker to find a single perturbation that successfully fools every stage of the pipeline.
Experimental Results
The researchers evaluated NEO-KD across five standard benchmarks—MNIST, CIFAR-10, CIFAR-100, Tiny-ImageNet, and ImageNet—against rigorous attacks including PGD, Carlini-Wagner (CW), and AutoAttack.
Superior Robustness and Accuracy
On the CIFAR-100 dataset, NEO-KD achieved an average adversarial accuracy of 22.88%, a substantial improvement over the standard adversarial training baseline of 18.13%. This indicates that the orthogonal constraints successfully prevent attacks from propagating through the network.
Computational Efficiency
In the context of MENNs, robustness is inextricably linked to efficiency. A robust model can exit early even when under attack, whereas a vulnerable model might be forced to process until the final exit or fail entirely. To reach a specific target adversarial accuracy on CIFAR-10, NEO-KD required 48.24% less computation (measured in MFlops) compared to standard adversarial training without distillation.
Visualizing Transferability
The authors utilized "transferability maps" to confirm that attacks targeting one exit were significantly less likely to succeed at other exits compared to baseline methods. This empirical evidence supports the theory that EOKD effectively de-correlates the exits.
Limitations and Future Directions
While NEO-KD represents a significant step forward for secure and efficient AI, it introduces some practical challenges:
- Hyperparameter Sensitivity: The method relies on several weighting parameters (α, β, γ) to balance the various distillation losses, requiring careful tuning for different architectures.
- Training Complexity: Generating adversarial examples for multiple exits and calculating orthogonal losses increases the computational cost of the training phase, though the inference phase remains highly efficient.
- Architectural Scaling: Future work is needed to determine how these orthogonal constraints scale to massive transformer-based multi-exit models commonly used in Natural Language Processing.
Conclusion
NEO-KD demonstrates that for multi-exit networks, correlation is the enemy of robustness. By rethinking knowledge distillation through the lenses of neighbor ensembles and exit-wise orthogonality, the authors provide a framework that maintains the efficiency of MENNs while significantly hardening them against adversarial exploitation.
Summary updated