Dear reviewer ecSr,
Thank you very much for your thoughtful review. We greatly appreciate your constructive comments and your suggestions for improving the clarity of the paper.
> Unfortunately, I think the results are very mixed, experiments are done on very small 5 layer transformers on small datasets.
It's true that the models and datasets are relatively small compared to some other papers, but we believe our experiments demonstrate an important point: that transformers with a latent model of syntax are more expressive than standard transformers (as shown by the results on synthetic CFLs such as the hardest CFL), and that they can be more parameter- and data-efficient than standard transformers when the data can be explained with underlying hierarchical rules (as shown by the language modeling results).
> Even for the positive results, there is no analysis of why the stack augmented model may be doing better on natural language - is it discovering good parses / something else?
Thank you for raising this point. We agree that analyzing the parses learned by stack attention would be extremely informative and would further validate our method. If we have time, we will update our response with an analysis of how the networks learn to use stack attention.
> The biggest missing detail is how training is done in parallel ...
You are correct that the stack state $\mathcal{S}_t$ is updated recurrently. In our implementation, we simply compute $\mathcal{S}_1, \mathcal{S}_2, \ldots$ serially and compute the other parts of the transformer network in parallel as usual. Consider Figure 1, which depicts a single stack attention sublayer: we first compute all of the inputs $\mathbf{x}_t$ and apply layer norm in parallel, then we compute the stack states $\mathcal{S}_t$ and their stack readings $\mathbf{r}_t$ serially, and finally we apply dropout and residual connections in parallel to compute the outputs $\mathbf{y}_t$. Although our implementation does not currently do so, it would also be possible to parallelize the computation of $\mathbf{r}_t$ from $\mathcal{S}_t$, which would result in a small speedup for nondeterministic stack attention.
Despite the recurrence of $\mathcal{S}_t$, in the case of nondeterministic stack attention, it is still possible to parallelize the computation across the timestep dimension using a strategy similar to that of parallel CKY parsing, which would reduce it to $O(n)$ parallel time and likely result in a substantial speedup over our current implementation.
Q1: Thank you for pointing this out; this is indeed a very relevant finding. We will update this statement in our paper. It is interesting to note that although training for longer does improve hierarchical generalization by a lot, vanilla transformers still fall 8 to 20 percent short of perfect on question formation and tense reinflection, indicating there is still room for improvement.
S1: We will follow this suggestion. Thank you!
S2: Thank you for these references. Incorporating stacks and latent syntax into neural networks has become a very long line of work, so we limited our citations specifically to syntax-oriented transformers (as opposed to RNNs), and RNNs that use the differentiable stacks that we use in this paper. If we have space, we will include more discussion of other work.
Q3: Yes, superposition stack attention is faster than nondeterministic stack attention. For details, please see Appendix B.
Q4: Superposition stack attention does not appear to have a mechanism for doing this. As discussed in Section 4, superposition stack attention is very likely less expressive than nondeterministic stack attention, which is at least weakly equivalent to any PDA that performs multiple reductions per timestep, since it can recognize all CFLs (DuSell and Chiang, 2023).
S3: Thank you; we will consider ways to make this more concise while still establishing the essential notation used in the paper.
Q5: The purpose of Equation 17 is to define the output of the dVPDA mathematically in a way that is concise, if inefficient. If implemented naively, it would take time exponential in $n$, because $\pi$ loops over sequences of length $n$ in the denominator. However, it is possible to implement this equation in cubic time and quadratic space using a dynamic programming algorithm called Lang's algorithm (this is the same time/space complexity as parsing algorithms for context-free grammars, such as CKY). Since Equation 17 is sufficient for understanding the dVPDA mathematically and the implementation details are somewhat complex, we put them in the appendix to save space and to reduce the cognitive burden on the reader. For the full implementation details of Equation 17, please see Appendix A, and for a discussion of its time complexity, please see Appendix B.
(continued below)