Latent Attention Networks

Christopher Grimm, Dilip Arumugam, Siddharth Karamcheti, David Abel, Lawson L. S. Wong, Michael L. LittmanarXiv 2017

Introduction

Deep neural networks are often criticized as "black boxes" because their decision-making processes are opaque. While they achieve state-of-the-art performance, understanding why a model succeeds or fails is crucial for safety and reliability. Traditional interpretability methods are frequently tied to specific architectures, such as Convolutional Neural Networks (CNNs). However, many models lack explicit attention mechanisms.

Researchers have introduced Latent Attention Networks (LANs), a model-agnostic framework designed to extract and visualize the internal prioritization of input features—what the authors call "latent attention." By identifying which parts of an input are critical to a model's output, LANs provide a window into the hidden logic of any pre-trained neural network.

The LAN Framework

The core principle behind LANs is selective replaceability: if a portion of the input can be replaced with noise without altering the model's prediction, that portion is deemed irrelevant to the model's decision.

Figure 1: The Latent Attention Network architecture. An auxiliary network $A$ generates a mask $A(x)$ to blend input $x$ with noise $\eta$, producing a corrupted input $\tilde{x}$ for the target model $F$.

As shown in Figure 1, the architecture consists of:

  1. Auxiliary Network ($A$): Takes input $x$ and generates a mask $A(x)$ of the same dimensions.
  2. Corruption Process: The mask determines how the input is blended with noise ($\eta$). Values near 1 in the mask indicate areas to be replaced by noise, while values near 0 preserve the original signal.
  3. Dual-Objective Loss: The LAN is trained to maximize fidelity (ensuring $F(\tilde{x}) \approx F(x)$) while also maximizing sparsity (encouraging the mask to cover as much of the input as possible). A hyperparameter $\beta$ controls the trade-off, effectively acting as a "zoom" lens for the level of detail in the attention map.

To maintain the corrupted input near the data manifold, the authors utilize "bootstrapped noise"—random samples from the training set—rather than simple Gaussian noise.

Experimental Evaluation

The LAN framework was tested across diverse modalities and datasets, including Translated MNIST (digits placed randomly in a larger field), CIFAR-10 and ImageNet (object recognition), and Newsgroup-20 (natural language processing). It was also applied to a "Synthetic Tank Detection" dataset designed to reveal spurious correlations, such as a model detecting "clouds" instead of "tanks."

Key Insights: The Localization Grid

One of the most striking findings occurred with the Translated MNIST dataset. The LAN revealed that the classifier did not just look for digits anywhere in the frame; instead, it developed a "latent localization grid."

Figure 6: LAN masks for Translated MNIST. The heatmaps reveal a grid-like structure where the model expects to find features, explaining why accuracy drops when digits fall into the "gaps."

As illustrated in Figure 6, the model focuses on specific regions. If a digit is placed in a "gap" between these grid points, the model's accuracy drops significantly. This demonstrates the LAN's ability to predict model failure by visualizing its internal spatial expectations.

Diagnostic and Scalability Results

Beyond spatial grids, LANs offer significant diagnostic power. In the "tank detection" experiment, the LAN mask ignored the tank entirely and focused on the clouds, confirming that the model had learned a "Clever Hans" shortcut. For complex images like those in CIFAR-10, the masks highlighted class-specific features, such as the legs of a deer or the hull of a ship, rather than the entire object.

The method also scales effectively. On ImageNet, LANs generated detailed, contour-like attention maps for high-resolution images, proving the framework's utility for large-scale, real-world applications.

Conclusion

Latent Attention Networks provide a flexible, modality-agnostic tool for neural network interpretation. While powerful, the method's effectiveness depends on the choice of noise distribution and involves the computational cost of training an auxiliary network. Future work may explore more expressive LAN architectures, such as CNNs for image-based masks, to further refine these interpretable visualizations.

Summary updated

BibTeX
@misc{grimm2017latent,
  author = {Christopher Grimm and Dilip Arumugam and Siddharth Karamcheti and David Abel and Lawson L. S. Wong and Michael L. Littman},
  title = {{Latent Attention Networks}},
  year = {2017},
  eprint = {1706.00536},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1706.00536},
}
Figure