Skip to main content
QUICK REVIEW

[Paper Review] Dynamic Inference with Neural Interpreters

Nasim Rahaman, Muhammad Waleed Gondal|arXiv (Cornell University)|Oct 12, 2021
Topic ModelingComputer Science47 references9 citations
TL;DR

This paper introduces Neural Interpreters, a self-attention-based architecture that factorizes inference into dynamically routed, reusable computational modules called 'functions'. By learning to compose these functions end-to-end, the model achieves strong systematic generalization and sample-efficient few-shot adaptation, outperforming Vision Transformers on out-of-distribution generalization in visual reasoning tasks while enabling dynamic trade-offs between compute and accuracy at inference time.

ABSTRACT

Modern neural network architectures can leverage large amounts of data to generalize well within the training distribution. However, they are less capable of systematic generalization to data drawn from unseen but related distributions, a feat that is hypothesized to require compositional reasoning and reuse of knowledge. In this work, we present Neural Interpreters, an architecture that factorizes inference in a self-attention network as a system of modules, which we call \emph{functions}. Inputs to the model are routed through a sequence of functions in a way that is end-to-end learned. The proposed architecture can flexibly compose computation along width and depth, and lends itself well to capacity extension after training. To demonstrate the versatility of Neural Interpreters, we evaluate it in two distinct settings: image classification and visual abstract reasoning on Raven Progressive Matrices. In the former, we show that Neural Interpreters perform on par with the vision transformer using fewer parameters, while being transferrable to a new task in a sample efficient manner. In the latter, we find that Neural Interpreters are competitive with respect to the state-of-the-art in terms of systematic generalization

Motivation & Objective

  • To address the limitation of deep neural networks in systematic generalization to out-of-distribution data, especially in compositional reasoning tasks.
  • To relax rigid computation reuse patterns in attention and CNN/RNN architectures by introducing a modular, function-based inference mechanism.
  • To enable sample-efficient few-shot adaptation and post-training capacity extension through reusable, composable computational units.
  • To demonstrate that learned modular computation can support both in-distribution and out-of-distribution generalization in vision and abstract reasoning.
  • To explore the interpretability and learnability of recomposable computational primitives through ablation and visualization.

Proposed method

  • The model factorizes a self-attention network into a system of learnable functions, each acting as a computational module.
  • Inputs are processed as a set of tokens, with a differentiable routing mechanism dynamically selecting and composing functions in sequence.
  • Function application is differentiable and end-to-end trainable, allowing the model to learn which functions to apply and in what order based on input context.
  • The architecture is agnostic to input set size and number of functions, enabling non-disruptive capacity extension by adding new functions after pre-training.
  • The model supports anytime inference by varying the number of function iterations, enabling performance-compute trade-offs at inference time.
  • The method is evaluated on image classification and visual abstract reasoning (Raven’s Progressive Matrices), with comparisons to ViT and other SOTA models.

Experimental results

Research questions

  • RQ1Can a neural architecture learn to dynamically route inputs through a sequence of reusable, modular functions to improve systematic generalization?
  • RQ2Does the modular inductive bias of Neural Interpreters enable better few-shot adaptation and out-of-distribution generalization than standard attention mechanisms?
  • RQ3Can the model gracefully trade off performance with compute by varying the number of function iterations, functioning as an anytime predictor?
  • RQ4Do the learned functions correspond to interpretable, recomposable computational primitives that support compositional reasoning?
  • RQ5How does the model’s performance scale with added capacity (e.g., more functions) after pre-training?

Key findings

  • Neural Interpreters achieved 77.0% test accuracy on the PGM dataset, outperforming the Vision Transformer (72.7% in-distribution, 70.5% test) and the prior SOTA on 4 out of 6 datasets in out-of-distribution generalization.
  • The model maintained over 80% of its original performance when using only half the compute, demonstrating strong anytime inference capability.
  • On the visual reasoning benchmark, Neural Interpreters achieved 91.8% accuracy on the 'Extra.' regime, surpassing the Vision Transformer (92.2% in-distribution, 16.4% test) in out-of-distribution generalization.
  • In few-shot image classification, Neural Interpreters matched ViT performance with fewer parameters and showed strong sample-efficient transfer learning.
  • Ablation studies revealed that a wide range of hyperparameters yielded effective routing, and visualizations showed consistent, interpretable function usage patterns.
  • The model demonstrated non-disruptive capacity extension: new functions could be added and fine-tuned without retraining the entire network.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.