Table-Based Neural Units: Fully Quantizing Networks for Multiply-Free Inference

Michele Covell, David Marwood, Shumeet Baluja, Nick JohnstonarXiv 2019

TL;DR

This paper introduces "Table-Based Neural Units," a method to fully quantize weights, biases, and activations in deep networks, replacing expensive multiplications with simple look-up tables (LUTs). By eliminating all floating-point operations, the authors achieve near-baseline accuracy on architectures like MobileNet and ResNet while creating models perfectly suited for ultra-low-power FPGA and ASIC hardware.

What Problem Does This Paper Address?

Deploying deep neural networks on edge devices (like smartphones or IoT sensors) is a constant battle against constraints in memory, bandwidth, and power. Standard networks rely heavily on floating-point multiplications, which are computationally expensive and energy-intensive in hardware.

While quantization (reducing the precision of numbers) is a common solution, most existing methods are "partial"—they might quantize weights but keep activations in high precision, or they might still require fixed-point multiplications. The authors aim for full quantization, removing multiplications entirely to enable "multiply-free" inference.

Methods

The core innovation is the LUT-based neural unit. Instead of calculating $weight \times activation$ at runtime, the system pre-computes all possible products for a given set of quantized weights ($N_w$) and activations ($N_a$) and stores them in a table.

The LUT-based neural unit replaces multiplications with table lookups and additions.

To make this work effectively, the authors explored several quantization strategies:

  • Model-Free Adaptive Quantization: Uses a non-parametric approach where weights are sorted and binned based on their distribution in a pre-trained floating-point model.
  • Laplacian-Model Quantization: Leverages the observation that weight distributions in trained networks often resemble a Laplacian curve. They use this mathematical model to determine optimal cluster centers.
  • Octave Sampling: A "fixed codebook" approach where weights are constrained to be powers of two (octaves). This allows the system to replace the large multiplication LUT with even smaller tables and simple bit-shifts.

The training process uses the Straight-Through Estimator (STE) to allow gradients to flow through the discrete quantization steps, with periodic "reinforcement" where weights are snapped back to their quantized centers every 1000 steps.

Datasets

The researchers evaluated their approach using the ImageNet 2012 classification dataset. They tested the method across three distinct architectures to prove versatility:

  • AlexNet: A classic benchmark for quantization research.
  • ResNet-101: A deep, modern architecture utilizing non-separable kernels.
  • MobileNet: A compact architecture specifically designed for mobile and embedded devices.

Key Insights and Ideas

  • The "Multiply-Free" Frontier: By moving to a table-based approach, the computational bottleneck shifts from the ALU (Arithmetic Logic Unit) to memory access. If the LUT is small enough to fit in a processor's L1 cache or an FPGA's distributed RAM, inference becomes incredibly fast and efficient.
  • Weights are Laplacian: The authors confirmed that weights in well-trained networks aren't random; they follow predictable distributions (Laplacian or Gaussian). This allows for very efficient "model-based" quantization that minimizes error.
  • Strategic Level Placement: Unlike standard fixed-point math, which forces levels to be equally spaced, the table-based approach allows for non-uniform spacing. You can place more quantization levels where the data is densest (e.g., near zero), capturing more information with fewer bits.
  • Complexity Metrics: The paper introduces Neural-Unit Complexity (NUC) and Network-Wide Non-Compactness (NWNC). These provide hardware engineers with concrete measures of how much on-chip memory a specific quantization scheme will require.

Key Results

The results demonstrate that full quantization doesn't have to mean a massive drop in accuracy.

Accuracy vs. Neural-Unit Complexity (NUC) for AlexNet, ResNet, and MobileNet.
  • MobileNet: Achieved 66.9% recall@1 (only 1.6% below the baseline) using a tiny table of just 40 entries. When increased to 320 entries, the accuracy gap disappeared entirely.
  • ResNet-101: Their best performance reached 76.5% recall@1, actually outperforming their own ReLU6 baseline (74.8%) while using only 347 unique values for the entire network.
  • AlexNet: The method achieved 56.6% recall@1, surpassing several previous quantization techniques that still relied on floating-point or fixed-point multiplications.

Limitations and Future Work

While the results are impressive, the authors note a few trade-offs:

  • Octave vs. Linear Activations: While octave-based quantization for activations (log-domain) further reduces hardware complexity, it resulted in a performance degradation (about 5.6%) compared to uniform linear quantization.
  • Training Complexity: The process requires fine-tuning from a pre-trained floating-point model and periodic re-quantization, which adds steps to the training pipeline.
  • Hardware Specifics: While the paper argues these models are ideal for FPGAs, the actual energy and latency gains on specific hardware targets (like a Xilinx or Altera chip) are mentioned as theoretical benefits rather than measured benchmarks in this specific text. Future work could involve direct hardware implementation measurements.

Summary updated

BibTeX
@misc{covell2019table,
  author = {Michele Covell and David Marwood and Shumeet Baluja and Nick Johnston},
  title = {{Table-Based Neural Units: Fully Quantizing Networks for Multiply-Free Inference}},
  year = {2019},
  eprint = {1906.04798},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.04798},
}
Figure