Abstract
The Attentive Memory Network (AMN) is a streamlined machine-reading architecture designed to enhance the speed and naturalness of conversational AI. By utilizing a hierarchical encoder and a single-pass memory module, the AMN achieves state-of-the-art reasoning performance on the bAbi tasks while requiring an order of magnitude fewer computational steps than previous iterative memory-based models.
Introduction
In natural conversation, digital assistants must go beyond static indexing to understand the evolving context of a dialogue. For example, if a user states their location history and then asks for the location of an object, the system must "read" and reason over previous statements to provide an accurate answer. This "Machine Reading" task is often computationally expensive in existing models like Dynamic Memory Networks (DMN), which iterate over input sequences multiple times. Such latency can make real-time interactions feel sluggish. The Attentive Memory Network (AMN) addresses this by bridging the gap between high-level reasoning and low-latency requirements.
Methodology
The AMN departs from standard architectures through two primary innovations: a hierarchical input encoder and a single-pass memory module.
Hierarchical Input Encoder
Rather than processing a document as a single long string of words, the AMN uses a two-tier approach. A word-level RNN encodes individual sentences, which are then processed by a sentence-level RNN to create a document representation. This distillation significantly reduces the number of states the memory module must process—for instance, reducing 240 word representations to just 20 sentence representations.
Single-Pass Memory Module
Unlike traditional DMNs that unroll an RNN over the input multiple times for reasoning, the AMN iterates over the input only once. Multiple reasoning steps are performed by applying an attention mechanism over the pre-computed sentence states. Because calculating attention is computationally cheaper than unrolling GRU or LSTM cells, the model is significantly faster.
Evaluation and Results
The model was evaluated on the bAbi 10k tasks, a suite of 20 synthetic datasets testing various aspects of natural language understanding, including deduction, induction, spatial reasoning, and pathfinding.
Key Results
The AMN demonstrated strong performance across the board:
- Task Mastery: It successfully solved 18 out of 20 bAbi tasks (achieving <5% error).
- Competitive Accuracy: Performance is comparable to heavier models such as DMN+ and EntNet.
- Computational Efficiency: The model requires an order of magnitude fewer computation steps than the DMN due to its single-pass reading approach.
Insights and Discussion
The AMN highlights that complex reasoning does not necessarily require re-reading text. By separating encoding from attention-based memory steps, the model achieves high performance without a linear time penalty. Furthermore, the hierarchical encoder helps the model focus by providing a distilled view, making the attention mechanism less susceptible to noise from individual words.
Visualization of the model's attention reveals that success correlates with "sharp" focus on key sentences, while failure often involves "blurry" attention spread across the document. Additionally, the AMN exhibits rapid convergence, reaching peak performance in as few as 5 epochs on some tasks.
Limitations and Future Work
Despite its successes, the AMN struggled with two specific tasks: Basic Induction and Three Supporting Facts. In the induction task, the model had difficulty generalizing rules from specific examples. In the "Three Supporting Facts" task, which involves documents exceeding 100 sentences, the attention mechanism struggled to maintain focus over long sequences. Future work may involve developing richer attention mechanisms capable of tracking multiple actors and maintaining dialogue state in more complex, real-world scenarios.
Summary updated