Ordered Memory.

Yikang Shen, Shawn Tan, Seyed Arian Hosseini, Zhouhan Lin, Alessandro Sordoni, Aaron C. Courville

TL;DR

This paper introduces "Ordered Memory" (OM), a novel neural network architecture designed to improve the training and performance of memory-based models, particularly for tasks requiring compositional understanding. OM addresses the difficulty of training memory models by introducing a new attention mechanism for controlled memory writing/erasing and a Gated Recursive Cell for hierarchical representation composition, achieving strong results on logical inference and list manipulation tasks.

What Problem Does This Paper Address?

The paper tackles a long-standing challenge in natural language processing: building models that can understand complex, unseen expressions by composing the meaning of simpler, known ones. While recurrent neural networks (RNNs) have shown success in many areas, they struggle with tasks that explicitly require compositional reasoning. Existing memory-augmented RNNs, while promising, often face training difficulties, hindering their widespread adoption. A key issue is the challenge of learning the underlying structure and composition rules from data alone, a problem related to grammar induction. The authors aim to improve the ability of neural networks to learn and exploit these compositional structures, drawing inspiration from how humans process language.

Methods

The core contribution is the Ordered Memory (OM) architecture. It builds upon the idea of stack-augmented RNNs but introduces two key innovations:

  • Ordered Neurons-inspired Memory Update: Instead of simple push/pop operations, OM uses an attention-based mechanism. This mechanism leverages a cumulative probability to precisely control the writing and erasing of information in memory slots. This is designed to prevent the "blurring" of memory states that can plague other continuous stack models.
  • Gated Recursive Cell: To compose representations hierarchically, OM introduces a new Gated Recursive Cell. This cell is inspired by the feed-forward layers of Transformers and is used to combine lower-level representations into higher-level ones, forming a binary computation graph.

The model processes input sequentially, maintaining a memory of candidate sub-trees. At each time step, it uses the current input to select and update these candidate sub-trees, effectively building a hierarchical structure. The paper also details a "masked attention" mechanism and a "gated recursive cell" for these operations.

Datasets

The paper evaluates OM on several benchmark datasets:

  • Logical Inference (Bowman et al., 2015): A task involving six words and three logical operations, requiring classification of relationships between logical clauses. The paper also uses variations of this dataset for systematic generalization tests.
  • ListOps (Nangia and Bowman, 2018): A dataset of nested operations on lists of digits, designed to test parsing and compositional understanding.
  • Stanford Sentiment Treebank (SST): Used for both binary (SST-2) and fine-grained (SST-5) sentiment classification, evaluating the model's performance on a more standard NLP task.

Key Insights and Ideas

  • Controlled Memory Operations are Crucial: The paper highlights that the difficulty in training memory models stems from how information is written and erased. OM's attention-based cumulative probability mechanism for controlled memory updates is a key differentiator, preventing memory "blurring" and improving trainability.
  • Hierarchical Composition with a Gated Cell: The introduction of a new Gated Recursive Cell, inspired by Transformer architectures, allows for more effective composition of representations, leading to a binary computation graph that mirrors hierarchical structures.
  • Interpretability through Induced Trees: A significant finding is that OM can recover latent tree structures that align well with ground truth, offering a degree of interpretability and demonstrating its ability to learn compositional rules.
  • Data Efficiency: OM shows promising data efficiency, particularly on the ListOps task, achieving high accuracy even with significantly smaller training sets compared to some baselines.

Key Results

  • Logical Inference: OM achieves strong performance on the logical inference task, demonstrating effective generalization to unseen combinations of operators and longer sequences. It significantly outperforms other sequential models on systematic generalization tests, performing comparably to models with known tree structures.
  • ListOps: OM achieves near-perfect accuracy (99.9%) and a 100% F1 score on its induced parse trees for ListOps, outperforming many baselines and showing strong data efficiency.
  • Stanford Sentiment Treebank: OM achieves performance comparable to state-of-the-art models on both SST-2 and SST-5, demonstrating its versatility beyond purely structural tasks.
  • Parsing Performance: The model's ability to infer latent tree structures is validated, with induced structures being valid computation graphs for the task.

Limitations and Future Work

  • Limitations: The paper notes that models with known tree structures (like TreeRNN and TreeCell) still outperform OM on some systematic generalization tests, suggesting that explicit knowledge of structure can be advantageous. The authors also mention that training Transformer models on the logical inference task proved difficult, suggesting potential challenges with self-attention mechanisms for this specific task.
  • Future Work: The paper implies that the interpretability of the induced tree structures is a promising avenue for future research, potentially for tasks like latent tree induction. The success on various tasks suggests OM could be applied to a broader range of NLP problems requiring compositional understanding.

Summary updated

BibTeX
@inproceedings{shen2019ordered,
  author = {Yikang Shen and Shawn Tan and Seyed Arian Hosseini and Zhouhan Lin and Alessandro Sordoni and Aaron C. Courville},
  title = {{Ordered Memory.}},
  booktitle = {NeurIPS},
  year = {2019},
  url = {https://openreview.net/forum?id=chH2sQtzZPeV},
}
Figure