Abstract
Large-scale pre-trained vision models offer state-of-the-art performance but suffer from high inference costs. While Parameter-Efficient Transfer Learning (PETL) reduces training overhead, it typically leaves inference latency untouched. We present Dyn-Adapter, a framework that introduces a dynamic early-exiting strategy to PETL. By freezing the backbone and employing lightweight, multi-level adapters with balanced classification heads and bidirectional sparsity, Dyn-Adapter reduces inference computation (FLOPs) by up to 50% while maintaining or improving accuracy across diverse visual recognition tasks.
Introduction
The deployment of large-scale Vision Transformers (ViTs) is often hindered by their massive computational requirements. Parameter-Efficient Transfer Learning (PETL) methods, such as LoRA and Adapters, have successfully reduced the number of trainable parameters during fine-tuning. However, these methods still require a full forward pass through all layers during inference, regardless of the complexity of the input image.
Existing "early-exit" strategies, which attempt to terminate computation for "easy" samples, often face the challenge of entangled representations. In standard joint training, early layers are forced to learn high-level semantics to satisfy early classification heads, potentially degrading the pre-trained low-level features. Dyn-Adapter addresses this by decoupling the task-specific semantic learning from the frozen backbone's feature hierarchy.
The Dyn-Adapter Framework
Dyn-Adapter integrates dynamic inference with PETL through three core innovations:
- Multi-Stage Architecture with Balanced Heads: The model is partitioned into stages. To compensate for the lack of high-level features in early layers, "heavier" classification heads (multi-layer MLPs) are used initially, while later stages use lightweight heads. The backbone remains frozen to preserve the original feature hierarchy.
- Adaptive Prioritization: Training follows a curriculum where deep layers are prioritized first to establish a performance upper bound. Gradually, the loss weight shifts toward early-exit heads as training progresses.
- Bidirectional Sparsity:
- Forward Sparsity: Higher dropout rates are applied to shallow layers to mitigate task interference between different exit points.
- Backward Sparsity: A masked gradient update strategy randomly selects parameters for updates, acting as a regularizer to improve generalization and prevent overfitting on small downstream datasets.
Experimental Results
The authors evaluated Dyn-Adapter on a massive range of benchmarks including VTAB-1k (19 datasets), few-shot learning, domain generalization (ImageNet variants), and video classification (SSv2).
Efficiency and Throughput
Dyn-Adapter achieves a significant Pareto improvement over standard PETL baselines. It can reduce inference FLOPs by 50% without accuracy loss. In scenarios targeting a 30% FLOP reduction, it actually improves accuracy by 0.3% to 0.5% compared to standard PETL. On hardware (NVIDIA 3090), Dyn-RepAdapter achieved a 2.2x speedup in throughput compared to the standard RepAdapter.
Versatility and State-of-the-Art Performance
The framework is "plug-and-play," showing consistent gains when applied to LoRA, Adapter, and RepAdapter. Dyn-RepAdapter currently sets a new state-of-the-art on the VTAB-1k benchmark while maintaining superior inference efficiency compared to its competitors.
Conclusion
Dyn-Adapter demonstrates that decoupling task-specific semantics from a frozen backbone is a powerful strategy for efficient visual recognition. By leveraging early exits and sparsity, it bridges the gap between parameter efficiency and inference efficiency. Future work will explore the mathematical optimization of multi-stage learning and the application of dynamic adapters to multi-modal architectures.
Summary updated