Bit-wise Training of Neural Network Weights
Authors: Cristian Ivan
Venue: ICLR 2022 Submitted (2022)
Keywords: quantization
pruning
bit-wise training
resnet
lenet

Abstract: We propose an algorithm where the individual bits representing the weights of a neural network are learned. This method allows training weights with integer values on arbitrary bit-depths and naturally uncovers sparse networks, without additional constraints or regularization techniques. We show better results than the standard training technique with fully connected networks and similar performance as compared to standard training for residual networks. By training bits in a selective manner we found that the biggest contribution to achieving high accuracy is given by the first three most significant bits, while the rest provide an intrinsic regularization. As a consequence we show that more than 90% of a network can be used to store arbitrary codes without affecting the its accuracy. These codes can be random noise, binary files or even the weights of previously trained networks.

Under review as a conference paper at ICLR 2022
BIT-WISE TRAINING OF NEURAL NETWORK WEIGHTS
Anonymous authors Paper under double-blind review
ABSTRACT
We propose algorithm where the individual bits representing the weights of a neural network are learned. This method allows training weights with integer values on arbitrary bit-depths and naturally uncovers sparse networks, without additional constraints or regularization techniques. We show better results than the standard training technique with fully connected networks and similar perfor- mance as compared to standard training for residual networks. By training bits in selective manner found that the biggest contribution to achieving high accuracy is given by the first three most significant bits, while the rest provide intrinsic regularization. As a consequence we show that more than 90% of a network can be used to store arbitrary codes without affecting its accuracy. These codes can be random noise, binary files or even the weights of previously trained networks.
INTRODUCTION
Many challenging areas of computer science have found very good solutions by using powerful tech- niques such as deep neural networks. Their applications range now from computer vision, speech recognition, natural language processing, game playing engines, natural sciences such physics, chemistry, biology and even to automated driving. Their success is largely due to the increase in computing power of dedicated hardware which supports massive parallel matrix operations. This enabled researchers to build ever growing models with intricate architectures and millions or even billions of parameters, with impressive results.
However, despite their effectiveness, many aspects of deep neural networks are not well understood. One such aspect is why over-vvranann peee-paraettriiee models are able to generalize well. One of the important avenues of research towards a better understanding of deep learning architectures is neural network sparsity. Frankle & Carbin (019) showed a simple, yet very effective magnitude based pruning technique capable of training neural networks in very high sparsity regimes while retaining the per- formance of the dense counterparts. This sparked new interest in parameter pruning and large body of work the topic has since been published. The techniques for weight pruning be broadly cat- egorized as follows: pruning after training. before training and pruning during training. The work of (Fannkle & Carbin (2019) falls in the first category because the method relies removing the weights which reach small magnitudes after they have been trained. In the second kind of approach, such (Lee al.) 2019) Wang et al.) 2020), neural networks are pruned before training in order to avoid expensive computations at training time. The end goal is to remove connections such that the resulting network is sparse and the weights are efficiently trainable after the pruning procedure. The third kind of approach is to use dynamical pruning strategies (Dai et al. 2019 Mostafa & Wang. 2019) which train and remove weights at the same time.
The main goal behind these pruming strategies is to find sparse neural networks which can be trained to large degrees of accuracy. However, it has been shown by Zhhou al.) (2019) that there exist pruning masks which can be applied to an untrained network such that its performance is far bet- ter than chance. Furthermore, |Ramanujan et al. (2019) developed an algorithm for finding good pruning masks for networks with fixed, random weights. Theoretical works (Malach et al.) 20200 Orseau et al. 2020) even proved that within random neural networks there exist highly efficient sub- networks, which can be found just by pruning. Orseau et al. (2020) advance the hypothesis that the main task of gradient descent to prune the networks while on the second place is the fine-tuning of the weights.

---

Under review as a conference paper at ICLR 2022
2 MOTIVATION
A key issue we want to emphasize is that, in all these works, the way in which the networks are pruned in practice is by forcing them, through some criteria, set fraction of the weights to zero. Since has been shown that sparse networks perform as well as their dense counterpart, or sometimes even better, the natural question that arises is: why doesn't 't gradient descent itself prune the weights during training? Why hasn't t pruning been spontaneously observed in practice? One possible explanation that, at least for classification tasks, the usual cross- entropy loss without ad- ditional regularization techniques are not well suited for this. Other factors such as the stochasticity of the data batches, optimization algorithm, weights initialization etc. might also play a role.
However, we approach this question from different perspective. We hypothesize that important reason for weights not being set to zero is because this is a particular state where the bits representing weight must all equal zero. This is highly unlikely since weights are usually represented bits. The probability
32 single weight being set to exactly zero is 2-31, the sign bit not playing a role. Therefore the chances that significant number of weights is set to zero decreases very rapidly. If weights would be represented on a lower bit depth, then the chance that the optimizer sets them to zero should increase.
In order to test the degree to which this hypothesis is true we experiment with neural networks for image classification where, instead of training the weights themselves, train the individual bits representing the weights. This might allow gradient descent to reach stable states where all bits in of weights are zero and the loss function is around local minimum. If our hypothesis is true then we expect a strong dependency between sparsity and bit-depth.
By encoding weights arbitrary precision we also touch upon the topic of network quantization and show that particular cases of this training technique result in algorithms developed in previous works which we will describe in Section g Moreover, we show that weight quantization naturally leads to weight pruning and sparse networks without additional constraints such a regularizations, additional loss terms, architectural changes or other tricks usually involved in engineering low bit quantized networks.
3 BINARY DECOMPOSITION
We approximate weights on & bits by using the sign and magnitude representation, due to its sim- plicity. A weight tensor of a layer I can be decomposed as:
k-2 Σ
at 2ito:) ) (-1)ak
of
(1)
with a' 1) representing the binary coefficients and i the number of bits. The summation encodes the magnitude of the number while the second factor encodes the sign: this way we obtain numbers in a symmetric interval around zero. We add negative constant oj the exponent in order to allow the representation of fractional numbers (see T). Additionally, this term controls the magnitude of the numbers and, therefore. the width of the weights distribution within layer. Choosing og < k + 1 the weights are guaranteed to be less than 1 in magnitude. In order to constrain a take binary values use auxiliary floating point variables E R (virtual bits) passed through a unit step function: = (z)) = 0 if x S O, otherwise 1.
The weight initialization for the & bit training technique weight matrix is expanded into a 3D tensor of shape (k, n4-1, n2)) with & representing the number of bits and m4-1, ny the number of nodes in the previous and current layer, respectively. Figure illustrates simple example of a (3, 4, 3) bit-tensor. For convolutional layers, where weight tensor in higher dimension, the procedure is analogous to the fully connected case and the bit-tensor is now of shape (k, Sns Sy, 11 n2)) with sa, 5, representing the kernel sizes in x and direction. The value for each bit is chosen randomly with equal probability of being either 0 or (x < 0 in the first case and x > 0 in the second). We ensure the weights sampled in this manner not initialized at exactly zero, because this would mean pruning the network from the start and invalidate our hypothesis. Hence we obtain uniform weight distribution without zeros. We adopt
follows: for fully connected layer the
2

---

Under review as a conference paper at ICLR 2022
Nodes in layer V
Bits
0
I
Nodes in layer U
Figure 1: 3D bit-tensor connecting two dense layers, U and V, with 4 and 3 nodes, respectively.
the Kaiming He (He al., 2015ap initialization technique for each layer's weights, which means the standard deviation is v 2//1111, where 74-1 is the number of nodes in the previous layer. We have determined oy algorithmically via a simple binary search such that this condition is fulfilled for the weight distribution of each layer. This term is a fixed parameter in each layer and depends only on the structure of the network. The virtual bits, I, are chosen from a normal distribution which also satisfies the Kaiming He condition on its variance. For the particular situation where & the weights have only two values and the standard deviation is exactly 2 [Ramanujan et al. (2019) refer to this distribution as the Signed Kaiming Constant.
During training, the feed-forward step is performed as usual, with the weights being calculated according to Eq. (T). The backpropagation phase uses the straight through estimator (STE) (Hinton) 2012 Bengio 2013) for the step function introduced in the weight's binary decomposition. The derivative of a hard threshold function such as the Heaviside step function is zero everywhere except at zero (more specifically it is the Dirac delta function). Since the values of the weights are passed through this step function are almost never exactly zero, the gradients during backpropagation will almost always be zero. This situation leads to a stagnant network which never updates its weights and never learns. To avoid this, during the backpropagation phase the gradient of the step function replaced by the gradient of different function which is non-zero on domain larger than for the step function. Such functions are usually referred to as proxy functions and can take many forms. Yin et al. (2019); [Sekhhottsov Yanush (2020) provide in-depth discussions on the properties of STES. Throughout this work we adopt the method first proposed by |Hinton| (2012) which treats the gradient of a hard threshold function as it were the identity function. This method has been shown
to work very well in practice (Liu et al. 2018 Bulat et al., 2019 2021 Bethge et al. 2019: Alizadeh
et al. 2019)
Notice that in Eq. 1 the additive constant oq can be factored out of the sum. The resulting weights are in the form 0% = 2 O/,, where 0f, contains only integer numbers on bits. The ReLU activation function has the property that al x)) = (x) for any >> 0. It can be shown that for a ReLU network of depth L, scaling the weights of each layer by a factor ay, with / E
representing the layer index, is equivalent to scaling just single layer with = T a, including the input layer. This means that we can gather all factors aj into a single a, scale the input images with that factor and train the network with just integer numbers represented on & bits. At inference time, for classification tasks a is not relevant because the output nodes are all scaled by the same coefficient and arg max(a- x) arg max(x) for any >> 0.
EXPERIMENTS
We have performed an extensive set of experiments where networks were trained on bit-depths ranging from 2 to 32. Figure summmariss the performance of LeNet and ResNet- 18 (LeCun et al.)
1998 He et al., 2015b) trained on MNIST and CIFARIO (LeCun & Cortes 2010 Krizhevsky 2009 Each experiment was repeated 15 times. Each data point represents the best accuracy/sparsity
obtained from all runs and are displayed as violin plots. They show via the kernel density estimation the minimum, mean, maximum and the spread of the repeated runs. The right-most violin shows the performance of the standard 32-bit training technique, the horizontal black line its mean and the shaded area the minimum and maximum accuracy.
3

---

Under review as a conference paper at ICLR 2022
MAST
OPNOE
Figure 2: Classification accuracy and sparsity as a function of the weights bit-depth with LeNet (left) and ResNet (right). The right-most data point indicates the performance of the standard 32-bit training technique. Lower panels indicate the amount of non-zero weights remaining after training. Black dots show the probability that a certain percentage of weights is set to zero by random chance.
The networks were trained with the following setup. For LeNet the learning rate starts at 9 10 and is divided by 10 epoch 40 and 80. We have also experimented with single, fixed learning rate but in that case the standard training technique on 32bits reached maximum accuracy of only 97.7%, while bit-wise weight training did suffer any noticeable penalty. For ResNet the learning rate starts at 6 10-4 and is divided by 10 at epoch 150 and 170. In both cases we used the Adam optimizer (Kingma & Ba 2017).
For LeNet (left panels in Figure 2 this training technique consistently achieves higher mean ac- curacies than the baseline while the same time pruning the network significantly. Moreover, as the bit depth decreases there seems to be slight increase in the mean classification accuracy. This indicates that the additional bits available for the weights impede the ability the gradient descent to converge better solutions. The right panels in Figure show the results of ResNet- 18 trained on CIFAR10. Here we observe a degradation in terms of classification accuracy compared to the standard training technique of about 1.7 percentage points (we will show in Section how to miti- gate this issue). The network sparsity is higher than in the case of LeNet, somewhere in the range of 25-35%, %, for bit depths 2 to 16. Note that the sparsity plots are also represented violins, but their height is smaller relative to the scale of the entire curve due to the very small variations in the sparsity achieved the end of training.
For both LeNet and ResNet there is a strong dependency between the bit depth and the amount of zero weights found by the network. This is in line with our hypothesis that gradient descent does not naturally uncover sparse networks when training weights represented on 32bits. This also explains why currently used pruning techniques require external mechanisms which force the network to set weights to zero while training. In essence, they bypass the weight's whole bit structure, effectively setting all bits to zero at once.
The black dots in Figure 2 indicate the percentage of weights set zero by random chance. We observe that for high bit-depths (k > 24) the chance that gradient descent sets a certain amount of weights zero is almost the same random chance. However, for lower bit-depths gradient descent much more likely to set weights to zero due to the much smaller search space of the weight's 's bit structure.
standard
124
-2.0
0.30
312
0.00
03
Proouecy
23a
33M
104
38
10
-3.4
2.00
0.30
3.00
-0.00
3.40
033
-0.-
0.50
3.2
-25
05
Figure 3: Weight distribution of the second LeNet layer before and after training.
Figure B shows the histogram of (float) weight distribution of the second hidden layer in LeNet before and after training. Bit-wise weight learning moves a significant amount weights either exactly zero to the maximum value representable on & bits. The frequency of intermediary
4

---

Under review as a conference paper at ICLR 2022
values is significantly reduced, in some cases by order of magnitude. Although this technique has no special regularization nor an external weight pruning mechanism, it naturally uncovers sparse networks. This comes in stark contrast with the standard training technique, right most panels. Here, the distribution of the weights after training is much more spread out than the initial one and has a large peak towards zero, but the weights are never exactly zero.
SELECTIVE BIT TRAINING
In Section we have presented experiments where all weight bits are simultancously trained to- gether. Our algorithm, however, also allows us to train specific bits only, while keeping others fixed as they were originally initialized. We can encode as a string mask of 0's and I's which bit is train- able and which not, e.g. for a 4-bit mask 0001 we initialize all bits randomly but we train only the least significant bit, while for 1000 train only the sign bit and leave the rest unchanged. See Table for an example of a weight represented as a 16-bit number.
Sign and magnitude representation of number. Left-most bit gives the sign while right-most is the least significant bit. Using Eq. (1) and choosing results in 16-bit signed integer while for a = 15 results in a floating point number with a magnitude less than
Table
Bit index
15
14
13
12
11
10
8
7
5
4
3
2
0
Bit value
1
1
0
0
0
0
0
0
0
Trainable
1
0
0
O
O
0
0
1
Significance
sign
magnitude
W (a 0)
-4744
W (a= 15)
0.144775390625
Figure 4 show the results achieved by LeNet with all possible selective training patterns for 2, and 8 bits. Training with weights encoded on 2 bits (top-left panel) results in possible scenarios: '01' trains the magnitude, '10' trains the sign and '11' trains the sign well as the magnitude of the weights. Training with weights encoded on bits, pattern '1000' corresponds to training just the sign and keeping the magnitudes random, '0111' corresponds to training the magnitudes and keeping the sign fixed and '1111' corresponds to training all bits. Similarly for 8 bits (bottom panel). The baseline accuracy is shown as the right-most data-point in each graph.
o0 was WOs 1e0
Accing
Figure LeNet trained with all bit patterns for (left), 4 (right) and 8 bits (bottom panel).
Figure 5 shows the same experiments for ResNet. An interesting phenomenon appears when train- ing bits selectively. Several strong discontinuities in the accuracy curve are visible when training weights encoded on and bits. They appear at very specific bit patterns which we will address next. First, we highlight the extreme situations of (a) training just the sign bit and (b) only the mag- nitude bits. Figures 4 and 5 these refer to the central data points with trainable bit patterns '10', '1000" '10000000' for sign training and '01', '0111', '01111111' for magnitude training.
When training just the sign bit, LeNet outperforms the baseline network, as shown in Figure 5 Our weight initialization procedure avoids initializing magnitudes to zero. For the particular case when quantizing weights on & 2 bits it means that the magnitude bit is always 1. In this situation training only the sign bit is therefore equivalent training a binary network with O E {11, 1]. For
5

---

Under review as a conference paper at ICLR 2022
000000
Figure 5: ResNet trained with all bit patterns for (left), (right) and bits (bottom panel).
ResNet, Figure training the weight's sign leads to performance drop of 2-4 percentage points, depending on the quantization size. It shows that this particular network can be trained reasonably well only by changing the sign of the weights and never updating their magnitudes.
Training only the magnitude bits results a very small performance penalty for LeNet as compared to the baseline, and about 1-3 percentage points for ResNet. Training all bits simultaneously leads to the average performance between the two extreme cases. This phenomenon is valid for both ResNet and LeNet, although less visible for the latter. We have performed experiments for bit depths ranging from 2 to 32, where we train only the sign and only the magnitude bits in ResNet. Figure@Jsummant summarizes the test accuracy and sparsity obtained these cases. Notice there little to no correlation between accuracy and bit-depth above 8, whereas sparsity is strongly influenced by it, particularly above 14. For bit-depths lower than 5, magnitude only training rather decreases in performance, while sign only training increases. For the extreme k 2 bits quantization, their accuracy ordering inverted and in this case training both the sign bit and the magnitude bit results in ternary network with θ E {- 1.)
90.0
Test Accuracy
88.5
85.5
Magnitude only
Sign only
Sign and magnitude
32bit baseli
% non-zoro
weights
75
25
Bit-depth
Figure 6: ResNet test accuracy and sparsity after bit-wise training: only the magnitude bits (blue), only the sign bit (red), all bits (green), Bascline indicated by right-most data point.
The second important observation refers to the cases where the sign and the next one two bits are trained, while the following remain randomly initialized. These situations correspond to the trainable bit patterns '1100', '1110', '11000000" and '11100000" in Figures 4 and 5 In all these cases the bit-wise training technique reaches an accuracy above the baseline (LeNet) similarly to it (ResNet). This behaviour indicates that a fraction of the untrainable (and less significant) magnitude bits act as a regularizer, increasing the accuracy of the network compared the case when they are also trained. We investigated how many trainable bits would be sufficient to reach the accuracy of the baseline. To this end we perform bit- training ResNet with 32, 16, 8, 6, 4 and 2 bits encoding for the weights and gradually decrease the number of trainable bits. More specifically, we expand Eq. (1) in the following way:

---

Under review as a conference paper at ICLR 2022
0 2
2'
+
Σ
2
untrainable
trainable
trainable
where & represents the weight's bit-depth and p the number of untrainable bits. For p 0 all bits are trainable and for p = k only the sign is trainable.
90
Test
88
encodinng 8 bits encoding
encoding bits encading
encoding 32 bits encoding
% of non-zero whights
100
75
25
2
11
12
13
14
15
16
17
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Trainable bits
Figure 7: ResNet accuracy function of number of trainable bits, counting from the sign bit. Colors represent the bit-depth of the weights. The baseline, 32bit floating point weights, is shown as the right-most gray data point.
We summarize the results of these experiments in Figure 7 The blue data points represent the test accuracy of ResNet function of the number of trainable bits, with weights encoded as 32bit integers. Training more than 17 bits results in a test accuracy about 88%. As the number of trainable bits decreases the accuracy improves and reaches the level of the baseline when training only the first bits. similar behaviour seen when encoding weights on lower bit-depths. The best performance is obtained when weights are encoded on more than bits and train the sign and the next two most significant magnitude bits. The rest of the available bits do not contribute to the network's s performance, rather they hinder the capacity of the network converge well.
POST-TRAINING BIT ANALYSIS
Training bits selectively uncovers the fact that only a few of the most significant bits contribute to achieving high accuracy, while the others provide regularization. In contrast, standard training does not reveal which weights or bits contribute most to the network's performance. understand this conduct experiments where convert the weights learned in the standard way into weights expressed according to Eq. ① More precisely, we start by training a standard network, and after training, for each layer divide all weights by the magnitude of the smallest non-zero weight within that layer and round to the nearest integer. Therefore we obtain integer weights which can then decompose into binary form and gain access each bit. To be close as possible the original weights we encode the integer weights on 32 bits, even though in most situations weights do not require that many. Thus we convert network trained the standard way, weights 32bit floating point values, into network with integer weights on 32 bits.
order to
Next, we start changing the first p less significant magnitude bits and leave the next 32 p bits unchanged, similar to Eq. (2). In this way we can investigate the impact of each bit on the final accuracy. Note that different layers require a different number of bits to represent the weights and generally, but not necessarily, depends on the number of weights within that layer. If we start changing more bits than a layer requires, the pre-trained structure is destroyed and the network looses its properties. In order to avoid this, compute the maximum number of bits required for the weights in each layer, my. We impose that the maximum number of changed bits for each layer pi gann my 3.
Figure shows the accuracy and sparsity of a standard, pre-trained LeNet and a layer VGG- like network, Conv6, (same as Frankle & Carbin (2019): Zhou et al. (2019): Ramanujan al. (019
7

---

Under review as a conference paper at ICLR 2022
59 21
000
08.13
random
$8.03
08 03
82
13
15
11
100
2110
90
80
changed 8.5
Figure 8: Test accuracy for LeNet (left) and Conv6 (right) as function of number changed bits after training. Red points correspond to setting bits to 1; green correspond to O; blue violins correspond to setting bits randomly to either 0 or Bottom panels indicate sparsity.
function of the number of changed bits. We have experimented with three scenarios: all bits are changed randomly, all bits are set to 0, all bits are set to 1. The first data point in each graph, p 0, represents the performance of the unmodified network with 32 bit floating point weights, as no bits are changed. The following entries indicate the performance of the network as we gradually increase the amount of changed bits. LeNet extends up to 16 bits (the maximum allowed for the first layer in this particular network) and Convó extends up to 25 (the maximum allowed for the first dense layer within this network). Setting all bits to zero (or one) leads to single possible set of weights. Setting bits randomly leads to more possible outcomes. This difference is illustrated in Figure by the way the data-points are represented: a single dot when setting bits to zero/one and a violin when setting bits randomly.
One can observe that also weights trained in a standard 32 bit floating point format do not make full of high precision bits. The first 6 bits do not play significant role for the final accuracy, they can be modified post-training to any value. These results are in line with our initial hypothesis that gradient descent does not prune networks due to the large amount of bits available for the weights. Additionally, we found that the most important contribution to the performance of a network is the sign bit, followed by the next two most significant magnitude bits. This suggests that gradient descent might find a local optimum based only on these three bits while the rest are used to perform fine-tuning. However, this appears be less successful, since a large fraction of the bits might be set to zero, one or left randomly initialized, perhaps due to the stochasticity of the training algorithm (batch training) or the noise present in the data itself.
MESSAGE ENCODING IN WEIGHTS
We have shown so far that 29 of the 32 bits available for the weights of ResNet have overall regularization behaviour and can remain randomly initialized and never trained. This leads to the idea that they could be used encode arbitrary messages while the trainable bits are sufficient to train the network to high degrees of accuracy. To test this hypothesis we have performed several experiments in which embedded various types of messages in the first 29 untrainable bits of neural network's 's weights and train only the next 3. The results are summarized in Figure 9 Each experiment was repeated 10 times.
The first data point shows the bascline accuracy of ResNet trained with the standard method (32bit floating point representation of weights). For the second experiment we assigned random values to the untrainable bits of each layer. In the third experiment we embedded random passages of Shakespeare's 's Hamlet. In the fourth experiment we trained until convergence 29 ResNets with bit- depth and embedded each of them into a new, 32bit ResNet, training in bit-wise fashion the sign and the next two most significant magnitude bits. The test accuracy obtained by the 1bit ResNet is shown the last violin. We observe that embedding either random noise, structured data or set of previously learned weights does not impact the accuracy with respect to the baseline ResNet in any significant way.
8

---

Under review as a conference paper at ICLR 2022
91.5
Accuraty
90.0
88.5
87.0
32b8 base the
29 random tx
Hamiet passages
2lx 1hs Reche:
1b Ranket
Figure 9: Test accuracy with various messages embedded in the first 29 untrainable bits of ResNet.
CONNECTION WITH OTHER WORKS
Our weight initialization procedure described in Section ensures that weights are never set to zero before training. For the particular case where k = 2 bits this means that the magnitude bit is always while the sign bit can be either or O. Training only the sign bit is therefore equivalent to training binary network. This is similar BinaryConnect, BinaryNet (Courbariaux al. 2015 2016) and XNOR-Net (Rastegari et al. 2016) where weights are constrained to -1 and 1. When training with bit pattern '07' (magnitude only) '11' (sign and magnitude) results in ternary network (Li & Liu 2016 Zhu et al., (217)) because the magnitude is now also allowed to change, leading to some weights being set zero.
Training only the magnitude bit the behaviour of our algorithm is effectively very similar in nature and performance the edge-popup algorithm developed by Ramanujan al. (2019) which finds pruning masks for networks with weights randomly sampled from the Signed Kaiming Constant distribution. Encoding weight on arbitrary bit depths and training just the sign bit we obtain the sign-flipping algorithm first shown by Ivan & Florian (2020).
Wang et al. (202T) found in a recent study that possible to embed 36.9MB malware into the dense layers of pretrained 178MB Alex-Net model with 1% accuracy degradation and without being detected by antivirus programs. Our method can store arbitrary code in any layer of network (dense as well as convolutional) and could drastically increase the viral amount without damaging the network's ' performance, at the same time raising no suspicion on the presence of the malware.
SUMMARY
Motivated by the question of why gradient descent does not naturally prune neural connections during training, we developed method to directly train the bits representing the weights. From this perspective we show that an important factor is the over-pand paraaettaaatiiiooonnn in terms number bits available for weight encoding. This also sheds some light into why networks with large amounts of weights are able to generalize well.
Our algorithm enables weight quantization arbitrary bit-depths and can be used tool for bit level analysis of weight training procedures. We show that gradient descent effectively uses only small fraction of the most significant bits, while the less significant regularization and their exact values are not essential for reaching a high classification accuracy. consequence of this property is that, by using 32 bits for the weight representation, more than 90% of ResNet can be used to store a large variety of messages, ranging from random noise to structured data, without affecting its performance.
provide intrinsic
10 REPRODUCIBILITY
The code used for the experiments carried out this work will be made public at: http://ghhhh.oomm//////2277////f

---

Under review as a conference paper at ICLR 2022
REFERENCES
Milad Alizadeh, Javier Fernández--arqquss, Nicholas D. Lane, and Yarin Gal. A systematic study of binary neural networks' optimisation. In International Conference on Learning Representations, 2019. http::////peeerrrrr...eeeerrrrrp
Nicholl
Yoshua Bengio. Estimating propuggtn gradients through stochastic neurons, 2013. URLhttp:
//aaaii.rrr/aa///130000 2982
Joseph Bethge, Haojin Yang, Marvin Borstten, and Christoph Meinel. Back to simplicity: How to train accurate bans from scratch?, 2019.
Adrian Bulat, Georgios Tzimiropoulos, Jean Kossaifi, and Maja Pantic. Improved training of binary networks for human pose estimation and image recognition, 2019.
Adrian Bulat, Brais Martinez, and Georgios Tzimiropoulos. High-capacity expert binary net- works. In International Conference Learning Representations, 2021. URL https://
Matthieu Courbariaux, Yoshua Bengio, and -ean-Pierre David. BinaryConnect: Training deep neural networks with binary weights during propagations, 2015. URL http:://erxiiv.orgg/asss
1031. 00363 Conference paper NIPS 2015.
Matthieu Courbariaux, Itay Hubara, Daniel Soudry, Ran El- Vaniv, and Yoshua Bengio. Binarized neural networks: Training deep neural networks with weights and activations constrained to +1 or -1, 2016.
Xiaoliang Dai, Hongxu Yin, and Niraj K. Jha. NeST: A neural network synthesis tool based on now-and--runs paradigm. IEEE Transactions on Computers, 68 119001744771 2019. ISSN 2326-3814. URL http:://dss doi wtt.//...////////...... 2019 29144399943
Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks, 2019, URL
03635 Conference paper ICLR.
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance ImageNet classification. IEEE International Conference Com- puter Vision (ICCV), pp. 1026-1034, 2015a. https: http://axxivvvo org./ abs///ba//111 http::///arav..orrr//////222.0. 01852
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recog- nition, 2015b. URL http::::/aaww...rr////aa//a /1522 03385 Conference CVPR 2016.
Geoffrey Hinton. Neural networks for machine learning. Coursera video lectures, 2012.
Cristian Ivan and Razvan Florian. Training highly effective connectivities within neural networks with randomly initialized, fixed weights, 2020. URL htttps://axxivvorr///bbbs
16627
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization, 2017. URL http://arxiv org/ abs/1412. 6980 Conference paper ICLR 2015.
Alex Krizhevsky. Learning multiple layers of features from tiny images, 2009. URL https:
//www. cs. toronto. towooto.eeuookeet.....oo..e edu/-krizz earni -n-aninn--eeuueeese 2009 TR. fdf
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document 1998. doi: 10. N..1109//.7779..
recognition. Proceedings of the IEEE,
Yann LeCun and Corinna Cortes. MNIST handwritten digit database, 2010. BRLp:tt:///aan
lecun.
Namhoon Lee. Thalaiyasingam Ajanthan, and Philip H. S. Torr SNIP: Single-shot network prun-
ing based on connection sensitivity, 2019. URL https: http///axvv..///// wttp/a/g////aaaoa//////// 02340 Conference paper ICLR 2019.
Fengfu Li and Bin Liu. Ternary weight networks, 2016. URL http://arxiv.org abs/
1 605. 04711 Workshop paper NIPS 2016.
10

---

Under review as a conference paper at ICLR 2022
Zechun Liu, Baoyuan Wu, Wenhan Luo, Xin Yang, Wei Liu, and Kwang- Ting Cheng. Bi-real net: Enhancing the performance of 1-bit cnns with improved representational capability and advanced training algorithm. Lecture Notes in Computer Science, pp. 747-763, 2018. ISSN 1611-3349. doi: 10. 1007/998--3-000-022----0 44. URL http:: doi wrg. 1007/ 978-3-030-01267-
Eran Malach, Gilad Yehudai, Shai Shalev-Schwartz, and Ohad Shamir. Proving the lottery ticket hy- pothesis: Pruming is all you need. In Hal Daumé III and Aarti Singh (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learn- ing Research, pp. 6682-6691. PMLR, 13-18 Jul 2020. wtw.ttss: //tp/oceps////rceeedd ngg .mlr. pdf
stess/v119/malachhe /ttp:///////////./.o////////////
html
https: /tapp:://axxiiee /aa.iviviiv..//...//..aaaaaaat..
Hesham Mostafa and Xin Wang. Parameter efficient training of deep convolutioal neural networks by dynamic sparse reparameterization, 2019. URL httppe//aaaxxvv..rr////////////s
05967 Conference paper ICML 2019, PMLR 97.
Laurent Orseau, Marcus Hutter, and Omar Rivasplata. Logarithmic pruning is all you need, 2020. URL https:t/aaaast /aaxivv org/ abw.aasssecs/ 12156 Conference paper NeurIPS 2020.
Vivek Ramanujan, Mitchell Wortsman, Aniruddha Kembhavi, Ali Farhadi, and Mohammad Raste- gari. What's hidden in randomly weighted neural network?, 2019. URL
13299
Conference paper CVPR 2020.
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. XNOR-Net: ImageNet classification using binary convolutional neural networks, 2016. URL BRRLhttps: pectps://ariis http///xxxvvorrroe abs/ abs//603.0527. Conference paper ECCV 2016, Springer LNCS 9908, pp. 525-542.
Alexander Shekhovtsov and Viktor Yanush. Reintroducing through estimators as principled methods for stochastic binary networks, 2020.
Chaoqi Wang, Guodong Zhang, and Roger Grosse. Picking winning tickets before training by pre- serving gradient flow, 2020. URL paper ICLR 2020.
httpx/iw.rrg/bb///0002020 http://ab//00220033/ Conference
Zhi Wang, Chaoge Liu, and Xiang Cui. EvilModel: Hiding malware inside of neural network models, 2021. URL/https: //axxiv www.:orggg/bb//o bzgg/abs/2107.0835 26th IEEE Symposium on Computers and Communications (ISCC 2021).
Penghang Yin, Jiancheng Lyu, Shuai Zhang, Stanley Osher, Yingyong Qi, and Jack Xin. Un- derstanding throigh estimator in training activation quantized neural nets, 2019. URL https::/aarxe org/ a 1933. 05662 Conference paper ICLR 2019.
Hattie Zhou, Janice Lan, Rosanne Liu, and Jason Yosinski. Deconstructing lottery tickets: Zeros, signs, and the supermask. In Conference on Neural Information Processing Systems (NIPS), 2019.
httt
abs/ 905. 01067
Chenzhuo Zhu, Song Han, Huizi Mao, and William URL htth:ttpp///xii/ org/ abs/abssss1l1 01064 Poster ICLR 2017.
Dally. Trained ternary quantization, 2017.


Reviews:
[{"review_id": "rUthC9W3k_T", "reviewer": "Reviewer_gsV7", "summary": "", "questions": "", "limitations": "", "rating": 6, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "Strengths:\n- This paper experiments with an interesting an intuitive idea.\n- There are many interesting applications, e.g., more efficient networks and embedding hidden messages in network weights.\n- Most figures include error bars.\n- Figure 3 confirms a main hypothesis (fewer bits encourages sparser networks).\n\nWeaknesses:\n1) The paper could benefit from medium scale experiments, e.g., ImageNet. The method matches standard training on ImageNet but faces accuracy degradation on CIFAR. A concern is that this accuracy degradation would be even more substantial for problems such as ImageNet.\n2) The paper would benefit substantially from a related work section. Since the paper is not 9 pages, there is definitely room for this. I am not an expert on quantization (perhaps another reviewer is) but I know that it is a very active research area. How does this papers method compare to standard methods in quantization? If the author's hypothesis is correct, networks trained with various quantization techniques should be sparse and it would be very interesting to verify this.\n3) There is no discussion of how much extra compute / FLOPs is incurred by this method during training, which may be a drawback. ", "summary_of_the_paper": "This paper proposes to directly train the bit values of each parameter in a neural network, instead of directly optimizing the floating point value of each weight. By varying the number of bits that are allowed to be optimized, the authors show that with less bits the network will become automatically sparser. This method has many interesting applications, including fixing some bits to be a message and only training the rest.", "summary_of_the_review": "The paper is very interesting but would benefit substantially from 1) medium scale experiments (e.g., ResNet on ImageNet) and 2) a more thorough discussion and comparison with related work.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work."}, "extra_text": {}}, {"review_id": "jjp9gDRUBh", "reviewer": "Reviewer_xT9U", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "Here are the strengths and weaknesses of the paper.\n\nStrengths:\n1. The paper is interesting and, in some sense, novel in that it analyze the network weights/bits and regularization in an interesting perspective. By decomposing a weight into separate bits, the function of each bit can be more easily observed and analyzed.\n2. The authors conducted extensive experiments to demonstrate different phenomena from the bit-wise training idea.\n\nWeaknesses:\n1. In the second paragraph, Page 5, I guess it should be \"as shown in Figure 4\" instead of \"as shown in Figure 5\".\n2. In second sentence in Sec 5.1 is quoted here: \"In contrast, standard training does not reveal which weights or bits contribute most to the network’s performance\". I didn't find the following paragraphs support this claim. In contrary, the paragraphs show the most significant bits contribute more to the performance than the others. In network quantization, e.g., 32-bit to 8-bit, one can also find that the least significant bits can be dropped off without hurting performance much.\n3. In second paragraph of Page 4, \"..., in general, neural networks can be trained well only by changing the sign of the weights and never updating their magnitudes\". I don't think 4-percentage drop is small considering Cifar10 is a small dataset and ResNet-18 is relatively a large model. When using a smaller network, the performance drop might be big.\n4. Throughout the paper (e.g., Sec 5.1 and Sec 6), one main claim of the paper is \"a few of the most significant bits contribute to achieving a high accuracy, while the others provide regularization\". This is true but not a significant observation from the perspective of network quantization. When network is big and contains redundancy, the network can be quantized to lower-bit one (e.g., 3 bit) with comparable performance (e.g., [1]). Compared with the full-precision model, the quantized model is well regularized.\n\nQuestions:\n1. As the paper hypothesizes, the 32-bit model does not have much zero weights because the probability of an exactly zero-valued weight is very small (1e-31). If this is true, one should expect the trend between 2 and 14 bit-width in Figure 2 is exponential instead of flat. I didn't find an explanation in the relevant section.\n\n[1] Zhang, Dongqing, et al. \"Lq-nets: Learned quantization for highly accurate and compact deep neural networks.\" Proceedings of the European conference on computer vision (ECCV). 2018.", "summary_of_the_paper": "This paper proposes a neural network training technique such that individual weight bits can be optimized separately. In detail, each weight is represented as a weighted sum of its bits weighted by powers of 2. In training, updating each bit $b$ is achieved by updating a floating-point number $x$ ($b=1, x > 0; b=0, x \\le 0$).\n\nBy conducing extensive experiments, the authors find:\n1) Network with shorter bit-width show more weight sparsity than that with longer bit-width. (Sec 4.)\n2) With selective bit training, only a few most significant bits contribute to the final high model accuracy. The other less important bits serve as regularization. (Sec 5.)\n3) The less significant bits can be used to encode other information. (Sec 6.)", "summary_of_the_review": "The perspective of the paper is interesting, but some claims might need correction. Moreover, the observation is straightforward, especially from the view of network quantization.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work."}, "extra_text": {}}, {"review_id": "geAswnX0XbP", "reviewer": "Reviewer_MjPw", "summary": "", "questions": "", "limitations": "", "rating": 3, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "Unfortunately, there are serious issues with this submission:\n\nThe introduction and motivation seem to be written for a paper that is on pruning not quantization, and they are out of context compared to the title, abstract, and rest of the paper. This is most likely a LaTeX error. The motivation of the paper and comparison to prior art being excluded, it is very hard to assess the quality of the work. I did however try to extrapolate what the authors intended to write, and below is my review for Section 3 and onwards.\n\nIn Section 3, what is the expression for \\alpha in terms of layer dimensions and number of bits such that the He initialization standard deviation condition is satisfied? This seems like an interesting result that can be added inline in the paper, rather than just implicitly mentioning that an expression for \\alpha was derived and used.\n\nWhat is a He distribution? In (He, 2015), variance engineering is done and the contributions are conditions on the variance of the initialized weights. The distributions themselves are either uniform or normal. Can the author clarify what they mean by He distribution, I believe they mean He conditions on variance.\n\nThe experiments are performed on very trivial networks deployed on the MNIST and CIFAR-10 dataset. Can the authors evaluate their work on more contemporary networks such as ResNet on ImageNet and similar tasks?\n\nMessage encoding in the neural network's weight using steganography in training is interesting. However, why does it matter? And can these results be generalized on larger networks.", "summary_of_the_paper": "The paper proposes arithmetic decomposition and training on individual bits in order to achieve low-precision quantization.", "summary_of_the_review": "Unfortunately, it seems this paper was rushed into submission. The idea sounds interesting, however, the proposed manuscript has several serious issues as raised in my main review. I therefore recommend rejection of this paper.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "1: The main claims of the paper are incorrect or not at all supported by theory or empirical results.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "1: The contributions are neither significant nor novel."}, "extra_text": {}}, {"review_id": "HmWwXJPxJXg", "reviewer": "Reviewer_LhyK", "summary": "", "questions": "", "limitations": "", "rating": 3, "confidence": 5, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "The authors provide a nice background of pruning literature and sparse representations in neural networks.  I believe they were trying to provide a background for the idea that sparseness is something inherent and should/could be uncovered by gradient descent.  However, the background citations are for a slightly different, but related topic; pruning techniques are not exactly what this paper is about, but it does share some background with spares representations.\n\nIn motivation, for line\" One possible explanation is that, at least for classification tasks, the usual cross–entropy loss without ad- ditional regularization techniques are not well suited for this\" there needs to be citation.\n\nThe description of STE in section 3 needs more description.\n\nThe experimental results look very preliminary.  Using only LeNet and CIFAR10 might be a good way to triage a technique, but it is very different to draw any conclusions based on these.  They are too small and the results between them barely suggest any trend.  The authors essentially show a known result that training only sign bits (Ivan and Florian 2020) yields good results.  What additional science have the authors uncovered? \n\nThe last section of encoding messages in weights seems quite unrelated to the rest of the paper.  It is interesting, but the results seem random and they don't give us any new insight into the learning process of neural networks.  ", "summary_of_the_paper": "The authors propose a method to train individual bits of weights of a neural network.  The central motivation is the question of why doesn't gradient descent \"discover\" inherent sparsity by setting certain weights to zero? The authors suggest that since there are so many possible states of a 32b integer number, the probability of landing on all zeros is vanishingly small. Using the bit-wise training technique, they are able to demonstrate that good performance can be achieved with few bits of weight representation. The authors also do a series of experiments where only certain bit positions are changeable to demonstrate which positions are most relevant to getting good classification performance.", "summary_of_the_review": "This paper has some interesting concepts but falls short on uncovering novel insight.  They are able to recapitulate other papers' results, but even this seems a bit tenuous. The experimental support for any conclusions is too weak in this paper to draw any real conclusions.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "2: Several of the paper’s claims are incorrect or not well-supported.", "technical_novelty_and_significance": "1: The contributions are neither significant nor novel.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}]

Author rebuttal:

Meta-review: This paper presents some interesting new ideas on training binary neural networks. However, as many reviewers point out the study is quite limited by their experimental section, and some technical issues were raised. These are criticisms that remain largely unaddressed after the author response, hence the paper is not ready for publication at its current form.
Decision: Reject