Work

BCPNNTorch: A PyTorch Simulation Framework for BCPNN-Based Associative Memory

Year: 2026
Type: conference-paper
Abstract: Associative memory is a fundamental capability of intelligent systems, and the Bayesian Confidence Propagation Neural Network (BCPNN) is a well-established model for this mechanism. However, due to its computational complexity, existing implementations typically rely on low-level languages or specialized hardware, limiting accessibility and extensibility. In this work, we present a BCPNN-based associative memory system implemented entirely in PyTorch. We introduce a fan-in reordering algorithm and a Just-In-Time (JIT) optimization strategy to improve computational efficiency. Our implementation achieves real-time simulation in the recall phase (less than 1 ms per step) and up to 4 times improvements on scaling efficiency in the learning phase compared to a CUDA-based baseline. Furthermore, the benefits of event-driven computation are preserved in our framework, yielding up to 37.7 times acceleration in the largest evaluated setting. Built on the Py-Torch ecosystem, our framework significantly improves usability, flexibility, and cross-platform portability, enabling efficient and extensible research on associative memory. Code available at: https://github.com/XiaozeYan/BCPNNTorch.
Language: English
Open Access status: hybrid
OpenAlex ID: W7225850865
FWCI:
Cites:
Cited by:
Related to: 10