Abstract
Training neural networks on resource-constrained mobile and IoT devices is critical for privacy and personalization but faces significant latency and energy hurdles. Existing "rigid" training strategies, such as fixed transfer learning or one-way pruning, often fail to capture the evolving importance of model parameters during training. We present ElasticTrainer, a framework that enables fully elastic tensor selection at runtime. By dynamically toggling trainable tensors based on a gradient-based importance metric and a wall-clock timing profiler, ElasticTrainer achieves up to 3.5× speedup and 2×-3× energy reduction while maintaining or improving accuracy on fine-grained classification tasks.
Introduction
On-device training is essential for adapting AI models to local data without compromising user privacy. However, the computational cost is often prohibitive; for instance, training a ResNet50 model on a Raspberry Pi can take over a month. Current approaches to mitigate this cost are typically rigid. Traditional transfer learning fixes the set of trainable layers (usually the last few), while pruning permanently removes components. These methods ignore the "rigidity gap": the fact that the importance of different model parts changes as training progresses.
The ElasticTrainer Framework
ElasticTrainer introduces Runtime Elastic Tensor Selection, treating every tensor in the network as a component that can be toggled on or off at any time. The framework consists of three core modules:
- Tensor Importance Evaluator: Utilizing a gradient-based metric inspired by eXplainable AI (XAI), this module calculates the contribution of each tensor to loss reduction. It employs a first-order Taylor expansion to ensure the calculation is computationally feasible for mobile hardware.
- Tensor Timing Profiler: Moving beyond misleading "FLOPs" metrics, this profiler builds a wall-clock time model. It accounts for how hardware accelerators (e.g., TensorCores) handle different operations, providing a realistic prediction of training latency for any given tensor selection.
- Tensor Selector: This module solves a constrained optimization problem: maximizing accuracy improvement within a strict per-iteration time budget. A lightweight Dynamic Programming (DP) algorithm finds the optimal set of tensors in milliseconds.
Experimental Results
The authors evaluated ElasticTrainer on challenging fine-grained classification datasets, including CUB-200 (birds), Oxford-IIIT Pet, and Stanford Dogs, using models pre-trained on ImageNet.
Speed and Efficiency
ElasticTrainer achieved up to 3.5× faster training in wall-clock time and reduced energy consumption by 2×-3× compared to full training. The selection overhead itself remained negligible, accounting for less than 1% of total computation.
Accuracy and Elasticity
On the CUB-200 dataset, ElasticTrainer outperformed traditional transfer learning and pruning by at least 10% in accuracy. A key insight is that the optimal set of trainable parameters is a moving target; by allowing the model to "re-grow" previously ignored sections, ElasticTrainer maintains high accuracy where static methods fail.
Discussion and Limitations
While ElasticTrainer offers significant improvements, implementation hurdles remain. The authors noted minor memory leakage in TensorFlow when re-generating computing graphs on ARM platforms. Furthermore, while the system currently uses training loss to evaluate importance, future iterations might benefit from using validation loss to better prevent overfitting, provided the computational cost can be managed. Finally, broader adoption will require better support for dynamic graphs in mobile-specific frameworks like TensorFlow Lite.
Summary updated