[Paper Review] Switchable Precision Neural Networks
This paper proposes Switchable Precision Neural Networks (SP-Nets), a unified architecture that enables on-the-fly adjustment of model precision for dynamic accuracy-efficiency trade-offs during inference. By combining switchable batch normalization and a self-distillation training scheme, SP-Nets achieve superior accuracy across multiple quantization levels—outperforming independently trained quantized models—while maintaining compatibility with resource-constrained devices.
Instantaneous and on demand accuracy-efficiency trade-off has been recently explored in the context of neural networks slimming. In this paper, we propose a flexible quantization strategy, termed Switchable Precision neural Networks (SP-Nets), to train a shared network capable of operating at multiple quantization levels. At runtime, the network can adjust its precision on the fly according to instant memory, latency, power consumption and accuracy demands. For example, by constraining the network weights to 1-bit with switchable precision activations, our shared network spans from BinaryConnect to Binarized Neural Network, allowing to perform dot-products using only summations or bit operations. In addition, a self-distillation scheme is proposed to increase the performance of the quantized switches. We tested our approach with three different quantizers and demonstrate the performance of SP-Nets against independently trained quantized models in classification accuracy for Tiny ImageNet and ImageNet datasets using ResNet-18 and MobileNet architectures.
Motivation & Objective
- Address the challenge of static quantization in neural networks, where models are fixed at a single precision level and cannot adapt to runtime resource constraints.
- Enable on-demand, runtime precision switching for both weights and activations to support dynamic inference under varying memory, latency, and power constraints.
- Overcome training instability in multi-precision networks by resolving batch normalization discrepancies across different precision switches.
- Improve the performance of low-precision switches through a self-distillation strategy that guides them using knowledge from a full-precision teacher network.
- Demonstrate the effectiveness of SP-Nets across diverse quantizers and model architectures, including ResNet-18 and MobileNet, on ImageNet and Tiny ImageNet benchmarks.
Proposed method
- Introduce switchable batch normalization (S-BN), where each precision switch maintains independent batch normalization statistics to prevent feature distribution mismatch during training.
- Propose a self-distillation training scheme in which the full-precision switch acts as a teacher, providing soft labels to guide low-precision student switches during optimization.
- Train a single shared network with multiple precision switches by combining gradients from all switches before optimizer updates, enabling joint optimization.
- Support multiple quantization functions (e.g., ReLU-based, logarithmic, uniform) and extend the framework with width-slimming capability for additional model compression.
- Use a combined loss function with cross-entropy loss ($\mathcal{L}_{\text{out}}$) and knowledge distillation loss ($\mathcal{L}_{f}$), scaled by hyperparameters $\alpha_1=1$, $\alpha_2=10^{-7}$ to balance the objectives.
- Enable runtime inference by dynamically selecting the desired bitwidth for weights and activations, allowing instant adaptation to device constraints.
Experimental results
Research questions
- RQ1Can a single neural network be trained to support multiple precision levels for both weights and activations with minimal performance degradation?
- RQ2How can batch normalization inconsistencies across different precision switches be resolved during joint training?
- RQ3Does knowledge distillation from a full-precision teacher improve the accuracy of low-precision switches in a shared network?
- RQ4How does the number of precision switches affect training stability and final model performance?
- RQ5Can SP-Nets outperform independently trained quantized models across diverse quantization schemes and model architectures?
Key findings
- SP-Nets with self-distillation achieve higher top-1 accuracy than independently trained quantized models, with a 54.5% top-1 accuracy on Tiny ImageNet using ResNet-18 and 32-bit weights and 3-bit activations.
- The self-distillation scheme improves low-precision switch performance, increasing accuracy by up to 3.9 percentage points compared to non-distilled training on the Logarithmic 2 quantizer.
- Switchable Batch Normalization (S-BN) is essential for convergence: networks without S-BN show stagnated accuracy across all switches, while S-BN enables stable, progressive learning.
- The number of switches impacts training dynamics—increasing from 4 to 16 switches requires a reduced initial learning rate (0.03) and leads to slightly lower accuracy, suggesting trade-offs in optimization complexity.
- SP-Nets demonstrate that both weights and activations are sensitive to quantization, but the relative impact varies by model: for ResNet-18, weights are nearly as sensitive as activations, while for MobileNet, activations are more sensitive.
- The SP-Net with 2-bit weights and 32-bit activations achieves 53.3% top-1 accuracy on Tiny ImageNet, while the 32-bit weights and 2-bit activations switch reaches 53.9%, showing that precision choice significantly affects performance.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.