SandHouse
Pages and contents

Neural Interpreter

Field
Value
โ‹ฎโ‹ฎ
Authors
Gonal, Rahaman, et. al.
โ‹ฎโ‹ฎ
Year
2021
โ‹ฎโ‹ฎ
Link / arXiv
https://arxiv.org/pdf/2110.06399
โ‹ฎโ‹ฎ
My relevance (1-5)
4
โ‹ฎโ‹ฎ
Tags
#object #module #composition

Problem

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 stark contrast to the symbolic paradigm, modern machine learning models excel at absorbing large amounts of unstructured data and yield strong performance in many challenging domains, ranging from large-scale image classification to language modelling. However, they are relatively rigid in how they share and reuse computation in order to process information: convolutional neural networks, for instance, process the content of an image at every location to arrive at the class label of a given image. In doing so, they only reuse computational units (here, convolutional filters) laterally at a constant depth i.e., amongst information being processed simultaneously. In the same spirit, recurrent neural networks only reuse computational units (here, RNN cells) vertically, i.e., in depth.

Method

Neural Interpreters factorize a self-attention network as a system of computational units that we call functions. The input to the network is set-valued and processed in the network by a dynamically inferred sequence of functions โ€“ potentially by the same function multiple times, enabling vertical sharing of computational units.

The input of the Neural Interpreter is a set (arbitrary cardinality) of vectors {xi}i,xiโˆˆโ„din, and the output likewise is {yi}i,yiโˆˆโ„din. A Neural Interpreter can be expressed as a stack of ns scripts, where a script maps one set of vectors to another with the same number of elements

{yi}=NeuralInterpreter({xi})=[Scriptnsโˆ˜โ‹ฏโˆ˜Script1]

A script has four components: a type inference module, a type matching mechanism, a set of functions and an interpreter.

Functions

Functions are vector-valued instructions to other components in the script. They implement the computational units that can be reused in the computational graph. A function is a tuple fu=(su,cu) where su is the signature of the function (for typing inference).

Type Matching

The type matching mechanism is responsible for routing information through functions. The truncation parameter controls the amount of sparsity in routing. The type matching performs a cosine similarity between a type ti (computed through the type inference MLP module), and the signature of a function su to determine if f can process x.

ModLin

ModLin layers and the ModMLP can be interpreted as programmable neural modules, where the program is specified by the condition or code vector c.

ModAttn

ModAttn enables interaction between the elements of its input set in multiple parallel streams, one for each function. The query, key, value, and output projectors of each stream are conditioned on the corresponding code vectors, and the interaction between elements in each stream is weighted by their compatibility with the said function.

LOC

A Line of Code (LOC) can be thought of as multiple instances of a layer in the original transformer architecture (comprising a self-attention and a MLP module with residual connections), applied in parallel streams, one per function. Computations therein are conditioned on the respective code and signature vectors.

Interpreter

The interpreter serves as a general-purpose instruction executor (one that is shared between functions). Given a set of inputs and an instruction (here, the function code), it executes said instruction to compute the output.

[image: Screenshot_2026-08-19_at_1.40.08 PM.png]