Venue: NeurIPS 2021 Conference

Reviews:

final_score: rating: 8: Top 50% of accepted NeurIPS papers, clear accept
review_content: summary: This paper proposes a method for modularizing neural networks inspired by programming functions and compilation. Building on the success of attention and transformer architectures, the neural interpreter (NI) proposes a new architecture built on layered functions, each of which is composed of stacked MLP and attention layers. Functions and input variables both have embeddings, called “signature and type” respectively, that allow NIs to learn specialized functions that operate over a subset of inputs. The NI is applied to a suite of image datasets as well as to Raven matrices, where it is shown to outperform vision transformers.
main_review: Originality: 
The idea is very creative and presents a scalable, continuous approximation to modular components in a neural network. In particular, I found the joint mapping of functions and inputs in an embedding space to an insightful idea that theoretically enables the neural network to compartmentalize information and reuse computation. Overall, I enjoyed the analogy to code interpreters and found the presentation compelling. My primary concern from a modeling perspective is that it was not clear to me why functions are encouraged to specialize to specific inputs e.g. there is not objective encouraging disentanglement or diversity, so why should the functions not all learn similar, or overlapping things -- which would limit the modularity and reusability of the network. 

Quality/Significance: 
The experiments did a good job demonstrating promising results for the NI, although improvements can be made. For instance, in the toy experiment in 4.1, it would be nice to see adaptability to held-out base operations (e.g. XOR). In 4.2, I would like to also compare NI and VTs through more naturalistic images. Consider exploring the Meta-dataset as a collection of realistic images. I would have also liked to see more evidence in Figure 5 on functions learned in pretraining being reused, or more analysis in section 4.3 on why NI is outperformed by WReN in the Attribute P. and Triples datasets.

Clarity: 
Very clear writing. The authors do a good job of describing a complex system clearly. I appreciate explicitly denoting changes in notation (e.g. line 123-125), and sentences in Section 2 explaining roles. 

Questions about Section 2:
- Line 73: are the image embeddings learned as well? Or pretrained?
In functions, it seems like you want to disentangle information between the code vector and the type vector. How do you ensure the type vector captures no information about the code and vice versa?
- In type matching, you want to have function signatures and element types “cluster” naturally such that some functions specialize to some types, etc. To my understanding though, it seems like nothing prevents all the type vectors and function signatures from being close to each other such that all functions have access to all types. Where is diversity / sparsity being enforced? A related question: how do you prevent two functions from learning the same thing?
- How do you choose tau? If it is too high, I imagine learning will be very slow as C_{u,i} will be 0 for most matches. But at the same time, you want tau to be big in order to specialize functions (i.e., so that functions don’t take everything as input). 
- Do you enforce type embeddings and signature embeddings to live in a compact space (e.g. surface of a hypersphere?), otherwise I imagine you could have issues with unbounded vector magnitudes in training.
ModLin and ModMLP remind me a lot of FiLM (Perez et. al.). Might be worth citing or comparing against.
- Conditioning attention networks (transformers) on vectors has been studied in the past: popular methods include an adapter network (Houlsby et. al.), FiLM, and a simple task token (TAM, Logeswaran et. al.). I’m curious how ModAttn compares to these. 
- When adding a new function (line 158), do you need to finetune old functions or can you keep them fixed? I could see this either way since existing functions might “take up most of the area in the embedding space”, it becomes harder to add new functions without moving around old functions to make space.
- I might have missed this but are the conditioning vectors c_u learned? If so, how? Through a network? What are the inputs it gets?
- Is it possible to come up with a synthetic example of something the neural interpreter can easily capture with its architecture that stacked transformer layers cannot? This would help me clarify when the interpreter should be superior, and why.

Questions on Section 3:
- Consider adding a citation to Neural Event Semantics (Buch et. al.) in the related work.

Questions on Section 4:
- Building on the toy experiment in Section 4.1, can the neural interpreter adapt to a held out operation? (e.g. it does not get to pretrain on the xor operation and must quickly learn new functions post training). This would be more convincing to show generalizability of modular components.
- In the multi-task vision experiments, is fine-tuning changing just the type inference parameters or all parameters? Iit would be nice to see that most of the learned functions from pretraining don’t change, hence “reusing modularized knowledge”. Do you know how much information about previous tasks is preserved after adaptation? One could test the performance of the NI on pretrianing tasks after adapting to K-MNIST to see how much information is forgotten. I’m also interested in comparing the orange line in Figure 5 to a NI trained from scratch on K-MNIST (how fast does that learn?).
- In Table 2, we see in some tasks, WReN / VAE-WReN outperform ViT and NI: do you have a sense of why for Attribute P. and triples, this is true? Is there something fundamental to those tasks that requires a level of disentanglement that NI does not have? Similarly, I imagine NI would benefit greatly from function disentanglement.

limitations_and_societal_impact: I think an explicit limitations section would be helpful to (1) be transparent about any optimization or modeling difficulties in NI and also (2) explore cases in which NI does not perform well. The broader impact statement could be expanded to highlight the importance of modularity of neural networks for maintaining and improvement models.
review_title: null

final_score: rating: 6: Marginally above the acceptance threshold
review_content: summary: This paper focuses on improving the generalization ability of deep models to the unseen but related distributions to training data, and thus enhancing interpretability. In specific, a Neural Interpreter is proposed, which factorizes the inference of self-attention networks as the dynamic routing within functions. The Neural Interpreter can flexibly compose computation on a per-sample basis, and it is end-to-end trainable. Some interesting experiments including image classiﬁcation and visual abstract reasoning are conducted to validate the effectiveness of the proposed method.
main_review: Generally speaking, I think that this is a nice paper. The proposed dynamic Neural Interpreter is novel in concept. The dynamic routing mechanism and the type matching algorithm seem to be natural and flexible. My major concern lies in the experiments.

The comparison with ViT is presented on some tiny data sets like SVHN and MNIST. However, ViT is designed for much larger scenarios like ImageNet. Therefore, I think that current empirical results are not sufficient enough to validate the superiority of Neural Interpreter.

In addition, although ViT recently attracts much attention from the research community, CNN is still widely used in many vision tasks. The proposed Neural Interpreter seems to be a pretty flexible framework. It is possible to be applied to CNN?
limitations_and_societal_impact: My concerns on the limitations of this paper have been presented in "Main Review". The authors do not discuss the potential negative societal impact of their work. Adding more related discussions will be helpful.
review_title: null

final_score: rating: 7: Good paper, accept
review_content: summary: The paper proposes a model based on self-attention, factorised in different modules. It processes a sequence of tokens and could be viewed as a generalisation of a Transformer. The key idea is to have different modules (associated with a function) that behave differently but are general and actually share parameters. The core module of ModAttn can be viewed as a self-attention module with dynamic weights that depend on a context / code c. Using n_f learnable codes, each assigned to a ‘function’ leads to n_f modules, each with different functionality. An important aspect is the fact that each function only affects a subset of tokens, just the ones that are close to a type (learnable parameters) of the function. 
main_review: **Pros**:

+ The paper has an important goal, of obtaining models that are factorized in a meaningful way and offer inductive biases towards reusability and fast adaptation.

+ The method is sound and expands on the works using modular networks and self-attention. The method presents novel elements, the idea of functions that act according to similar dynamics (because they share parameters) but are modulated by the interpreter is novel and interesting.

+ The paper presents some interesting results. Especially interesting is to note that adding multiple functions (Figure 5) improves the results, although they are not pre-trained, and the additional parameters should be small.
 
+ The model obtains good results on a Abstract Reasoning task that require some form of compositional reasoning.

**Cons**: 

- I think that the experimental section is not really convincing enough to strongly support all the claims, as summarised below.

- For Multi-Task Image Classification, the proposed NI model adapts faster than the ViT, but this does not mean that it is modular. The real cause of the improved adaptability could be other than modularity. NI model could simply be easier to optimise, without being modular in any way. And the optimisation could be helped by the fact that NI has 3 times less parameters than ViT.

- For Fuzzy Expressions, it is interesting to note that most of the performance gain is obtained when learning the Type Inference Parameters and this hints that the method learns to recompose the previously learned modules. But this is still a somewhat weaker evidence as the compatibility matrix could encode enough information, that helps the tasks, without necessary reusing components.

- “we include results on a toy problem, where we explicitly probe the ability of Neural Interpreters to learn recomposable computational primitives”. What does ‘explicitly probe’ refer to? Although there are hints that suggest the model leans recomposable primitives, this is not explicitly tested. 


- ““there is diversity in how samples are routed through the network, and shows that the routing mechanism discriminates between samples.” Is there a reason why this diversity is different from the diversity obtained at initialisation? Could we interpret this diversity as having more meaning than what would be obtained by taking the similarities of random projections for example?


**Questions**: 
Is there a fundamental difference between using multiple LOC or using multiple scripts? Having both functionalities increases the flexibility of the model, making it more capable of expressing various functions more easily, but is there something beyond this?



limitations_and_societal_impact: This is sufficiently tackled.
review_title: null

final_score: rating: 6: Marginally above the acceptance threshold
review_content: summary: This paper proposes Neural Interpreter (NI), a drop-in replacement for Transformer layers that can be applied on set-valued inputs. The motivation behind the architecture is that common computation units in deep learning such as convolution layer is rigid in how they process the input, so to overcome this, NI leverages self-attention to dynamically determine computation path using its modular functions depending on the given input. The paper shows how NI performs well in transfer-learning and systematic generalization tasks.
main_review: Originality & Significance
- Neural Interpreter’s way of dynamically composing functions can enable better generalization and its modularity give a way of expanding model - possibly continual learning although not studied in this paper. Similar to recent work Switch Transformer, NI proposes an efficient way of leveraging modular architecture with large number of parameters differing from other modular models such as SCOFF. Although promising, I find the experiments section not too strong as discussed in the next section.

Quality
- I like the model formulation proposed by NI of how it used functions to modulate and compose computations.
- Section 4.1 could have baseline models such as the plain transformer model to demonstrate if the inventions in NI is really making the task solvable.
- Additional experiments on continual learning datasets by continuously adding more functions to NI would strengthen the results. 
- Analyzing or visualizing how modular functions are specialized would be beneficial. Figure 3 shows computation paths, but it is not easy to see what is going on. With a smaller number of functions on a simple task, it would be possible to clearly see if functions in NI can specialize according to the given input type. It would be also good to analyze how the truncation parameter can be used to control sparsity.
- Figure 5 (bottom) could also compare with ViT for example by adding more layers to ViT.
- Section 4.3 Table 2, it is hard to tell if the inventions in NI is really beneficial over the ViT baseline, especially because the results are reported from a single run for each setting.

Clarity
- The paper is well-written. Minor comments: notations are a bit confusing. e.g. W_uhij that has four different subscripts merged together.
limitations_and_societal_impact: Yes
review_title: null

Meta-review: This paper addresses the goal of modular information processing in deep networks in an interesting way, inspired by the architecture of function application in a PL interpreter. Everyone agrees that this is an interesting approach, and the analogy to interpreters is useful. The results, especially after the response phase, support the ability of this architecture to generalize in interesting ways. It would be useful in revision to make sure to clarify some key points raised by reviewers (such as what encourages the NI to learn sparse types).
Decision: Accept (Poster)