Introduction
While deep learning has achieved remarkable success in pattern recognition, complex relational reasoning—the ability to infer relationships between disparate entities and facts—remains a significant hurdle. Existing architectures typically fall into two categories: Memory Networks (MemNNs), which excel at efficient information retrieval but lack sophisticated reasoning components, and Relation Networks (RNs), which possess strong reasoning capabilities but suffer from quadratic computational complexity ($O(n^2)$) relative to the number of input objects.
Working Memory Networks (W-MemNN) bridge this gap. By integrating an attentional memory architecture with a Relation Network module, the authors propose a model that maintains the reasoning power of RNs while achieving the linear computational efficiency ($O(n)$) of MemNNs.
The W-MemNN Architecture
The W-MemNN architecture is inspired by the multi-component model of working memory from cognitive science. It consists of four primary modules that work in concert to process and reason over information.
- Input Module: A Gated Recurrent Unit (GRU) encodes perceptual inputs, such as sentences or image features, into vector representations. These are stored in a "short-term storage" area.
- Attentional Controller: Acting as a filter, this module uses multi-head attention to perform multiple "hops" over the short-term storage. Each hop generates a summary vector representing the most relevant information for the current query.
- Working Memory Buffer: This novel component stores the summary vectors produced during every attention hop. This buffer acts as a workspace for active "thoughts" or relevant facts extracted from the larger memory.
- Reasoning Module: A Relation Network operates exclusively on the contents of the Working Memory Buffer.
Efficiency through Sparsity
The core innovation of W-MemNN lies in its approach to computational complexity. Standard Relation Networks compare every pair of $n$ input objects, leading to an $O(n^2)$ bottleneck. In contrast, the W-MemNN uses the Attentional Controller to filter $n$ memories down to a small, constant number of $H$ hops stored in the buffer. The reasoning module then processes only these $H$ vectors. This reduction ensures that the quadratic cost is applied to a tiny constant, resulting in an overall complexity that scales linearly with the input size.
Experimental Evaluation
The model was evaluated on two challenging benchmarks: the bAbI-10k synthetic text QA dataset and the Natural Language for Visual Reasoning (NLVR) dataset.
bAbI-10k Reasoning
On the jointly trained bAbI-10k tasks, where a single model must solve 20 different reasoning types simultaneously, W-MemNN achieved a state-of-the-art mean error of less than 0.5%. An ensemble of two models was able to solve all 20 tasks perfectly. Furthermore, wall-clock tests showed that for a batch of 30 memories, W-MemNN was approximately 20 times faster than a standard Relation Network.
Visual Reasoning (NLVR)
In visual reasoning tasks, the model achieved 65.8% accuracy on NLVR. This performance is comparable to specialized "Module Neural Networks" but without the need for complex linguistic parsing or expensive pre-processing. The model's ability to focus on specific spatial relationships is visualized through its attention mechanism.
Conclusion
Working Memory Networks demonstrate that attention mechanisms can serve as powerful sparsity filters, making expensive relational reasoning computationally viable for large-scale problems. By mimicking the structure of human working memory, the W-MemNN provides a scalable framework for multi-step inference across both textual and visual modalities.
Summary updated