Iteratively Training Look-Up Tables for Network Quantization

Fabien Cardinaux, Stefan Uhlich, Kazuki Yoshiyama, Javier Alonso García, Lukas Mauch, Stephen Tiedemann, Thomas Kemp, Akira Nakamura

TL;DR

The paper introduces Look-Up Table Quantization (LUT-Q), a highly flexible framework that compresses deep neural networks by jointly learning a value dictionary and an assignment matrix for network weights. By unrolling a single k-means clustering step into standard gradient descent training, LUT-Q seamlessly unifies non-uniform quantization, pruning, and multiplierless network design into a single optimization process.

What Problem Does This Paper Address?

Deploying state-of-the-art deep neural networks (DNNs) on edge devices (like smartphones, wearables, or embedded sensors) is heavily bottlenecked by memory and computational constraints. Traditional approaches to alleviate this include pruning (removing unimportant weights) and quantization (reducing the bit-width of weights and activations).

However, existing quantization methods often rely on rigid, predefined uniform intervals (like fixed-point integers) or separate, multi-stage pipelines that decouple clustering from network training. This rigidity leads to severe accuracy degradation at ultra-low bitwidths (e.g., 2-bit or 1-bit weights). The authors address this gap by proposing a unified, flexible framework that adapts the quantization values dynamically during training to fit the network's actual weight distribution.

Methods

The core idea behind LUT-Q is to represent a weight matrix $W$ as a combination of a learned value dictionary $d \in \mathbb{R}^K$ and an assignment matrix $A$, where each entry in $A$ points to an index in $d$.

Proposed look-up table quantization scheme.

To train this system without massive computational overhead, the authors introduce a novel training scheme:

  1. Iterative K-Means Unrolling: Instead of running k-means to convergence at every step, they perform just one k-means update step per mini-batch forward pass. This dynamically updates both the dictionary and assignments on the fly.
  2. Straight-Through Estimator (STE): Because the look-up operation is non-differentiable, gradients are computed with respect to the quantized weights but applied directly to full-precision copy weights during the backward pass.

Extreme Flexibility

By simply changing constraints on the dictionary $d$ or assignment matrix $A$, LUT-Q can morph into different compression techniques:

  • Pruning: Forcing the first element of the dictionary to be zero ($d_1 = 0$) allows the network to simultaneously prune and quantize weights.
  • Multiplierless Networks: Constraining the dictionary elements to powers-of-two ($\pm 2^b$) turns expensive multiplications into cheap bit-shift operations.
  • Multiplierless Batch Normalization (BN): Standard BN layers still require multiplications even if the weights are quantized. The authors introduce a multiplierless BN variant that quantizes the BN scale factors to powers-of-two during inference, enabling entirely multiplierless pipelines.

Datasets

The authors evaluated LUT-Q across multiple domains and scales:

  • Image Classification: CIFAR-10 and ImageNet (ILSVRC-2012) using ResNet architectures.
  • Object Detection: Pascal VOC using a modified YOLOv2 framework.
  • Automatic Speech Recognition (ASR): Wall Street Journal (WSJ) acoustic modeling dataset using a wide, fully connected DNN.

Key Insights and Ideas

  • Dynamic Dictionaries Matter: Learning the quantization thresholds dynamically (non-uniform quantization) prevents the massive accuracy drops typically seen in fixed uniform quantization at ultra-low bitwidths.
  • One Step is Enough: You don't need full k-means convergence during training. A single k-means step per mini-batch is sufficient because full-precision weights change slowly across iterations.
  • The Activation Bottleneck: When weights are aggressively quantized (e.g., to 2 bits), the memory footprint of the activations (the intermediate layer outputs) begins to dominate the hardware buffer. Quantizing activations to uniform 8-bit provides a massive 4x buffer reduction with virtually zero loss in accuracy.

Key Results

Fixed vs. Learned Quantization (CIFAR-10)

On ResNet-20, compressing weights to 2 bits using standard fixed-point uniform quantization caused the validation error to spike to 12.72%. In contrast, power-of-two constrained LUT-Q achieved an error rate of 8.02%, remaining remarkably close to the full-precision baseline of 7.42%.

Simultaneous Pruning and Quantization

As shown in the pruning evaluation, LUT-Q can prune up to 70% of network weights simultaneously with quantization without experiencing significant performance drops.

Validation error for LUT-Q with pruning on CIFAR-10.

Large-Scale ImageNet Performance

For ResNet-50 on ImageNet, a 2-bit weight / 8-bit activation configuration trained with LUT-Q achieved a top-1 error rate of 26.92% (only 1.05% worse than the full-precision baseline). Crucially, this compressed the model's memory footprint from 97.5 MB down to just 7.35 MB while reducing multiplications by two orders of magnitude.

Limitations and Future Work

  • Scaling to Massive Layers: For exceptionally wide layers (as seen in the WSJ speech dataset), running the k-means assignment step can slow down training. The authors bypassed this by updating the dictionary only every 50 mini-batches for that specific task.
  • Uniform Activations: While weights were non-uniformly quantized, activations were still quantized using a uniform grid. The authors note that extending non-uniform, learned quantization to activations is a promising avenue to unlock even lower bitwidths (e.g., 4-bit or 2-bit activations).
  • Distillation: The authors plan to combine LUT-Q with knowledge distillation strategies to further close the accuracy gap for ultra-low bitwidth models.

Summary updated

BibTeX
@article{cardinaux2020iteratively,
  author = {Fabien Cardinaux and Stefan Uhlich and Kazuki Yoshiyama and Javier Alonso García and Lukas Mauch and Stephen Tiedemann and Thomas Kemp and Akira Nakamura},
  title = {{Iteratively Training Look-Up Tables for Network Quantization}},
  journal = {IEEE J. Sel. Top. Signal Process.},
  year = {2020},
  url = {https://openreview.net/forum?id=o7qZL6hovZc},
}
Figure