Skip to main content
QUICK REVIEW

[Paper Review] On Periodic Functions as Regularizers for Quantization of Neural Networks

Maxim Naumov, Utku Diril|arXiv (Cornell University)|Nov 24, 2018
Neural Networks and ApplicationsComputer Science31 references14 citations
TL;DR

This paper proposes a novel quantization method for neural networks that uses periodic functions—such as sine, cosine, and hat functions—as regularizers during training to encourage weights to converge to discrete integer values. By adjusting the amplitude and frequency of these functions over time, the method enables high-accuracy 8-bit quantized models on CIFAR-10 and ImageNet with minimal accuracy drop compared to full-precision models.

ABSTRACT

Deep learning models have been successfully used in computer vision and many other fields. We propose an unorthodox algorithm for performing quantization of the model parameters. In contrast with popular quantization schemes based on thresholds, we use a novel technique based on periodic functions, such as continuous trigonometric sine or cosine as well as non-continuous hat functions. We apply these functions component-wise and add the sum over the model parameters as a regularizer to the model loss during training. The frequency and amplitude hyper-parameters of these functions can be adjusted during training. The regularization pushes the weights into discrete points that can be encoded as integers. We show that using this technique the resulting quantized models exhibit the same accuracy as the original ones on CIFAR-10 and ImageNet datasets.

Motivation & Objective

  • To address the challenge of deploying deep neural networks on resource-constrained edge devices by reducing model size and inference cost through quantization.
  • To overcome limitations of traditional quantization methods that rely on fixed thresholds and may distort weight distributions or lose accuracy.
  • To explore whether periodic functions can serve as effective regularizers to guide network weights toward discrete, quantizable values during training.
  • To demonstrate that amplitude-scheduled periodic regularization enables high-accuracy 8-bit quantization without requiring specialized layer-wise or epoch-wise training strategies.

Proposed method

  • Introduces a regularizer based on component-wise application of periodic functions (e.g., sine, cosine, hat functions) to model weights during training.
  • The regularizer is added to the loss function as a sum over all weights: $ \sum_i \text{periodic}(w_i) $, with adjustable frequency and amplitude.
  • Amplitude is scheduled to increase gradually over training epochs (e.g., from $10^{-4}$ to $10^{-1}$), effectively scaling the regularization strength.
  • The periodic functions are designed so that their minima and maxima align with desired quantization levels, pushing weights toward discrete integer values.
  • After training, the model is quantized using symmetric uniform quantization: $ Q(w) = \gamma \cdot \text{round}(w / \gamma) $, where $ \gamma = c / (2^{t-1} - 1) $, with $ c $ being the maximum absolute weight.
  • The method does not require retraining or fine-tuning after quantization and works with standard quantization pipelines.

Experimental results

Research questions

  • RQ1Can periodic functions serve as effective regularizers to guide neural network weights toward discrete, quantizable values during training?
  • RQ2Does amplitude-scheduled periodic regularization enable high-accuracy 8-bit quantization without significant accuracy degradation on standard benchmarks?
  • RQ3How does the performance of periodic function regularization compare to standard quantization schemes in terms of accuracy and robustness across different bit-widths?
  • RQ4Can this method generalize across different network architectures and datasets, such as ResNet-20 on CIFAR-10 and ResNet-50 on ImageNet?
  • RQ5Is the choice of periodic function (e.g., sine vs. hat) critical to performance, or do they yield comparable results?

Key findings

  • The proposed method achieves a test error of 1.29% Top1 on ImageNet with 8-bit quantization using sine-based regularization, matching the original model’s 75.84% Top1 error.
  • On CIFAR-10, the method achieves a test error of 10.20% with 2-bit quantization when using dynamic amplitude scheduling, significantly outperforming static amplitude or baseline methods.
  • For 8-bit quantization on CIFAR-10, the method achieves a test error of 16.66% with dynamic amplitude scheduling, compared to 29.26% with fixed amplitude, demonstrating the benefit of adaptive scheduling.
  • Both sine and hat functions yield comparable performance on ImageNet, with Top1 errors of 75.57% and 75.77% respectively, indicating that function choice is not a critical factor.
  • The method maintains high accuracy across different bit-widths, with a clear performance drop-off below 8 bits, suggesting 8 bits is a practical lower bound for this approach.
  • The approach achieves near-identical accuracy to the full-precision model after quantization, with no need for fine-tuning or specialized training procedures for early/late layers.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.