Quantized Memory-Augmented Neural Networks

Seongsik Park, Sei Joon Kim, Seil Lee, Ho Bae, Sungroh Yoon

Abstract

Memory-Augmented Neural Networks (MANNs) provide powerful reasoning capabilities by decoupling computation from external memory, but their high energy requirements hinder deployment on edge devices. Traditional quantization techniques, which reduce numerical precision to save power, typically fail for MANNs due to the extreme sensitivity of content-based addressing. This paper introduces Q-MANN, a framework that replaces fragile cosine similarity with a robust, bounded Hamming-based similarity measure. Q-MANN achieves a 22x reduction in energy consumption while significantly outperforming standard quantization methods on reasoning tasks. Our results demonstrate that ensuring boundedness in similarity measures is critical for stabilizing low-precision training in memory-augmented architectures.

Introduction

Memory-Augmented Neural Networks, such as Neural Turing Machines, excel at solving complex, long-sequence tasks that challenge standard Recurrent Neural Networks (RNNs). However, the computational cost of managing large external memories makes them difficult to deploy on smartphones or embedded sensors. While quantization—reducing precision from 32-bit floats to 8-bit integers or binary—has been highly successful for Convolutional Neural Networks (CNNs), it has historically led to total breakdown in MANNs.

The Challenge: The Softmax Trap and Overflow

The researchers identified two primary reasons for the failure of standard quantization in MANNs:

  1. The Softmax Trap: In content-based addressing, output error is proportional to the exponent of the input error. Small rounding errors in quantized vectors are amplified by dot products and then exponentially increased by the softmax function, derailing the learning process.
  2. Catastrophic Overflow: In fixed-point arithmetic, intermediate similarity calculations frequently exceed representable values (overflow). In a MANN, even occasional overflows can completely corrupt memory retrieval.

The Q-MANN Framework

Q-MANN is designed to survive the noise of low-precision computation through several architectural innovations:

  • Bounded Hamming Similarity: Instead of cosine similarity, Q-MANN uses a weighted Hamming similarity. This counts bit-matches between quantized vectors, providing a score that is naturally bounded and far more robust to quantization errors.
  • Differentiable Approximation: To enable training via standard gradient descent, the authors developed a smoothed, differentiable version of the normally discrete Hamming distance.
  • Memory Controller Quantization (MQ): To prevent deterministic errors from accumulating over time in the RNN controller, quantization parameters are varied slightly at each step, allowing errors to effectively cancel each other out.
  • Hardware-Friendly Operations: The similarity measure is redesigned to use simple bitwise XNOR, shifts, and additions, which are significantly more energy-efficient than floating-point multiplications.

Experimental Evaluation

The framework was evaluated using the bAbI dataset (10k version), a benchmark for synthetic reasoning and question-answering.

Stability analysis of similarity distributions (A-D) and error rates (E-H) across various fixed-point quantization levels. Q-MANN maintains stability and low error rates at higher bit-widths (Q5.7, Q5.4) but shows the limits of extreme quantization (Q2.7).

As shown in the figure above, the similarity distributions remain relatively stable at moderate quantization levels (Q5.7 and Q5.4), allowing the model to maintain low error rates. However, as precision is aggressively reduced (Q2.7), the similarity distribution collapses, and the error rate increases significantly, illustrating the inherent trade-offs in quantization.

Key Results

  • Energy Efficiency: Q-MANN achieved a 22.25x computation-energy gain using 8-bit fixed-point parameters and binary activations compared to 32-bit floating-point baselines.
  • Superior Accuracy: On the bAbI dataset, Q-MANN reduced error rates by 46% for 8-bit fixed-point models compared to standard MANNs quantized with conventional methods.
  • Robustness: While naive 8-bit quantization caused error rates to skyrocket by over 160%, Q-MANN maintained performance close to the high-precision baseline.

Conclusion

Q-MANN demonstrates that MANNs can be effectively quantized for low-power hardware by addressing the specific sensitivities of their memory-addressing mechanisms. By switching to a bounded similarity measure, the authors "tamed" gradient variance and enabled stable low-precision training. Future work will focus on scaling these techniques to more complex, real-world datasets and implementing the architecture on physical FPGA or ASIC hardware to measure real-world speedups.

Summary updated

BibTeX
@inproceedings{park2018quantized,
  author = {Seongsik Park and Sei Joon Kim and Seil Lee and Ho Bae and Sungroh Yoon},
  title = {{Quantized Memory-Augmented Neural Networks}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2018},
  doi = {10.1609/aaai.v32i1.11704},
}
Figure