Learning to Reason With Adaptive Computation

Mark Neumann, Pontus Stenetorp, Sebastian RiedelarXiv 2016 · OpenReview

Abstract

Multi-hop inference is necessary for machine learning systems to successfully solve tasks such as Recognising Textual Entailment and Machine Reading. In this work, we demonstrate the effectiveness of adaptive computation for learning the number of inference steps required for examples of different complexity and that learning the correct number of inference steps is difficult. We introduce the first model involving Adaptive Computation Time which provides a small performance benefit on top of a similar model without an adaptive component as well as enabling considerable insight into the reasoning process of the model.

Introduction

In tasks like Recognising Textual Entailment (RTE) or Natural Language Inference (NLI), a model must determine if a hypothesis logically follows from a premise. Simple entailment problems might only require a single logical step, whereas complex problems involving co-reference resolution or lexical ambiguity require multi-step, temporally dependent reasoning—breaking the problem down and recombining facts.

Existing multi-hop neural networks typically execute a fixed number of inference steps for all inputs. This is computationally wasteful for simple examples and potentially restrictive for complex ones. This paper introduces a model that applies Adaptive Computation Time (ACT) to an iterative attention mechanism, allowing the network to dynamically learn exactly how many inference steps are needed for a given problem, improving both interpretability and efficiency.

Methodology

The proposed model builds upon Decomposable Attention (DA) and Iterative Alternating Attention models, incorporating a dynamic halting mechanism.

Iterative Alternating Attention

The model utilizes Bag-of-Words (BOW) encoders to represent the premise and hypothesis. It then uses an inference Gated Recurrent Unit (GRU) to iteratively attend over these representations, building up a representation over multiple "hops."

Adaptive Computation Time (ACT)

The core novelty is applying ACT to the inference GRU. Instead of running the GRU for a hardcoded number of steps, ACT acts as a nearly differentiable while loop. At each step, a neural layer calculates a "halting probability." The model continues to loop and accumulate these probabilities until they reach a threshold (1 minus a small epsilon). To prevent infinite loops, a "Ponder Cost" is added to the loss function, penalizing the network for excessive computational steps. The final output is a weighted sum of the intermediate states based on their halting probabilities.

Results and Analysis

The Adaptive Attention model achieved 82.7% accuracy on the SNLI test set. While this implementation fell short of the 86.3% reported in the original DA paper, it outperformed fixed-step variants of the exact same architecture: 2 fixed steps (76.2%), 4 fixed steps (81.7%), and 8 fixed steps (81.0%). On average, the model utilized 5 steps at inference time, demonstrating improved efficiency over high-fixed-step models.

Interpretability and Reasoning

Visualizations of the model's internal states provide significant insight into the reasoning process. As shown in Figure 1, the model shifts its focus across different parts of the sentences over time, confirming a sequential reasoning chain. Furthermore, once the model identifies the key information needed to solve the entailment, it assigns a high weight to the halting probability, effectively learning to stop immediately once the answer is found.

Visualization of the reasoning process across 6 steps, showing attention shifts, halting probabilities, and class distribution.

Discussion and Limitations

Despite the benefits, the authors noted a performance plateau, possibly due to artifacts in the SNLI dataset where simple bag-of-words overlap is often highly discriminatory, reducing the measurable benefit of complex multi-hop reasoning. Additionally, the "Ponder Cost" hyperparameter proved highly sensitive and context-dependent, making it difficult to tune correctly. Future work may involve exploring alternative regularization methods or investigating whether combinations of states might better calculate halting probabilities.

Summary updated

BibTeX
@misc{neumann2016learning,
  author = {Mark Neumann and Pontus Stenetorp and Sebastian Riedel},
  title = {{Learning to Reason With Adaptive Computation}},
  year = {2016},
  eprint = {1610.07647},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1610.07647},
}
Figure