Paper: Neural-Symbolic Recursive Machine for Systematic Generalization (ICLR-2024)

Reviewer comment (Experiments):
All results are comparing the proposed method NSR with various neural architectures and only one neuro-symbolic method: NeSS. The fact that NeSS performs 0% in 2 tasks and 100% in the other two makes it a weak comparing point (and also suggests that NeSS behaves more like a symbolic model than a neuro-symbolic one: it's all or nothing in terms of performance). I would suggest the authors provide at least 1 other neuro-symbolic method to compare against to make the results more significant. It is very clear that the proposed method outperforms vanilla neural methods such as Transformers, which is not surprising given the nature of the tasks being used, but it is less clear if the proposed method is significantly better than previous neuro-symbolic methods that also do not require additional training signal. The work from Minervini et. al. on Greedy Theorem Provers, or other variants could potentially be used as a baseline for some of these tasks.

Author response:
Thank you for the suggestion! We appreciate your concern and will check Minervini et. al.'s work on Greedy Theorem Provers and other neural-symbolic methods to add more neural-symbolic baselines.

For other neuro-symbolic baselines, we have found that it is hard to directly adapt NTPs or Greedy NTPs to the considered datasets, since NTPs and Greedy NTPs are designed for proving queries to knowledge bases. Instead, we are investigating the more flexible Neural Module Networks [1,2] to build other neuro-symbolic baselines. We will update them in the paper revision once we get reasonable results for these baselines.

[1] Andreas et al. "Neural module networks." CVPR 2016.

[2] Johnson et al. "Inferring and executing programs for visual reasoning." ICCV 2017.

Reviewer comment (Reproducibility):
Another weakness of this paper is the ambiguous explanation of how the search for a GSS tree is terminated. Section 1 states that the search for a tree runs "until the accurate result is obtained", and Section 3.2 doesn't detail this point (or at least not very well). The authors should better define this stop criterion in order to better understand its limitation: what does it mean for the resulting tree to be "accurate"? Could the method settle on an "almost correct" syntactic tree to save time? and what would the effect of that be on performance?

Author response:
The search for a GSS tree stops when one of the following conditions is satisfied:
1. the found GSS can generate the given ground truth `y`, i.e., the root node's value is equal to `y`;
2. the search steps exceed the pre-defined maximum searching steps.

Reviewer comment (Theory):
Eventually, at the end of Section 3, the authors state that the three modules of NSR exhibit equivariance and recursiveness. It would be beneficial to explain why this claim is true and provide additional evidence about it.

Author response:
Equations 1, 2, and 3 demonstrate that in all three modules of the NSR system, the joint distribution is factorized into a product of several independent terms. This factorization process makes the modules naturally adhere to the principles of equivariance and recursiveness, as outlined in Definitions 3.1 and 3.2.

Reviewer comment (Presentation):
Presentation is unclear: There are very few details about the actual approach in the Section-3 (and Figure-1) to fully understand what exactly the model is (See questions). Unfortunately, because there is a lack of details around the approach, it is hard to do a thorough assessment of this work, and I request the authors to revise their draft.

Author response:
Thank you for your feedback! We appreciate your suggestions and will incorporate them into the revision. Below, we provide detailed clarifications to your questions regarding our proposed approach.

- > What exactly are the symbols in T for each of the datasets?

Figure-1 shows the examples of `T  = <(x,s,v), e>` for each dataset. 

For SCAN, `x` is the input word, e.g., `left`; `s` is the symbol id, e.g., `5`; `v` is the output actions, e.g., `[LTURN,JUMP]`. `(x,s,v)` forms a node, e.g., `left 5 [LTURN,JUMP]` in the first example of Figure-1. The edge `e` is the arrow, e.g., `left 5 [LTURN,JUMP] -> jump 4 [JUMP]`, which means the value of the node `jump 4 [JUMP]`, i.e., `[JUMP]`, is an input to the node `left 5 [LTURN,JUMP]`.

For PCFG, `x` is the input word, e.g., `swap`; `s` is the symbol id, e.g., `51`; `v` is the output letters, e.g., `[C,B,A]`. `(x,s,v)` forms a node `swap 51 [C,B,A]` in the second example of Figure-1. The edge `e` is the arrow, e.g., `swap 51 [C,B,A] -> A 0 [A]`, which means the value of the node `A 0 [A]`, i.e., `[A]`, is an input to the node `swap 51 [C,B,A]`.

For HINT, `x` is the input image, e.g., the image of `*`; `s` is the symbol id, e.g., `12`; `v` is the output number, e.g., `27`. `(x,s,v)` forms a node `* 12 27` in the third example of Figure 1. The edge `e` is the arrow, e.g., `* 12 27 -> 3 3 3`, which means the value of the node `3 3 3`, i.e., `3`, is an input to the node `* 12 27`.

- > Is every raw input mapped to a single symbol or is there a consolidation step where multiple raw inputs can be associated with the same symbol?

Currently, every raw input is mapped to a single symbol.

- > What models are used to parameterize all of the distributions in Eq~4? Are these neural networks?

\theta_p and \theta_s are parameterized by neural networks. \theta_l are functional programs, as illustrated by Figure 4(b).

- > What is the overall parameter count?

For SCAN and PCFG, the parameter count is ~0.2M, mainly from the dependency parser. For HINT, the parameter count is ~11M, mainly from the image encoder ResNet-18.

- > How does inference work for this model?

As illustrated in Figure 2, the neural perception module first maps the input x, e.g., a handwritten expression in Figure 1 (3) HINT, to a symbol sequence, `2 + 3 * 9`. The dependency parsing module then parses the symbol sequence into a tree in the form of dependencies, e.g., `+ -> 2 *`, `* -> 3 9`. Finally, the program induction module uses the learned programs for each symbol to calculate the values of the nodes in the tree in a bottom-up manner, e.g., `3 x 9 => 27, 2 + 27 => 29`.

- > How does this compare to other neuro-symbolic systems, for example, "Neuro-Symbolic Concept Learner" from Mao et al. 2019?

Mao et al. 2019's NS-CL model relies on a pre-established domain-specific language (DSL) tailored for CLEVR, which limits its flexibility, as the meanings of operations like Filter, Relate, and Query are predefined and unchangeable. Moreover, NS-CL uses GRU for question parsing, a model that prior research [1,2] has identified as less effective in generalizing to longer sequences. In contrast, our model operates with minimal domain-specific knowledge, learns the semantics of symbols directly from data, and demonstrates significantly improved generalization capabilities.

[1] Lake, et al. Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. ICML (2018).

[2] Li, et al. A minimalist dataset for systematic generalization of perception, syntax, and semantics. ICLR (2023).

Reviewer comment (Presentation):
The paper spends too much time (and math notation) on simple definitions such as “equivariance” and “recursiveness” and on flagposting “hypothesis” statements. Not necessarily cause for rejection, but I highly suggest that these be moved into an appendix, so more time is spent on explaining the approach.

Author response:
Thank you for your feedback! We appreciate your suggestions and will incorporate them into the revision. Below, we provide detailed clarifications to your questions regarding our proposed approach.

- > What exactly are the symbols in T for each of the datasets?

Figure-1 shows the examples of `T  = <(x,s,v), e>` for each dataset. 

For SCAN, `x` is the input word, e.g., `left`; `s` is the symbol id, e.g., `5`; `v` is the output actions, e.g., `[LTURN,JUMP]`. `(x,s,v)` forms a node, e.g., `left 5 [LTURN,JUMP]` in the first example of Figure-1. The edge `e` is the arrow, e.g., `left 5 [LTURN,JUMP] -> jump 4 [JUMP]`, which means the value of the node `jump 4 [JUMP]`, i.e., `[JUMP]`, is an input to the node `left 5 [LTURN,JUMP]`.

For PCFG, `x` is the input word, e.g., `swap`; `s` is the symbol id, e.g., `51`; `v` is the output letters, e.g., `[C,B,A]`. `(x,s,v)` forms a node `swap 51 [C,B,A]` in the second example of Figure-1. The edge `e` is the arrow, e.g., `swap 51 [C,B,A] -> A 0 [A]`, which means the value of the node `A 0 [A]`, i.e., `[A]`, is an input to the node `swap 51 [C,B,A]`.

For HINT, `x` is the input image, e.g., the image of `*`; `s` is the symbol id, e.g., `12`; `v` is the output number, e.g., `27`. `(x,s,v)` forms a node `* 12 27` in the third example of Figure 1. The edge `e` is the arrow, e.g., `* 12 27 -> 3 3 3`, which means the value of the node `3 3 3`, i.e., `3`, is an input to the node `* 12 27`.

- > Is every raw input mapped to a single symbol or is there a consolidation step where multiple raw inputs can be associated with the same symbol?

Currently, every raw input is mapped to a single symbol.

- > What models are used to parameterize all of the distributions in Eq~4? Are these neural networks?

\theta_p and \theta_s are parameterized by neural networks. \theta_l are functional programs, as illustrated by Figure 4(b).

- > What is the overall parameter count?

For SCAN and PCFG, the parameter count is ~0.2M, mainly from the dependency parser. For HINT, the parameter count is ~11M, mainly from the image encoder ResNet-18.

- > How does inference work for this model?

As illustrated in Figure 2, the neural perception module first maps the input x, e.g., a handwritten expression in Figure 1 (3) HINT, to a symbol sequence, `2 + 3 * 9`. The dependency parsing module then parses the symbol sequence into a tree in the form of dependencies, e.g., `+ -> 2 *`, `* -> 3 9`. Finally, the program induction module uses the learned programs for each symbol to calculate the values of the nodes in the tree in a bottom-up manner, e.g., `3 x 9 => 27, 2 + 27 => 29`.

- > How does this compare to other neuro-symbolic systems, for example, "Neuro-Symbolic Concept Learner" from Mao et al. 2019?

Mao et al. 2019's NS-CL model relies on a pre-established domain-specific language (DSL) tailored for CLEVR, which limits its flexibility, as the meanings of operations like Filter, Relate, and Query are predefined and unchangeable. Moreover, NS-CL uses GRU for question parsing, a model that prior research [1,2] has identified as less effective in generalizing to longer sequences. In contrast, our model operates with minimal domain-specific knowledge, learns the semantics of symbols directly from data, and demonstrates significantly improved generalization capabilities.

[1] Lake, et al. Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. ICML (2018).

[2] Li, et al. A minimalist dataset for systematic generalization of perception, syntax, and semantics. ICLR (2023).

Reviewer comment (Experiments):
How general is this approach: Most of the experiments here are on datasets where symbolic approaches are likely to help, but it is unclear how well this approach would do for natural language semantic parsing tasks such as GeoQuery. I'm not fully opposed to having experiments that are only on these programmatic datasets, but it would be good to have an extended discussion on what the symbols and programs look like for more natural data distributions.

Author response:
To discuss how our approach can generalize to natural language semantic parsing tasks, we construct the following example of how our model might work for GeoQuery.

Question: `How many rivers are in California?`

SQL query: `SELECT count(*) FROM rivers WHERE state = 'California'`

Here's how our framework might model this example:
1. The Perception module simplifies the question by removing unnecessary grammatical details:
```
how-many rivers be in California
```

2. The Parsing module breaks down the simplified sentence into a parse tree.
3. The Semantic module then generates the query step-by-step in a bottom-up manner. Here's the parse tree with intermediate results:
```
(be => [SELECT count(*) FROM rivers WHERE state = 'California']
    (rivers => [SELECT count(*) FROM rivers]
        how-many => [SELECT count(*)]
    )
    (in => [state = 'California']
        California => ['California']
    )
)
```

As discussed in Limitations of Section 5, training the entire framework from scratch on natural language datasets can be challenging. However, we have observed that the parse tree is quite similar to standard dependency structures. As a result, we can leverage existing parsers to initialize the modules in our framework, which could accelerate the training process.

We hope the above clarifications address your concerns and thank you again for your valuable suggestions. Please let us know if there is any further question.

Reviewer comment (Writing):
What exactly are the symbols in T for each of the datasets?

Author response:
- > What exactly are the symbols in T for each of the datasets?

Figure-1 shows the examples of `T  = <(x,s,v), e>` for each dataset. 

For SCAN, `x` is the input word, e.g., `left`; `s` is the symbol id, e.g., `5`; `v` is the output actions, e.g., `[LTURN,JUMP]`. `(x,s,v)` forms a node, e.g., `left 5 [LTURN,JUMP]` in the first example of Figure-1. The edge `e` is the arrow, e.g., `left 5 [LTURN,JUMP] -> jump 4 [JUMP]`, which means the value of the node `jump 4 [JUMP]`, i.e., `[JUMP]`, is an input to the node `left 5 [LTURN,JUMP]`.

For PCFG, `x` is the input word, e.g., `swap`; `s` is the symbol id, e.g., `51`; `v` is the output letters, e.g., `[C,B,A]`. `(x,s,v)` forms a node `swap 51 [C,B,A]` in the second example of Figure-1. The edge `e` is the arrow, e.g., `swap 51 [C,B,A] -> A 0 [A]`, which means the value of the node `A 0 [A]`, i.e., `[A]`, is an input to the node `swap 51 [C,B,A]`.

For HINT, `x` is the input image, e.g., the image of `*`; `s` is the symbol id, e.g., `12`; `v` is the output number, e.g., `27`. `(x,s,v)` forms a node `* 12 27` in the third example of Figure 1. The edge `e` is the arrow, e.g., `* 12 27 -> 3 3 3`, which means the value of the node `3 3 3`, i.e., `3`, is an input to the node `* 12 27`.

Reviewer comment (Reproducibility):
Is every raw input mapped to a single symbol or is there a consolidation step where multiple raw inputs can be associated with the same symbol?

Author response:
- > Is every raw input mapped to a single symbol or is there a consolidation step where multiple raw inputs can be associated with the same symbol?

Currently, every raw input is mapped to a single symbol.

Reviewer comment (Reproducibility):
How does inference work for this model?

Author response:
- > How does inference work for this model?

As illustrated in Figure 2, the neural perception module first maps the input x, e.g., a handwritten expression in Figure 1 (3) HINT, to a symbol sequence, `2 + 3 * 9`. The dependency parsing module then parses the symbol sequence into a tree in the form of dependencies, e.g., `+ -> 2 *`, `* -> 3 9`. Finally, the program induction module uses the learned programs for each symbol to calculate the values of the nodes in the tree in a bottom-up manner, e.g., `3 x 9 => 27, 2 + 27 => 29`.

Reviewer comment (Novelty):
How does this compare to other neuro-symbolic systems, for example "Neuro-Symbolic Concept Learner" from Mao et al. 2019?

Author response:
- > How does this compare to other neuro-symbolic systems, for example, "Neuro-Symbolic Concept Learner" from Mao et al. 2019?

Mao et al. 2019's NS-CL model relies on a pre-established domain-specific language (DSL) tailored for CLEVR, which limits its flexibility, as the meanings of operations like Filter, Relate, and Query are predefined and unchangeable. Moreover, NS-CL uses GRU for question parsing, a model that prior research [1,2] has identified as less effective in generalizing to longer sequences. In contrast, our model operates with minimal domain-specific knowledge, learns the semantics of symbols directly from data, and demonstrates significantly improved generalization capabilities.

[1] Lake, et al. Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. ICML (2018).

[2] Li, et al. A minimalist dataset for systematic generalization of perception, syntax, and semantics. ICLR (2023).

Reviewer comment (Theory):
Many statements are made like, "This stark discrepancy underscores the pivotal role and efficacy of symbolic components—specifically, the symbolic stack machine in NeSS and the GSS in NSR—in fostering systematic generalization." But, for an outsider, no explanation is given for why the symbolic components actually lead to better generalization. I would like to see some more explanation or analysis to back this up.

Author response:
We think the effectiveness of symbolic components in fostering systematic generalization in neural networks, such as the symbolic stack machine in NeSS and the Grounded Symbolic System (GSS) in NSR, stems from their ability to introduce *structured, rule-based processing* into otherwise fluid neural computations. These symbolic systems act as a framework within which neural networks can operate more predictably and consistently, thereby enhancing their generalization capabilities. Besides, symbolic components can mitigate overfitting by imposing rule-based constraints on the learning process. These constraints ensure that the model does not merely memorize the training data but learns the underlying rules and structures, thereby improving its ability to generalize to new, unseen data.

Reviewer comment (Reproducibility):
The program induction module is not described in detail; in equation (3), what is the p in the right-hand side? When you say that you "leverage" DreamCoder, do you mean that this module simply is DreamCoder?

Author response:
`p` denotes the probability.

The original DreamCoder does not support noisy examples, so we modified its search process to tolerate a ratio of noisy examples.

We kindly refer the reviewer to Appendix Section A for more details on the program induction module.

Reviewer comment (Presentation):
Figure 3: image is wrong?

Author response:
Yes, thank you for pointing it out! We will correct it in the revision.

Reviewer comment (Reproducibility):
Section 3.3: How do you use the gradients? Is this SGD?

Author response:
Yes, we use the Adam optimizer in practice.

Reviewer comment (Theory):
Why is abduction called that? It seems different from abductive reasoning?

Author response:
Naturally, this is a process of abductive reasoning. Consider the input `x` and output `y` as observations. The goal is to identify the `T` that most likely explains these observed values of `x` and `y`. This suggests that the discovered `T` may not necessarily match the actual ground-truth value of `T`.

Reviewer comment (Writing):
Def 3.2: Isn't "compositionality" a more usual word for this? "Recursive" has a totally different meaning in theory of computation.

Author response:
Thank you for pointing it out! The word "compositionality" is indeed a more appropriate choice for Def 3.2 and we will update it in the revision.