Learning Dynamics of Attention: Human Prior for Interpretable Machine Reasoning

Wonjae Kim, Yoonho Lee

Introduction

In Visual Question Answering (VQA), models are tasked with answering complex questions about images, such as "What color is the cube nearest to the cylinder?" While modern neural networks excel at predicting the correct answer, their internal reasoning processes—specifically how they shift their attention across the image and the question—are often erratic, redundant, and uninterpretable to humans.

Without a "human prior" (a built-in bias toward simplicity), these models tend to learn uninterpretable features or take unnecessarily long reasoning paths. Effective reasoning should ideally follow the Minimum Description Length (MDL) principle, where the best explanation is the shortest one. Researchers from Kakao Corporation address this by introducing DAFT (Dynamics of Attention for Focus Transition), a novel method that treats machine reasoning as a continuous flow rather than a series of discrete jumps.

Methodology: Reasoning as a Continuous Flow

To force a model to reason concisely without losing accuracy, the authors propose modeling the transition of attention as a continuous dynamical system.

Traditional models update attention in discrete, independent steps. In contrast, DAFT utilizes Neural Ordinary Differential Equations (Neural ODEs) to calculate the infinitesimal change of attention at any given timepoint. This mathematical constraint ensures that the transition from one focus area to the next is smooth.

Comparison of discrete attention in MAC versus continuous ODE-based attention in DAFT MAC.

The researchers integrated this approach into the popular MAC (Memory, Attention, and Composition) network, creating DAFT MAC. In this architecture, discrete attention updates are replaced by an ODE solver (such as the Euler method or Dormand-Prince). Because the reasoning is modeled continuously, it is even possible to "pause" the model at fractional timepoints (e.g., step 1.5) to observe focus transitions.

Measuring Efficiency: Total Length of Transition (TLT)

To quantitatively measure the efficiency of a model's reasoning path, the authors introduce a new metric called Total Length of Transition (TLT). TLT uses Jensen-Shannon divergence to quantify how much a model’s focus "drifts" or "wanders" during the reasoning process. A lower TLT indicates a more direct, efficient reasoning path that aligns better with human logic.

Key Results and Insights

The model was evaluated on major benchmarks, including the CLEVR dataset (synthetic multi-step visual reasoning) and GQA (real-world images with compositional questions).

  • Efficiency Gain: DAFT MAC achieved 98.9% accuracy on the CLEVR dataset using only 4 reasoning steps. For comparison, the original vanilla MAC network required 12 steps to reach the same performance. The model implicitly learns to skip unnecessary steps; for instance, if asked about the color of a cube and all cubes share the same color, DAFT jumps straight to the color rather than wasting steps locating a specific cube.
  • Lower TLT and Interpretability: DAFT significantly reduced the Total Length of Transition. On a specific complex question, the vanilla MAC had a TLT of 5.42, while DAFT MAC achieved a TLT of only 1.50.
Attention maps comparing the erratic focus of MAC (TLT: 5.42) with the smooth, concise reasoning of DAFT MAC (TLT: 1.50).

Qualitative visualizations demonstrate that DAFT produces "chunkier" and more logical attention maps. These maps align better with human noun phrases, such as focusing on "shiny cubes" as a single conceptual unit. Furthermore, DAFT produces much more consistent focus progressions across different random seeds, suggesting it captures a more fundamental reasoning logic.

Limitations and Future Work

While DAFT requires fewer reasoning steps, there is a computational overhead. Using sophisticated ODE solvers like Dormand-Prince increases the number of function evaluations, making the model about 2.37x slower per step than the vanilla version. The authors note a trade-off between performance and interpretability, and future work will focus on optimizing this balance. Additionally, they suggest extending DAFT beyond VQA to other domains requiring multi-step reasoning, such as natural language inference or symbolic mathematics.

Summary updated

Abstract

Without relevant human priors, neural networks may learn uninterpretable features. We propose Dynamics of Attention for Focus Transition (DAFT) as a human prior for machine reasoning. DAFT is a novel method that regularizes attention-based reasoning by modelling it as a continuous dynamical system using neural ordinary differential equations. As a proof of concept, we augment a state-of-the-art visual reasoning model with DAFT. Our experiments reveal that applying DAFT yields similar performance to the original model while using fewer reasoning steps, showing that it implicitly learns to skip unnecessary steps. We also propose a new metric, Total Length of Transition (TLT), which represents the effective reasoning step size by quantifying how much a given model's focus drifts while reasoning about a question. We show that adding DAFT results in lower TLT, demonstrating that our method indeed obeys the human prior towards shorter reasoning paths in addition to producing more interpretable attention maps.
BibTeX
@inproceedings{kim2019learning,
  author = {Wonjae Kim and Yoonho Lee},
  title = {{Learning Dynamics of Attention: Human Prior for Interpretable Machine Reasoning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=E1MM47mEgB1},
}
Figure