Abstract
Associative memories store content in such a way that the content can be later retrieved by presenting the memory with a small portion of the content, rather than presenting the memory with an address as in more traditional memories. Associative memories are used as building blocks for algorithms within database engines, anomaly detection systems, compression algorithms, and face recognition systems. A classical example of an associative memory is the Hopfield neural network. Recently, Gripon and Berrou have introduced an alternative construction which builds on ideas from the theory of error correcting codes and which greatly outperforms the Hopfield network in capacity, diversity, and efficiency. In this paper we implement a variation of the Gripon-Berrou associative memory on a general purpose graphical processing unit (GPU). The work of Gripon and Berrou proposes two retrieval rules, sum-of-sum and sum-of-max. The sum-of-sum rule uses only matrix-vector multiplication and is easily implemented on the GPU. The sum-of-max rule is much less straightforward to implement because it involves non-linear operations. However, the sum-of-max rule gives significantly better retrieval error rates. We propose a hybrid rule tailored for implementation on a GPU which achieves a 880-fold speedup without sacrificing any accuracy.
Introduction
Traditional computer memory operates on an address-based paradigm: to retrieve data, one must provide its specific location. In contrast, associative memory retrieves information based on content. By presenting a partial or noisy "probe," the system can reconstruct the complete original message. This functionality is critical for applications ranging from face recognition to anomaly detection.
While the Hopfield network has long served as the standard model for associative memory, it is limited by low storage capacity and poor computational efficiency. The Gripon-Berrou Neural Network (GBNN) offers a superior alternative by leveraging principles from error-correcting codes. However, GBNNs are computationally intensive, and previous hardware implementations were restricted to small-scale networks. This work addresses the scalability challenge by implementing GBNNs on massively parallel GPU architectures.
The Gripon-Berrou Architecture
GBNNs are structured as sparse neural networks where neurons are organized into distinct clusters. Each message is stored as a "clique"—a set of connections between neurons across different clusters. This clustered approach allows the network to store a significantly higher number of messages than a traditional Hopfield network of the same size.
Retrieval Strategies and GPU Optimization
The retrieval process in a GBNN involves identifying which neurons in the network were part of the original message based on a partial probe. The authors examine two primary rules and propose a third:
- SUM-OF-SUM: This rule treats retrieval as a series of matrix-vector multiplications. While highly compatible with GPU hardware, it is prone to convergence errors and "traps."
- SUM-OF-MAX: This non-linear rule is significantly more accurate but computationally expensive due to irregular memory access patterns.
- The Joint Retrieval Scheme: This novel hybrid approach uses a single iteration of SUM-OF-SUM to rapidly prune the search space, followed by an optimized version of SUM-OF-MAX called BAIL-OUT-EARLY. This optimization allows the GPU to skip unnecessary memory reads once a cluster's contribution is confirmed.
To achieve maximum throughput, the implementation utilizes Batch Retrieval, processing thousands of queries simultaneously, and Parallel Reduction to check for network convergence in logarithmic time.
Results
The GPU-based GBNN was tested against a high-performance CPU implementation using optimized C++ libraries. The results demonstrate a massive 880-fold speedup in retrieval time.
In large-scale tests involving 8,192 neurons and 50,000 stored messages, the system achieved 100% retrieval accuracy even when 13 out of 16 symbols were missing from the probe. Unlike previous FPGA-based solutions limited to small networks, this GPU implementation scales effectively to thousands of neurons, making it viable for real-world machine learning tasks.
Conclusion and Future Work
By aligning the GBNN retrieval algorithm with the parallel strengths of GPU hardware, this work removes the primary barrier to using high-capacity associative memories at scale. Future research will focus on adapting these rules for corrupted data (bit-flips) rather than just erasures (missing data) and exploring the application of GBNNs in broader classification and regression tasks.
Summary updated