ProxQuant : Quantized Neural Networks via Proximal Operators October
Abstract
To make deep neural networks feasible in resource-constrained environments (such as mobile devices), it is beneﬁcial to quantize models by using low-precision weights.
One common technique for quantizing neural networks is the straight-through gradient method, which enables back-propagation through the quantization mapping.
Despite its empirical success, little is understood about why the straight-through gradient method works.
Building upon a novel observation that the straight-through gradient method is in fact identical to the well-known Nesterov’s dual-averaging algorithm on a quantization constrained optimization problem, we propose a more principled alternative approach, called ProxQuant , that formulates quantized network training as a regularized learning problem instead and optimizes it via the prox-gradient method.
ProxQuant does back-propagation on the underlying full-precision vector and applies an eﬃcient prox-operator in between stochastic gradient steps to encourage quantizedness.
For quantizing ResNets and LSTMs, ProxQuant outperforms state-of-the-art results on binary quantization and is on par with state-of-the-art on multi-bit quantization.
For binary quantization, our analysis shows both theoretically and experimentally that ProxQuant is more stable than the straight-through gradient method (i.e. BinaryConnect), challenging the indispensability of the straight-through gradient method and providing a powerful alternative.
Introduction
Deep neural networks (DNNs) have achieved impressive results in various machine learning tasks [7].
High-performance DNNs typically have over tens of layers and millions of parameters, resulting in a high memory usage and a high computational cost at inference time.
However, these networks are often desired in environments with limited memory and computational power (such as mobile devices), in which case we would like to compress the network into a smaller, faster network with comparable performance.
A popular way of achieving such compression is through quantization – training networks with low-precision weights and/or activation functions.
In a quantized neural network, each weight and/or activation can be representable in k bits, with a possible codebook of negligible additional size compared to the network itself.
For example, in a binary neural network ( k = 1), the weights are restricted to be in {± 1 } .
Compared with a 32-bit single precision ﬂoat, a quantized net reduces the memory usage to k/ 32 of a full-precision net with the same architecture [8, 5, 18, 12, 23, 24].
In addition, the structuredness of the quantized weight matrix can often enable faster matrix-vector product, thereby also accelerating inference [12, 9].
Typically, training a quantized network involves (1) the design of a quantizer q that maps a full-precision parameter to a k -bit quantized parameter, and (2) the straight-through gradient method [5] that enables back-propagation from the quantized parameter back onto the original fullprecision parameter, which is critical to the success of quantized network training.
With quantizer q , an iterate of the straight-through gradient method (see Figure 1a) proceeds as θ t +
=
θ t − η t (cid:101) ∇ L ( θ ) | θ = q ( θ t ) , and q ( (cid:98) θ ) (for the converged (cid:98) θ ) is taken as the output model.
For training binary networks, choosing q ( · ) = sign( · ) gives the BinaryConnect method [5].
Though appealingly simple and empirically eﬀective, it is information-theoretically rather mysterious why the straight-through gradient method works well, at least in the binary case: while the goal is to ﬁnd a parameter θ ∈ {± 1 } d with low loss, the algorithm only has access to stochastic gradients at {± 1 } d .
As this is a discrete set, a priori , gradients in this set do not necessarily contain any information about the function values.
Indeed, a simple one-dimensional example (Figure 1b) shows that BinaryConnect fails to ﬁnd the minimizer of fairly simple convex Lipschitz functions in {± 1 } , due to a lack of gradient information in between.
[Equation]
[Table]
/y2gn0a51UhnECIuSTQf1EYYjwKBjck1pwUENLGNfS7or5gGnGwcaXsyF8XYr/J+cllxKXnpaLR6VpHEtoBxXQHqKoio7QCWqgJuLoDj2gJ/Ts3DuPzovzOimdcaY92+gHnLdPjnGb9Q==</latexit>
[Figure]
In this paper, we formulate the problem of model quantization as a regularized learning problem and propose to solve it with a proximal gradient method.
Our contributions are summarized as follows.
• We present a uniﬁed framework for deﬁning regularization functionals that encourage binary, ternary, and multi-bit quantized parameters, through penalizing the distance to quantized sets (see Section 3.1).
For binary quantization, the resulting regularizer is a W -shaped non-smooth regularizer, which shrinks parameters towards either − 1 or 1 in the same way that the Lnorm regularization shrinks parameters towards 0.
We demonstrate that the prox-operators for regularizers that come out of our framework often admit linear
-time solutions (or linear time approximation heuristics) which result in numerically exact quantized parameters.
• We propose training quantized networks using ProxQuant (Algorithm 1) — a stochastic proximal gradient method with a homotopy scheme.
Compared with the straight-through gradient method, ProxQuant has access to additional gradient information at non-quantized points, which avoids the problem in Figure 1b and its homotopy scheme prevents potential overshoot early in the training (Section 3.2).
Algorithmically, ProxQuant involves just adding a simple proximal step with respect to a quantization-inducing regularizer after each stochastic gradient step (Figure 1a), thus can be eﬃciently implemented under any major deep learning frameworks without incurring signiﬁcant system overhead and be used as a modular component to add to the training pipeline of any deep networks to result in a quantized network.
• We demonstrate the eﬀectiveness and ﬂexibility of ProxQuant through systematic experiments on (1) image classiﬁcation with ResNets (Section 4.1); (2) language modeling with LSTMs (Section 4.2).
The ProxQuant method outperforms the state-of-the-art results on binary quantization and is comparable with the state-of-the-art on ternary and multi-bit quantization.
• For binary nets, we show that BinaryConnect suﬀers from more optimization instability than ProxQuant through (1) a theoretical characterization of convergence for BinaryConnect (Section 5.1) and (2) a sign change experiment on CIFAR-10 (Section 5.2). Experimentally, ProxQuant ﬁnds better binary nets that is also closer to the initialization in the sign change metric.
1. Prior work Methodologies
Han et al. [8] propose Deep Compression, which compresses a DNN via sparsiﬁcation, nearest-neighbor clustering, and Huﬀman coding.
This architecture is then made into a specially designed hardware for eﬃcient inference [9].
In a parallel line of work, Courbariaux et al.
[5] propose BinaryConnect that enables the training of binary neural networks, and Li and
Liu [14], Zhu et al.
[24] extend this method into ternary quantization.
Training and inference on quantized nets can be made more eﬃcient by also quantizing the activation [12, 18, 23], and such networks have achieved impressive performance on large-scale tasks such as ImageNet classiﬁcation [18, 24].
In the NLP land, quantized language models have been successfully trained using alternating multi-bit quantization [22].
Li et al.
[15] prove the convergence rate of stochastic rounding and BinaryConnect on convex problems and demonstrate the advantage of BinaryConnect over stochastic rounding on nonconvex problems.
Anderson and Berg [1] demonstrate the eﬀectiveness of binary networks through the observation that the angles between high-dimensional vectors are approximately preserved when binarized, and thus high-quality feature extraction with binary weights is possible.
Ding et al.
[6] show a universal approximation theorem for quantized ReLU networks.
Sun and Sun [19] perform model quantization through a Wasserstein regularization term and minimize via the adversarial representation, similar as in Wasserstein GANs [2].
Their method has the potential of generalizing to other generic requirements on the parameter, but might be hard to tune due to the instability of the inner maximization problem.
While preparing this manuscript, we discovered the independent work of Carreira-Perpin´an [3],
Carreira-Perpin´an and Idelbayev [4]. They formulate quantized network training as a constrained optimization problem and propose to solve them via augmented Lagrangian methods.
From an optimization perspective, our views are largely complementary: they treat the quantization as a constraint, whereas we encourage quantization through a regularizer. Due to time constraints, we did not do experimental comparison (they only reported results on VGG whereas we focus on ResNets) – as they solve a full augmented Lagrangian minimization in between each compression step, successful training of their LC algorithm will at least require a careful tuning of this inner optimization procedure.
Preliminaries
The optimization diﬃculty of training quantized models is that they involve a discrete parameter space and hence eﬃcient local-search methods are often prohibitive.
For example, the problem of training a binary neural network is to minimize L ( θ ) for θ ∈ {± 1 } d .
Projected SGD on this set will not move unless with an unreasonably large stepsize [15], whereas greedy nearest-neighbor search requires d forward passes which is intractable for neural networks where d is on the order of millions.
Alternatively, quantized training can also be cast as minimizing L ( q ( θ )) for θ ∈ R d and an appropriate quantizer q that maps a real vector to a nearby quantized vector, but θ (cid:55)→ q ( θ ) is often non-diﬀerentiable and piecewise constant (such as the binary case q ( · ) = sign( · )), and thus back-propagation through q does not work.
2. The straight-through gradient method
The pioneering work of BinaryConnect [5] proposes to solve this problem via the straight-through gradient method , that is, propagate the gradient with respect to q ( θ ) unaltered to θ , i.e. to let ∂L∂θ :
= ∂L∂ q ( θ ) .
One iterate of the straight-through gradient method (with the SGD optimizer) is {+θ t +
+}
= θ t − η t (cid:101) ∇ L ( θ ) | θ = q ( θ t ) .
This enables the real vector θ to move in the entire Euclidean space, and taking q ( θ ) at the end of training gives a valid quantized model.
Such a customized back-propagation rule yields good empirical performance in training quantized nets and has thus become a standard practice [5, 24, 22].
However, as we have discussed, it is information theoretically unclear how the straight-through method works, and it does fail on very simple convex Lipschitz functions (Figure 1b).
2. Straight-through gradient as lazy projection
Our ﬁrst observation is that the straight-through gradient method is equivalent to a dual-averaging method, or a lazy projected SGD [21].
In the binary case, we wish to minimize L ( θ ) over Q = {± 1 } d , and the lazy projected SGD proceeds as
[Equation]
Written compactly, this is θ t +
=
θ t − η t
[Equation]
θ ) | θ =
q ( θ t ) , which is exactly the straight-through gradient method: take the gradient at the quantized vector and perform the update on the original real vector.
2. Projection as a limiting proximal operator
We take a broader point of view that a projection is also a limiting proximal operator with a suitable regularizer, to allow more generality and to motivate our proposed algorithm.
Given any set Q , one could identify a regularizer R : R d → R ≥ 0 such that the following hold: [Equation] [Equation] and
[Equation]
In the case Q = {± 1 } d for example, one could take
[Equation]
The proximal operator (or prox operator) [17] with respect to R and strength λ > 0 is
[Equation]
In the limiting case λ = ∞ , the argmin has to satisfy R ( θ ) = 0, i.e. θ ∈ Q , and the prox operator is to minimize (cid:107) θ − θ 0 (cid:107) 22 over θ ∈ Q , which is the Euclidean projection onto Q .
Hence, projection is also a prox operator with λ = ∞ , and the straight-through gradient estimate is equivalent to a lazy proximal gradient descent with and λ = ∞ .
While the prox operator with λ = ∞ correponds to “hard” projection onto the discrete set Q , when λ < ∞ it becomes a “soft” projection that moves towards Q .
Compared with the hard projection, a ﬁnite λ is less aggressive and has the potential advantage of avoiding overshoot early in training.
Further, as the prox operator does not strictly enforce quantizedness, it is in principle able to query the gradients at every point in the space, and therefore has access to more information than the straight-through gradient method.
Quantized net training via regularized learning
We propose the ProxQuant algorithm, which adds a quantization-inducing regularizer onto the loss and optimizes via the (non-lazy) prox-gradient method with a ﬁnite λ .
The prototypical version of ProxQuant is described in Algorithm 1.
Algorithm
Require:
Regularizer R that induces desired quantizedness, initialization θ 0 , learning rates { η t } t ≥ 0 , regularization strengths { λ t } t ≥while not converged do
Perform the prox-gradient step
[Equation]
The inner SGD step in eq.
(5) can be replaced by any preferred stochastic optimization method such as Momentum SGD or Adam [13].
end while
Compared to usual full-precision training, ProxQuant only adds a prox step after each stochastic gradient step, hence can be implemented straightforwardly upon existing full-precision training.
As the prox step does not need to know how the gradient step is performed, our method adapts to other stochastic optimizers as well such as Adam.
Further, each iteration is a prox-gradient step over the objective L ( θ ) + λ t R ( θ ) with learning rates η t , and by choosing ( η t , λ t ) we obtain a joint control over the speed of training and falling onto the quantized set.
In the remainder of this section, we deﬁne a ﬂexible class of quantization-inducing regularizers through “distance to the quantized set”, derive eﬃcient algorithms of their corresponding prox operator, and propose a homotopy method for choosing the regularization strengths.
Our regularization perspective subsumes most existing algorithms for model-quantization (e.g.,[5, 8, 22]) as limits of certain regularizers with strength λ → ∞ .
Our proposed method can be viewed as a principled generalization of these methods to λ < ∞ .
3. Regularization for model quantization
Let Q ⊂ R d be a set of quantized parameter vectors.
An ideal regularizer for quantization would be to vanish on Q and reﬂect some type of distance to Q when θ / ∈ Q .
To achieve this, we propose L 1 and L 2 regularizers of the form
[Equation]
This is a highly ﬂexible framework for designing regularizers, as one could specify any Q and choose between L 1 and L 2 .
Speciﬁcally, Q encodes certain desired quantization structure.
By appropriately choosing Q , we can specify which part of the parameter vector to quantize 1 , the number of bits to quantize to, whether we allow adaptively-chosen quantization levels and so on.
The choice of distance metrics will result in distinct properties in the regularized solutions. For example, choosing the L 1 version leads to non-smooth regularizers that induce exact quantizedness in the same way that L 1 norm regularization induces sparsity [20], whereas choosing the squared L 2 version leads to smooth regularizers that induce quantizedness “softly”.
In the following, we present a few examples of regularizers under our framework eq.
(6) which induce binary weights, ternary weights and multi-bit quantization.
We will also derive eﬃcient algorithms (or approximation heuristics) for solving the prox operators corresponding to these regularizers, which generalize the projection operators used in the straight-through gradient algorithms.
Binary neural nets
In a binary neural net, the entries of θ are in {± 1 } .
A natural choice would be taking Q = {− 1 , 1 } d .
The resulting L 1 regularizer is
[Equation]
[Equation]
This is exactly the binary regularizer R bin that we discussed earlier in eq.
Figure 2 plots the W-shaped one-dimensional component of R bin from which we see its eﬀect for inducing {± 1 } quantization in analog to L 1 regularization for inducing exact sparsity.
[Figure]
[Equation]
[Figure]
The prox operator with respect to R bin , despite being a nonconvex optimization problem, admits a simple analytical solution:
[Equation]
We note that the choice of the L 1 version is not unique: the squared
L 2 version works as well, whose prox operator is given by ( θ + λ sign( θ )) /
(1 + λ ).
See Appendix A.1 for the derivation of these prox operators and the deﬁnition of the soft thresholding operator.
Multi-bit quantization with adaptive levels.
Following [22], we consider k -bit quantized parameters with a structured adaptively-chosen set of quantization levels, which translates into Q =
[Equation]
The squared L 2 regularizer for this structure is
[Equation]
10) which is also the alternating minimization objective in [22].
We now derive the prox operator for the regularizer eq.
For any θ , we have
[Equation]
(cid:13)(cid:13)(cid:13)
[Equation]
inf
[Equation]
[Equation]
(cid:13)(cid:13)(cid:13)(cid:101)
θ
[Equation]
(cid:13)(cid:13)(cid:13) 2 (cid:41) = arg min (cid:101)
[Equation]
inf
[Equation]
(cid:13)(cid:13)(cid:13)(cid:101)
[Equation]
(cid:13)(cid:13)(cid:13)
[Equation]
(cid:13)(cid:13)(cid:13)(cid:101)
[Equation]
(cid:13)(cid:13)(cid:13)
[Equation]
(cid:27) .
This is a joint minimization problem in ( (cid:101) θ, B, α ), and we adopt an alternating minimization schedule to solve it:
(1) Minimize over (cid:101) θ given ( B, α ), which has a closed-form solution
[Equation]
(2) Minimize over ( B, α ) given (cid:101) θ , which does not depend on θ 0 , and can be done via calling the alternating quantizer of [22]: Bα = q alt ( (cid:101) θ ).
Together, the prox operator generalizes the alternating minimization procedure in [22], as λ governs a trade-oﬀ between quantization and closeness to θ .
To see that this is a strict generalization, note that for any λ the solution of eq.
(11) will be an interpolation between the input θ and its Euclidean projection to Q .
As λ → + ∞ , the prox operator collapses to the projection.
Ternary quantization is a variant of 2-bit quantization, in which weights are constrained to be in {− α, 0 , β } for real values α, β > 0.
We defer the derivation of the ternary prox operator into Appendix A.2.
3. Homotopy method for regularization strength
Recall that the larger λ t is, the more aggressive θ t +1 will move towards the quantized set.
An ideal choice would be to (1) force the net to be exactly quantized upon convergence, and (2) not be too aggressive such that the quantized net at convergence is sub-optimal.
We let λ t be a linearly increasing sequence, i.e. λ t := λ · t for some hyper-parameter λ >which we term as the regularization rate .
With this choice, the stochastic gradient steps will start oﬀ close to full-precision training and gradually move towards exact quantizedness, hence the name “homotopy method”.
The parameter λ can be tuned by minimizing the validation loss, and controls the aggressiveness of falling onto the quantization constraint.
There is nothing special about the linear increasing scheme, but it is simple enough and works well as we shall see in the experiments.
Experiments
We evaluate the performance of ProxQuant on two tasks: image classiﬁcation with ResNets, and language modeling with LSTMs.
On both tasks, we show that the default straight-through gradient method is not the only choice, and our ProxQuant can achieve the same and often better results.
4. Image classiﬁcation on CIFARProblem setup
We perform image classiﬁcation on the CIFAR-10 dataset, which containstraining images and 10000 test images of size 32x32.
We apply a commonly used data augmentation strategy (pad by 4 pixels on each side, randomly crop to 32x32, do a horizontal ﬂip with probability 0.5, and normalize).
Our models are ResNets [10] of depth 20, 32, and 44 with weights quantized to binary or ternary.
Method We use ProxQuant with regularizer eq.
(3) in the binary case and eqs.
(13) and (14) in the ternary case, which we respectively denote as PQ-B and PQ-T. The training is initialized at pre-trained full-precision nets (warm-start). For the regularization strength we use the homotopy method λ t = λ · t with λ = 10 − 4 .
We initialize at pre-trained full-precision networks and use the
Adam optimizer with constant learning rate 0.01.
To accelerate training in the ﬁnal stage, we do a hard quantization θ (cid:55)→ q ( θ ) at epoch 400 and keeps training till the 600-th epoch to stabilize the BatchNorm layers.
We compare with BinaryConnect (BC) for binary nets and Trained Ternary Quantization (TTQ) [24] for ternary nets.
For BinaryConnect, we haven’t found reported results with ResNets on CIFAR-10, and we train with the recommended Adam optimizer with learning rate decay [5] (initial learning rate 0.01, multiply by 0.1 at epoch 81 and 122, hard-quantize at epoch 400), which we ﬁnd leads to the best result for BinaryConnect.
The top-1 classiﬁcation errors are reported in Table 1.
For binary nets, our ProxQuantBinary consistently yields better results than BinaryConnect.
For ternary nets, our results are comparable with the reported results of TTQ, 2 and the best performance of our method overruns (from the same initialization) is slightly better than TTQ.
[Table]
4. Language modeling with LSTMs Problem setup
We perform language modeling with LSTMs [11] on the Penn Treebank (PTB) dataset [16], which contains 929K training tokens, 73K validation tokens [Table] and 82K test tokens.
Our model is a standard one-hidden-layer LSTM with embedding dimension 300 and hidden dimension 300.
We train quantized LSTMs with the encoder, transition matrix [Table] and the decoder quantized to k -bits for k ∈ { 1 , 2 , 3 } .
The quantization is performed in a row-wise fashion, so that each row of the matrix has its own codebook { α 1 , . . .
, α k } .
We compare our multi-bit ProxQuant (eq. (11)) to the state-of-the-art alternating minimization algorithm with straight-through gradients [22].
Training is initialized at a pre-trained full-precision LSTM.
We use the SGD optimizer with initial learning rate 20.0 and decay by a factor of 1.2 when the validation error does not improve over an epoch.
We train for 80 epochs with batch size 20, BPTT 30, dropout with probability 0.5, and clip the gradient norms to 0 .
The regularization rate λ is tuned by ﬁnding the best performance on the validation set.
In addition to multi-bit quantization, we also report the results for binary LSTMs (weights in {± 1 } ), comparing BinaryConnect and our ProxQuant -Binary.
Result We report the perplexity-per-word (PPW, lower is better) in Table 2.
The performance of ProxQuant is comparable with the Straight-through gradient method.
On Binary LSTMs,
ProxQuant -Binary beats BinaryConnect by a large margin.
These results demonstrate that ProxQuant oﬀers a powerful alternative for training recurrent networks.
[Table]
Stability analysis of binary quantization 5. Convergence characterization for BinaryConnect
We now show that BinaryConnect has a very stringent convergence condition.
Consider the BinaryConnect method with batch gradients:
[Equation]
Deﬁnition 5.1 (Fixed point and convergence) .
We say that s ∈ {± 1 } d is a ﬁxed point of the BinaryConnect algorithm, if s {+
+}
= s in eq.
(12) implies that s t =
s for all t = 1 , 2 , ... .
We say that the BinaryConnect algorithm converges if there exists t < ∞ such that s t is a ﬁxed point.
Theorem 5.1.
Assume that the learning rates satisfy
[Equation]
∞ t =0 η t = ∞ , then s ∈ {± 1 } d is a ﬁxed point for BinaryConnect eq.
(12) if and only if sign ( ∇ L ( s )
[ i ])
= − s [ i ] for all i ∈
[ d ] such that ∇ L ( θ )
[ i ] (cid:54) = 0 .
Such a point may not exist, in which case BinaryConnect does not converge for any initialization θ 0 ∈ R d .
We have already seen that such a ﬁxed point s might not exist in the toy example in Figure 1b.
In the following sign change experiment on CIFAR-10, we are going to see that BinaryConnect indeed fails to converge to a ﬁxed sign pattern, corroborating Theorem 5.1. 5. Sign change experiment
We experimentally compare the training dynamics of ProxQuant -Binary and BinaryConnect through the sign change metric. The sign change metric between any θ 1 and θ 2 is the proportion of their diﬀerent signs, i.e. the (rescaled) Hamming distance:
[Equation]
In R d , the space of all full-precision parameters, the sign change is a natural distance metric that represents the closeness of the binarization of two parameters.
Recall in our CIFAR-10 experiments (Section 4.1), for both BinaryConnect and ProxQuant , we initialize at a good full-precision net θ 0 and stop at a converged binary network (cid:98) θ ∈ {± 1 } d . We are interested in SignChange ( θ 0 , θ t ) along the training path, as well as SignChange ( θ 0 , (cid:98) θ ), i.e. the distance of the ﬁnal output model to the initialization. As ProxQuant converges to higher-performance solutions than BinaryConnect, we expect that if we run both methods from a same warm start, the sign change of ProxQuant should be higher than that of BinaryConnect, as in general one needs to travel farther to ﬁnd a better net. However, we ﬁnd that this is not the case: ProxQuant produces binary nets with both lower sign changes and higher performances, compared with BinaryConnect.
This ﬁnding is consistent in all layers, across diﬀerent warm starts, and across diﬀernent runs from each same warm start (see Figure 3 and Table 3 in Appendix B).
This shows that for every warm start position, there is a good binary net nearby which can be found by ProxQuant but not BinaryConnect, suggesting that BinaryConnect, and in general the straight-through gradient method, suﬀers from higher optimization instability than ProxQuant .
This result here is also consistent with Theorem 5.1:
the signs in BinaryConnect never stop changing until we manually freeze the signs at epoch 400.
[Figure]
Conclusion
In this paper [Figure] we propose and experiment with the ProxQuant method for training quantized networks.
Our results demonstrate that ProxQuant oﬀers a powerful alternative to the straightthrough gradient method and suﬀers from less optimization instability.
For future work, it would be of interest to propose alternative regularizers for ternary and multi-bit ProxQuant and experiment with our method on larger tasks [Figure] Acknowledgement We thank Tong He, Yifei Ma, Zachary Lipton
[Figure]
and John Duchi for their valuable feedback. We thank Chen Xu and Zhouchen Lin for the insightful discussion on multi-bit quantization and sharing the implementation of [22] with us. We thank Ju Sun for sharing the draft of [19] and the inspiring discussions on adversarial regularization for quantization A Additional results on Regularization A. Prox operators for binary nets
Here we derive the prox operators for the binary regularizer eq.
(7) and its squared L 2 variant.
Recall that
[Equation]
By deﬁnition of the prox operator, we have for any θ ∈ R d that
[Equation]

[Equation]
This minimization problem is coordinate-wise separable.
For each (cid:101) θ j , the penalty term remains the same upon ﬂipping the sign, but the quadratic term is smaller when sign( (cid:101) θ j ) =
sign( θ j ).
Hence, the solution θ (cid:63) to the prox satisﬁes that sign( θ (cid:63)j ) = sign( θ j ), and the absolute value satisﬁes | θ (cid:63)j | = arg min t ≥
[Equation]
Multiplying by sign( θ (cid:63)j ) = sign( θ j ), we have [Equation] , which gives eq.
For the squared L 2 version, by a similar argument, the corresponding regularizer is
[Equation]
For this regularizer we have
[Equation]

[Equation]
Using the same argument as in the L 1 case, the solution θ (cid:63) satisﬁes sign( θ (cid:63)j ) = sign( θ j ), and | θ (cid:63)j | = arg min t ≥(cid:26)
[Equation]
2( t − | θ j | ) 2 + λ ( t − 1)(cid:27) =
| θ j | + λ 1 + λ .
Multiplying by sign( θ (cid:63)j ) = sign( θ j ) gives θ (cid:63)j = θ j + λ sign( θ j ) 1 + λ , or, in vector form, θ (cid:63) =
( θ + λ sign( θ )) /
(1 + λ ).
A. Prox operator for ternary quantization
For ternary quantization, we use an approximate version of the alternating prox operator eq.
(11): compute (cid:101) θ = prox λR ( θ ) by initializing at (cid:101) θ
= θ and repeating (cid:98) θ
= q ( (cid:101) θ ) and (cid:101)
θ =
[Equation]
λ (cid:98) θ 1 + 2 λ , (13) where q is the ternary quantizer deﬁned as
[Equation]
This is a straightforward extension of the TWN quantizer [14] that allows diﬀerent levels for positives and negatives.
We ﬁnd that two rounds of alternating computation in eq.
(13) achieves a good performance, which we use in our experiments.
B Detailed sign change results on ResNet-
[Table]
[Table]
C Proof of Theorem 5.
We start with the “ ⇒ ” direction.
If s is a ﬁxed point, then by deﬁnition there exists θ 0 ∈ R
d
such that θ t = θ for all t = 0 , 1 , 2 , ... .
By the iterates eq.
[Equation]
[-As both R and L are even functions, a symmetric argument holds for θ 1 from which we get θ 2 = − θ 
-]
−
T
[Equation] t
[Equation]
η
[Equation]
∇ L ( s t ) .
Take signs on both sides and apply s t
= s for all t on both sides, we get that
[Equation]
Take the limit T → ∞ and apply the assumption that (cid:80) t η t = ∞ , we get that for all i ∈ [ d ] such that [ ∇ L ( θ )] i
[Equation]
= 0, [Equation]
s )
[Equation]
[ i ] .
Now we prove the “ ⇐ ” direction.
If θ obeys that sign( ∇ L ( s )[ i ])
= − s [ i ] for all i ∈
[ d ] such that ∇ L ( s )
[ i ] (cid:54) = 0, then if we take any θ 0 such that sign( θ 0 )
=
s , θ t will move in a straight line towards the direction of −∇ L ( s ), which does not change the sign of h 0 .
In other words, s t = sign( θ t )
= sign( θ 0 ) =
s for all t = 0 , 1 , 2 , ... .
Therefore, by deﬁnition, s is a ﬁxed point.