Gated XNOR Networks: Deep Neural Networks with Ternary Weights and Activations under a Unified Discretization Framework

Lei Deng, Peng Jiao, Jing Pei, Zhenzhi Wu, Guoqi LiarXiv 2017

TL;DR

This paper introduces GXNOR-Nets, a unified framework for training deep neural networks with ternary weights and activations. By enabling efficient backpropagation on discrete activations and eliminating the need to store full-precision weights during training, GXNOR-Nets promise significant reductions in memory and computation for mobile intelligence applications.

What Problem Does This Paper Address?

Deep neural networks (DNNs) are incredibly powerful but come with a hefty computational and memory overhead, hindering their deployment on resource-constrained devices. While binary and ternary networks offer a solution by replacing costly multiplications with simpler operations, they often require specialized training methods and still necessitate storing full-precision weights during training, creating a bottleneck. This paper addresses the need for a unified framework that can subsume these specialized networks, achieve high performance with reduced overhead, and efficiently handle discrete activations during backpropagation without storing full-precision weights.

Methods

The core of this work lies in a unified discretization framework that tackles two key challenges:

  • Discrete Activation Backpropagation: The authors propose a multi-step neuronal activation discretization function and a derivative approximation technique. This allows for the implementation of the backpropagation algorithm even when neuronal activations are quantized into discrete values, overcoming the non-differentiability issue.
  • Eliminating Full-Precision Weights During Training: A "discrete state transition" (DST) methodology is introduced. This approach constrains synaptic weights to a discrete space (e.g., ternary) throughout the entire training process, eliminating the need to store full-precision weights. Instead, a probabilistic projection operator is used to update weights, directly transforming continuous weight increments into discrete state transitions.

The framework is designed to be flexible, allowing for the number of discrete states for weights and activations to be adjusted, making it adaptable to various hardware platforms. When both weights and activations are ternary, the network is termed a "gated XNOR network" (GXNOR-Net), where computation is only triggered by non-zero weights and activations, leading to an event-driven paradigm.

Datasets

The proposed GXNOR-Net model was evaluated on the following standard datasets:

  • MNIST
  • CIFAR10
  • SVHN

The paper does not introduce new benchmarks.

Key Insights and Ideas

  • Unified Framework: The paper successfully unifies various binary and ternary network approaches under a single framework, offering a more general solution.
  • Event-Driven Computation: The concept of "gated XNOR networks" (GXNOR-Nets) is a significant insight. By making computation conditional on non-zero weights and activations, it enables an event-driven paradigm, which is highly desirable for energy-efficient hardware.
  • Training Without Full-Precision Weights: The DST methodology is a crucial advancement, as it removes the memory burden of storing full-precision weights during training, a common bottleneck in existing binarization/ternarization techniques.
  • Flexible Sparsity: The ability to control the sparsity of neuronal activations by adjusting parameters like the "sparse window" (controlled by r) is a key feature that can be tuned for optimal performance and hardware efficiency.
  • Hardware-Friendly Design: The inherent sparsity and simplified operations make GXNOR-Nets particularly well-suited for efficient hardware implementation, especially for mobile and embedded systems.

Key Results

The GXNOR-Nets achieved comparable performance to state-of-the-art algorithms on the tested datasets:

  • MNIST: 99.32% accuracy
  • CIFAR10: 92.50% accuracy
  • SVHN: 97.37% accuracy

These results outperformed most existing binary or ternary methods. The paper also highlights that GXNOR-Nets can achieve comparable final accuracy to full-precision networks but may converge slower. The analysis of parameters like m, a, and sparsity showed that there exist optimal configurations for these parameters to maximize performance. Furthermore, the hardware analysis indicated a significantly higher resting probability (up to 55.6%) for GXNOR-Nets compared to other methods, signifying substantial energy savings.

Limitations and Future Work

  • Convergence Speed: The paper acknowledges that GXNOR-Nets can converge slower than full-precision continuous networks. While this overhead can be managed on powerful GPUs, it might be a consideration for resource-constrained platforms.
  • Probabilistic Sampling Overhead: The DST methodology involves probabilistic projection, which introduces some computational overhead.
  • Quantitative Advantages: While promising, the paper notes that the quantitative advantages in terms of power consumption might not be "huge" with current digital technology due to the overhead of generating control gate signals. However, this can be improved by increasing computation sparsity.
  • Future Work: The authors suggest that emerging nanodevices with similar event-driven behavior could further enhance the promise of GXNOR-Nets. They also emphasize that the framework's flexibility in adjusting discrete states can be leveraged to choose the best discretization for specific hardware platforms.

Summary updated

Abstract

There is a pressing need to build an architecture that could subsume these networks under a unified framework that achieves both higher performance and less overhead. To this end, two fundamental issues are yet to be addressed. The first one is how to implement the back propagation when neuronal activations are discrete. The second one is how to remove the full-precision hidden weights in the training phase to break the bottlenecks of memory/computation consumption. To address the first issue, we present a multi-step neuronal activation discretization method and a derivative approximation technique that enable the implementing the back propagation algorithm on discrete DNNs. While for the second issue, we propose a discrete state transition (DST) methodology to constrain the weights in a discrete space without saving the hidden weights. Through this way, we build a unified framework that subsumes the binary or ternary networks as its special cases, and under which a heuristic algorithm is provided at the website https://github.com/AcrossV/Gated-XNOR. More particularly, we find that when both the weights and activations become ternary values, the DNNs can be reduced to sparse binary networks, termed as gated XNOR networks (GXNOR-Nets) since only the event of non-zero weight and non-zero activation enables the control gate to start the XNOR logic operations in the original binary networks. This promises the event-driven hardware design for efficient mobile intelligence. We achieve advanced performance compared with state-of-the-art algorithms. Furthermore, the computational sparsity and the number of states in the discrete space can be flexibly modified to make it suitable for various hardware platforms.
BibTeX
@misc{deng2017gated,
  author = {Lei Deng and Peng Jiao and Jing Pei and Zhenzhi Wu and Guoqi Li},
  title = {{Gated XNOR Networks: Deep Neural Networks with Ternary Weights and Activations under a Unified Discretization Framework}},
  year = {2017},
  eprint = {1705.09283},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1705.09283},
}
Figure