Abstract
Memory-Augmented Neural Networks (MANNs) are highly effective for complex Natural Language Processing (NLP) tasks but are difficult to deploy on edge devices due to complex data paths and computational bottlenecks in the output layer. This paper introduces a specialized FPGA-based accelerator that utilizes a streaming dataflow architecture and a speculative "inference thresholding" technique. The proposed system achieves up to 140x better energy efficiency and approximately 7x faster inference than high-end GPUs, making complex question-answering models viable for low-power mobile environments.
Introduction
MANNs utilize an external memory component to store and retrieve information, making them ideal for reasoning tasks like question-answering. However, standard CPU and GPU architectures struggle with MANNs due to recurrent data loops and the energy-intensive Maximum Inner Product Search (MIPS) required for large vocabulary outputs. To address these challenges, we propose a hardware-software co-design approach that optimizes both the data movement and the underlying algorithm for streaming execution.
Hardware-Software Co-Design
The core of the proposed system is a modular Dataflow Architecture (DFA) implemented on a Field-Programmable Gate Array (FPGA). Unlike traditional architectures that rely on frequent memory fetches, the DFA allows data to stream directly between specialized processing elements, minimizing memory-access overhead.
The accelerator is divided into four primary modules:
- INPUT & WRITE: Manages word embeddings.
- MEM: Handles external memory operations.
- READ: Contains the RNN-based controller.
- OUTPUT: Executes the final classification.
To mitigate the output bottleneck, we introduce Inference Thresholding (ITH). This technique uses pre-calculated thresholds to allow for "early exits" during the MIPS process. If a calculated logit exceeds its threshold, the system immediately returns the result, skipping remaining computations. This is further optimized by Efficient Index Ordering, which sorts output classes based on their distinctness (using silhouette coefficients) to maximize the probability of an early exit.
Experimental Evaluation
The system was evaluated using the bAbI dataset, a standard benchmark for question-answering reasoning across 20 distinct tasks. Performance and energy efficiency were compared against high-end hardware, including an NVIDIA TITAN V GPU and an Intel i9 CPU.
Results and Discussion
The FPGA implementation demonstrated remarkable gains in energy efficiency, ranging from 126x to 140x (measured in FLOPS/kJ) compared to the GPU. In terms of raw speed, the accelerator outperformed the GPU by 5.2x to 7.5x and the CPU by up to 8.0x.
The integration of Inference Thresholding provided an additional 6% to 18% reduction in inference time with negligible impact on accuracy. Analysis revealed that as clock speeds increased, the primary bottleneck shifted from computation to the host-FPGA communication interface (PCIe/FIFO), suggesting that tighter system integration could yield even higher performance.
Conclusion
Streaming MANN demonstrates that hardware-algorithm synergy is key to bringing advanced neural models to the edge. By tailoring the inference process to a streaming dataflow and employing speculative execution, we achieve orders-of-magnitude improvements in energy efficiency. Future work will focus on scaling these techniques to larger vocabularies and adapting the architecture for other emerging models like Transformers.
Summary updated