Source-linked AI summary

Latent Weights Do Not Exist: Rethinking Binarized Neural Network Optimization

Koen Helwegen, James Widdicombe, Lukas Geiger, Zechun Liu, Kwang-Ting Cheng, Roeland Nusselder

arXiv:1906.02107v2cs.LGstat.ML

TL;DR

BNN training relies on real-valued latent weights, but their role need not match that of weights in real-valued networks. The paper interprets latent-weight magnitude as inertia and introduces Bop; it reports exceeding BinaryNet on CIFAR-10 and competitive results on ImageNet for three binarized networks.

  • Problem

    BNN training methods use real-valued latent weights, while intuitions from real-valued networks may not transfer directly to BNNs.

    Source: §1 · p. 1
  • Method

    The paper interprets latent-weight magnitudes as inertia and introduces Bop, a binary optimizer based on requirements for gradient-based BNN optimization.

    Source: §4 · p. 4, §6 · p. 8
  • Results

    Bop exceeded the state-of-the-art result for BinaryNet on CIFAR-10 and achieved a competitive result on ImageNet for three well-known binarized networks.

    Source: §6 · p. 8
  • Takeaways & Limitations

    Bop is conceptually simpler than current methods and requires less memory during training, while the inertia perspective offers a different account of latent weights in BNN optimization.

    Source: §6 · p. 8

    A fixed threshold across all layers and weights may not be optimal, and the authors suggest normalization may be useful.

    Source: §6 · p. 8

Abstract

from arXiv · show

Optimization of Binarized Neural Networks (BNNs) currently relies on real-valued latent weights to accumulate small update steps. In this paper, we argue that these latent weights cannot be treated analogously to weights in real-valued networks. Instead their main role is to provide inertia during training. We interpret current methods in terms of inertia and provide novel insights into the optimization of BNNs. We subsequently introduce the first optimizer specifically designed for BNNs, Binary Optimizer (Bop), and demonstrate its performance on CIFAR-10 and ImageNet. Together, the redefinition of latent weights as inertia and the introduction of Bop enable a better understanding of BNN optimization and open up the way for further improvements in training methodologies for BNNs. Code is available at: https://github.com/plumerai/rethinking-bnn-optimization

1 Introduction

Binarized neural networks (BNNs) are proposed as a way to reduce the computational, memory, and energy costs that limit neural networks outside data centers. The paper questions importing real-valued-network intuitions into BNN training and introduces a BNN-specific optimizer.

1 Introduction

  • BNNs restrict weights and activations to {−1, +1}, reducing computational expense and memory footprint; specialized hardware can also reduce energy consumption.The introduction motivates BNNs for applications such as self-driving cars, mobile networks, edge devices, and drones.Source: §1 · p. 1
  • Existing BNN training methods use real-valued latent weights, but intuitions from real-valued networks may not transfer and can obscure BNN training.The authors argue that overemphasizing the connection may produce cumbersome methodologies and hinder deeper understanding.Source: §1 · p. 1
  • The paper reinterprets BNN training algorithms, argues latent weights are unnecessary for gradient-based optimization, and introduces an optimizer designed specifically for BNNs.The paper reports empirical evaluation on CIFAR-10 and ImageNet.Source: §1 · pp. 1–2
  • Although the study considers binarized weights and activations, its ideas concern binary weights and make no assumptions about activation precision.The authors state that the ideas can therefore apply to networks with activations of arbitrary precision.Source: §1 · p. 2

2 Background: Training BNNs with Latent Weights

BNN optimization must produce binary weights even though gradient-based updates are not naturally suited to binary values. Existing methods address this by training real-valued latent weights and using a pseudo-gradient to update them.

2 Background: Training BNNs with Latent Weights

  • BNN training imposes a binary-vector constraint, and the paper frames the central challenge as using gradient signals to update weights restricted to binary values.The background contrasts this constraint with real-valued networks, where approximate solutions can be found with SGD-based methods.Source: §2 · p. 2
  • Existing methods maintain a real-valued latent-weight vector during training and deterministically binarize it for the forward pass.This provides a way to use conventional optimization methods despite binary network weights.Source: §2 · p. 2
  • Because the sign operation's gradient vanishes almost everywhere, methods use a pseudo-gradient, with the Straight-Through Estimator replacing binarization by the identity in the backward pass.The pseudo-gradient and latent weights permit optimizers such as Momentum and Adam and regularizers such as L2 regularization and weight decay.Source: §2 · p. 2
  • The discussion focuses on fully deterministic BNNs; stochastic BNNs are identified as outside the paper's scope.The stochastic-BNN line of work is cited as [16] [17].Source: §2 · p. 2

3 The Role of Latent Weights

The paper recasts latent-weight magnitude as inertia that stabilizes binary weights, rather than as a real-valued approximation of them. This view explains several optimization behaviors, while the authors report that latent weights do not yield better accuracy when used directly at evaluation.

3 The Role of Latent Weights

  • Latent-weight magnitude acts as inertia: stronger accumulated inertia requires a stronger gradient signal to flip a binary weight, while clipping caps that inertia.The authors characterize the optimizer as mostly changing inertia rather than binary weights themselves.Source: §3 · pp. 2–3
  • Using real-valued latent weights instead of binarized weights at evaluation produced comparable or lower train and validation accuracy, even after retraining batch statistics.This experiment challenges the view that binary weights work as approximations to the latent real-valued weights.Source: §3 · p. 3
  • Under Theorem 1's conditions, scaling the learning rate while scaling the initial conditions accordingly leaves Algorithm 1's binary weight vector invariant.The corollary permits arbitrary per-weight learning rates when initialization is scaled accordingly.Source: §3 · p. 3
  • The theorem's conditions are rarely met because latent weights are usually clipped and many pseudo-gradients depend on their magnitude.The authors report that SGD with Glorot initialization performs better at learning rate 1 than 0.01, and scaling initialized weights by 0.01 before training yields the same improvement.Source: §3 · p. 3
  • Reducing the learning rate after training can increase accumulated inertia and reduce noise, though clipping may also contribute and the authors say a full explanation requires further analysis.They suggest interpreting Adam's update normalization and layerwise learning-rate scaling in similar terms.Source: §3 · p. 4
  • The authors hypothesize that Momentum reduces noisy behavior near zero latent weight and may prevent rapid binary-weight sign changes when gradient direction reverses.They distinguish this proposed explanation from real-valued-network explanations based on loss-landscape characteristics.Source: §3 · p. 4

4 Bop: a Latent-Free Optimizer for BNNs

Bop is designed specifically for BNNs and decides weight flips using gradient consistency and strength rather than latent-weight update steps. Its moving-average and threshold controls make those flip criteria explicit while reducing hyperparameters and training memory.

  • Because binary weights cannot accumulate update steps, Bop considers both gradient-signal consistency over time and signal strength when deciding flips.Source: §4 · p. 4
  • Bop uses an exponential moving average of gradients and a threshold to decide when each binary weight flips.Source: §4 · p. 4
  • Higher γ adapts the moving average faster, while higher τ requires a stronger flip signal, reducing noise but risking rejection of useful weak signals.Source: §4 · p. 5
  • Bop reduces hyperparameters and training memory, requiring one real-valued variable per weight versus two for Momentum and three for Adam.Source: §4 · p. 5
  • The exponential moving average removes the need for latent weights, a learning rate, and arbitrary clipping while letting γ control the importance of past gradients.Source: §4 · p. 5
  • The authors position Bop as a basic binary optimizer and identify hyperparameter schedules and adaptive variants as research opportunities.Source: §4 · p. 5

5 Empirical Analysis

Bop is competitive on CIFAR-10 and across three ImageNet BNNs; hyperparameter sweeps show a trade-off between learning speed and noisy weight flipping.

5.1 Hyperparameters

  • Higher γ and lower τ increase weight flips, while very low γ with high τ slows learning and aggressive settings produce rapid initial learning that levels off suboptimally.The figure tracks accuracy and the last layer's flip ratio; it shows near-zero flip rates for low γ and high τ.Source: §5.1 · pp. 5–6, Figure 1 · p. 6
  • For the aggressive settings, validation accuracy becomes volatile, and with τ = 0 it deteriorates substantially over time; the authors suggest weak-signal learning increases overfitting.The paper notes that this overfitting cannot simply be explained by greater sensitivity to gradients from a single example or batch.Source: §5.1 · p. 6

5.2 CIFAR-10

  • 91.3% test accuracy for Bop compares with the 90.9% base test accuracy after 500 training epochs.The baseline was highly tuned through random search over its initial learning rate and schedule.Source: §5.2 · p. 6, Figure 2 · p. 7

5.3 ImageNet

  • Bop obtains competitive results on all three ImageNet networks while using almost identical optimizer settings; its XNOR-Net improvement shows scaling factors are not necessary for high accuracy.The table compares Bop accuracies with latent-weight results from the literature.Source: Table 1 · p. 7, §5.3 · p. 7

6 Discussion

The discussion reframes latent weights as inertia rather than approximations of binary weights, introduces Bop, and outlines both its benchmark results and possible directions for improving BNN optimization.

6 Discussion

  • Bop exceeded BinaryNet's state-of-the-art result on CIFAR-10 and achieved a competitive ImageNet result across three well-known binarized networks.The discussion presents Bop as the first optimizer designed specifically for BNNs.Source: §6 · p. 8
  • Latent-weight magnitudes do not affect the forward pass, so BNN optimization should be understood through the conditions that flip binary weights.This contrasts with treating binary weights as approximations to latent weights.Source: §6 · p. 8
  • Rather than only reducing the difference between binary and real-valued networks, BNN improvements may come from optimization methods designed for binary weights.The discussion notes that approximation-focused methods have achieved impressive results, but are not the only option.Source: §6 · p. 8
  • Bop simplifies training and uses less memory; its threshold τ is a key distinction, while τ = 0 makes it mathematically similar to latent-weight SGD.In that case, moving averages m play the role of latent variables.Source: §6 · p. 8
  • Bop's threshold depends on absolute gradient magnitude, and a single fixed threshold may not suit every layer or weight.Suggested alternatives include layer-wise normalization of moving averages or a second moving average for gradient magnitudes.Source: §6 · p. 8
  • The authors suggest exploring schedules that lower Bop's adaptivity rate γ and threshold τ over training, while cautioning that these intuitions may be unreliable.Lowering γ is described as analogous to decreasing the learning rate and increasing inertia.Source: §6 · p. 8
  • The authors identify regularization and knowledge distillation as opportunities for further BNN optimization, while noting that latent-weight decay and dropout present unresolved issues.They also describe latent-weight initialization as one current route for transferring knowledge from real-valued networks.Source: §6 · pp. 8–9

A Proof for Theorem 1

The proof shows that multiplying the learning rate by a positive scalar preserves the binary weights over subsequent updates. It does so by scaling the latent weights while leaving their signs unchanged.

A Proof for Theorem 1

  • Scaling the learning rate by a positive scalar C scales the latent weights by C without changing their signs, leaving the binary weights unchanged.The forward pass, pseudo-gradient, and optimizer update step are therefore unchanged at time t.Source: A Proof for Theorem 1 · p. 12
  • The latent-weight update preserves this scaling: updating the scaled weight yields C times the original updated latent weight.The update step δ_t is generated by optimizer A.Source: A Proof for Theorem 1 · p. 12
  • By induction, the signs of the latent weights remain equal at every later time, so the BNN is unaffected by the learning-rate change.The claim concerns the binary network, whose weights depend on the signs of the latent weights.Source: A Proof for Theorem 1 · p. 12
Loading 1906.02107v2…