{'fraction_non_alphanumeric': 0.03518153672952434, 'fraction_numerical': 0.007880664227413453, 'mean_word_length': 4.987363100252738, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On the Acceleration of Deep Neural Network Inference using Quantized Compressed Sensing

Accelerating deep neural network (DNN) inference on resource-limited devices is one of the most important barriers to ensuring a wider and more inclusive adoption. To alleviate this, DNN binary quantization for faster convolution and memory savings is one of the most promising strategies despite its serious drop in accuracy. The present paper therefore proposes a novel binary quantization function based on quantized compressed sensing (QCS). Theoretical arguments conjecture that our proposal preserves the practical benefits of standard methods, while reducing the quantization error and the resulting drop in accuracy.


Deep Neural Network Inference Acceleration
Generally there are three methods for accelerating deep neural network (DNN) inference: (1) hardware optimization, (2) compiler optimization, and (3) model optimization. Each of these methods aims at improving the trade-off between computational cost and model accuracy. In this paper we are interested in model optimization, i.e. architecture optimization [1,18,15], pruning and compression [5,14,9], or low-precision arithmetic and quantization [7,8,11,16,12,13]. Our particular focus is quantization. DNN quantization reduces the size and computational footprint of the models by representing the activations and the weights using a reduced amount of bits. We investigate the particular case of binarization, in which the weights are quantized to a single bit.
Given a DNN layer defined as a triplet {I, W, * } representing input tensor, weights tensor and convolution operator respectively, we approximate the convolution using a binary quantization function Q B (·) as follows: where * denotes the real-valued convolution, ⊕ its binary counterpart and α ∈ R + is a trainable scaling factor. The main advantage of such an approximation is that the binary convolution can be implemented using bit-wise operations. This has been reported to result in 58× faster convolution operations and 32× memory savings [13], offering the possibility to run state-of-the-art DNNs on resource-limited devices. Without loss of generality, we represent the flattened weights of a DNN layer as a vector w ∈ R p and define the binary weight quantization function as follows: (2) inevitably introduces a significant quantization error and therefore significantly reduces the model accuracy. To alleviate this, several strategies have been proposed in the literature for finding the optimal scaling factor α in order to compensate the resulting approximation error induced in equation (1). In [13], the authors proposed the average of the absolute weight values as α value. Similarly, the work presented in [11] showed that the optimal (in least-squares sense) scaling factor α equals the unbiased estimator of the expectation E [|w i |].

Quantized Compressed Sensing
Despite the above-mentioned strategies for quantizing DNNs by finding the optimal scaling factor α, none of these strategies is proven to inherently preserve the properties of the original weights. We therefore advocate for a more principled quantization strategy, based on the well-established compressed sensing (CS) techniques [6]. CS is about efficiently acquiring and reconstructing signals, with as fundamental premise that certain classes of signals, such as natural images, have a representation in terms of a sparsity inducing basis where most of the coefficients are zero or small and only a few are large [3]. More formally, CS describes how one can recover a signal w ∈ R p from m ≤ p measurements achieved from a sensing matrix Φ ∈ R m×p via an under-determined linear system v = Φw. For vectors w restricted to a low-complexity signal set K ⊂ R p , e.g. the set of k-sparse vectors, the reconstruction of the signal is guaranteed if 1 √ m Φ respects the restricted isometry property (RIP) [17]. When m is large enough, the RIP, as introduced in [4], has been proven to be respected with high probability by random matrices Gaussian random matrices (GRM)s with entries identically and independently distributed (i.i.d.) as a standard normal distribution N (0, 1) [2]. In the context of DNN weights, we will further assume that m = p.
The main contribution of this work is to propose a new binary quantization function Q CS B (·), based on the quantized compressed sensing (QCS) scheme introduced in [17]. Similar as for standard CS, when the sensing matrix Φ respects the RIP and a pre-quantization bias ξ ∈ R p is added, the following binary quantization function is proven to efficiently acquire and reconstruct the weights w: where the binary quantization function sign(·) is applied element-wise to the vector Φw + ξ. It is further shown in [17] that if we set the pre-quantization bias as a uniform random vector, i.e. ξ ∼ U p ([0, 1]), it attenuates the impact of Q CS B over the linear measurement of w. Note that the linear measurement of w only adds a small computational cost of the order O(p) [10]. This quantization scheme is also applicable the input tensor I. As such, we propose an enhanced approximation of the convolution operation defined in equation (1): This enhanced approximation guarantees an arbitrary small quantization error, while preserving the important property of resulting into faster convolution operations and drastic memory savings. Moreover, this new quantization scheme eliminates the need for finding an optimal scaling factor as in (1). It is also interesting to observe that the standard quantization scheme (2) is a particular case of our proposed scheme (3) when considering the sensing matrix Φ to be the identity matrix I p and the pre-quantization bias to be 0, which doesn't respect the RIP and increases the quantization error.

Conclusion and Future Work
To the best of our knowledge, this work is one of the first to investigate the synergistic combination of deep neural network (DNN) quantization and quantized compressed sensing (QCS) for inference acceleration. By leveraging both paradigms, we've managed to introduce a novel binary quantization function for approximating the convolution. As a result, our proposal preserves the proven practical benefits in terms of speed of convolution operations and memory savings, while limiting the quantization error and the resulting drop in accuracy. These significant enhancements come at almost no cost and are parameter-free, i.e. only a fixed random measurement matrix and a fixed random pre-quantization bias have been introduced while the trainable scaling factor has been eliminated. As a positive side-effect, the QCS paradigm allows us to quantize the DNN weights and, at the same time, reduce their dimensionality. In an extended version of this work, numerical tests on various benchmark tasks and datasets will be conducted to validate the above-mentioned benefits. This will allow the field of deep learning to advance in terms of inference acceleration on resourcelimited devices, which will pave the way for a wider and more inclusive adoption of DNN based technologies.