Paper: Positional Description Matters for Transformers Arithmetic (ICLR-2024)

Reviewer comment (Reproducibility):
The clarity of the writing can be improved. Many of the tables are missing information on what is the maximum number of steps the model was trained for (e.g., Fig 1 and Fig 2).

Author response:
We thank the reviewer for the helpful comments. The training setup for Fig 1 and 2 can be found in their captions.

Reviewer comment (Reproducibility):
It is unclear what the "pretrained model" is pre-trained on, and how it is fine-tuned on the new data.

Author response:
Pretrained means the default pretrained GPT2. All the other information on how it is fine-tuned can be found in the appendix.

Reviewer comment (Theory):
It would be worth discussing a broader view of these problems, as not all problems described are directly related to positional encodings. For example, reversing the results has to do with the decomposition of the task and the ability to use subresults of less significant digits to compute the more significant ones.

Author response:
We believe reversing the result also falls under the main theme of positional information because reversing emphasizes the importance of putting the digits of different significance in the right positions.

Reviewer comment (Experiments):
The authors only compare to an absolute positional embedding baseline, which is known for weak generalization properties [1,2]. RoPE also tends to be not great in length extrapolation, but Transformer XL-style relative PE [3] tends to work well. The authors should consider comparing to these models.

Author response:
We appreciate the related works and the summary the reviewers mentioned. We would like to point out that while we proposed random embedding, we view it as a simple trick to solve the issues we noticed rather than an alternative to positional encoding. For this reason, we did not provide a comprehensive comparison between it and other existing encodings. However, we agree that a more comprehensive comparison is an important next step if we want to apply random embedding more widely.

Reviewer comment (Novelty):
It is unclear how to position this paper within existing work considering algorithmic tasks and positional encodings. For instance, [3] shows the benefits of randomized positional encodings on various algorithmic tasks, [4] shows the benefits of randomly shifted positional encodings, [5] investigates different number representations for arithmetic, and [6] shows that with closeness bias instead of positional encodings, length extrapolation is possible on simple algorithmic tasks like Listops.

Author response:
We appreciate the related works and the summary the reviewers mentioned. We would like to point out that while we proposed random embedding, we view it as a simple trick to solve the issues we noticed rather than an alternative to positional encoding. For this reason, we did not provide a comprehensive comparison between it and other existing encodings. However, we agree that a more comprehensive comparison is an important next step if we want to apply random embedding more widely.

Reviewer comment (Novelty):
The advantages of using scratchpad and randomized positional encodings are already known, and it is unclear how the findings of this paper transfer to relative positional encodings, which are used in most modern transformers.

Author response:
We appreciate the related works and the summary the reviewers mentioned. We would like to point out that while we proposed random embedding, we view it as a simple trick to solve the issues we noticed rather than an alternative to positional encoding. For this reason, we did not provide a comprehensive comparison between it and other existing encodings. However, we agree that a more comprehensive comparison is an important next step if we want to apply random embedding more widely.

Reviewer comment (Experiments):
"In the “Basic” data format, the model fails to generalize numbers exceeding 10 digits." — What was the length seen during the training?

Author response:
Response to the questions: - Up to 10 digits

Reviewer comment (Experiments):
Regarding the statement "training solely on arithmetic data can’t guarantee an accurate solution to the difficult problems due to the lack of difficult samples in the training set and the errors present" — Aren't the arithmetic data more complicated, in the sense of more digits? Also, isn't it perfect, as it is synthetic?

Author response:
Response to the questions: - This is a typo. It should be “the natural language data”. Thank you for pointing this out.

Reviewer comment (Experiments):
For the 15-digit multiplication not extrapolating to 20, the performance seems to break down much earlier than reaching even 15 digits. Isn't the problem that now the result is padded to 20 digits? What about training until 15 with a padding of 20, and then checking if it generalizes to 20?

Author response:
Response to the questions: - We didn’t try this, but we agree this could be an interesting experiment to do. Thank you for suggesting this.

Reviewer comment (Experiments):
In Table 6, is there any performance difference in the "Basic" and "Random Space" versions between the pre-trained vs randomly initialized settings?

Author response:
Response to the questions: - We did not see any significant difference.

Reviewer comment (Experiments):
Related works could be expanded (see below). Furthermore, the training/testing setups used in the present work differ from those used in other similar work, making it more challenging to compare the current results with previous contributions.

Author response:
We thank the reviewer for the helpful comments. We appreciate the related works the reviewer mentioned and will add them to our revision. We agree with some of the limitations the reviewer mentioned in the weakness section, e.g., the lack of a unified framework for different problems and the requirement to specify the maximum length of padding. However, we believe the approaches studied in this paper, though have various limitations, could inspire future work that overcomes the limitations.

Reviewer comment (Experiments):
Different Sections investigate different problems (e.g., multiplication vs. addition vs. math word problems), often by introducing opposite approaches (e.g., padding vs. insertion of random spaces) or by relying on quite different training regimens (e.g., train on 5-digit and test on 15-digits multiplication problems vs. train on 10-digit and test on 12-digit addition problems). This makes it difficult to frame the contribution of the paper, which seems a collection of heterogeneous experiments rather than a coherent proposal for a unified framework.

Author response:
We thank the reviewer for the helpful comments. We appreciate the related works the reviewer mentioned and will add them to our revision. We agree with some of the limitations the reviewer mentioned in the weakness section, e.g., the lack of a unified framework for different problems and the requirement to specify the maximum length of padding. However, we believe the approaches studied in this paper, though have various limitations, could inspire future work that overcomes the limitations.

Reviewer comment (Experiments):
Padding the input is a simple method, which allows to reach an impressive boost in 15-digits multiplication. However, it requires specifying the maximum length of the operands (and if this gets overestimated, padding becomes quite inefficient). Furthermore, in a natural language setting (e.g., Section 4) the Transformer should learn when and how to pad, which seems quite implausible as a real use case.

Author response:
We thank the reviewer for the helpful comments. We appreciate the related works the reviewer mentioned and will add them to our revision. We agree with some of the limitations the reviewer mentioned in the weakness section, e.g., the lack of a unified framework for different problems and the requirement to specify the maximum length of padding. However, we believe the approaches studied in this paper, though have various limitations, could inspire future work that overcomes the limitations.

Reviewer comment (Evaluation):
The “generalization” capabilities described in Section 3 (from 10-digits to 11- or 12-digits) do not seem to indicate the emergence of a systematic addition algorithm.

Author response:
Although the generalization capabilities are only 11- or 12-digit, it indicates a phase transition from no generalization at all to some degree of generalization, which is already challenging as shown in previous works[Lee et al., 2023].

Reviewer comment (Novelty):
Related works: The authors argue that no previous work has demonstrated that Transformers can compute the product of two 15-digit number multiplication. A recent paper (already mentioned by the authors: https://arxiv.org/abs/2306.15400) has shown that by adding a tiny number of long sequences to the training set allows generalization to 35-digit operands in multiplication tasks (though it should be stressed that in this case we are injecting some OOD cases into the training set). Another work that might be worth mentioning has shown that the “surface representation” of the input has a significant impact on the Transformer generalization capability in arithmetic tasks (https://arxiv.org/abs/2102.13019), which is partially aligned with some findings observed in the present paper. Since the number of papers focusing on arithmetic tasks has significantly increased in the past few years, the authors might also consider mentioning recent reviews on the topic (e.g., https://arxiv.org/abs/2303.07735).

Author response:
The multiplication studied in https://arxiv.org/abs/2306.15400 is significantly simpler than the multiplication studied in our paper. In their work, one of the factors is always smaller than 1000. However, the complexity of large-number multiplication is mainly due to both factors being large.

Reviewer comment (Experiments):
The generalization capabilities on addition problems should be tested on a wider set of cases, involving much longer operands and possibly also a larger number of operands (see, for example, https://arxiv.org/abs/2207.02536). High accuracy in the out-of-distribution ranges would more convincingly show that the data format / positional embedding can be successfully used to systematically grasp the problem structure.

Author response:
We thank the reviewer for pointing out https://arxiv.org/abs/2207.02536 and suggesting potential other cases that could test generalization capabilities.

Reviewer comment (Experiments):
The authors seem to implement a sort of curriculum learning strategy in their approach, since learning starts from “easy” problems (such as one-digit multiplication) and progressively covers more complex problems. However, such training strategy has not been systematically described, nor compared with an alternative strategy not based on curriculum learning.

Author response:
We did not use any curriculum learning strategy. The model is trained on all samples in the dataset in each epoch. We used the concepts of easy and hard problems for an easier understanding of the experiment results.

Reviewer comment (Presentation):
The paper is not structured very cohesively. There is also no conclusion or future work section which makes the paper a bit incomplete. The proposed solutions are more experimental and it is not clear which ones can be readily applied in practice.

Author response:
We thank the reviewer for the helpful comments. While we did not write a separate conclusion section, we summarized our work and pointed out future directions in the introduction. We proposed random encoding as a simple trick for the problem studied in this paper, rather than a new encoding that would work for all tasks.

Reviewer comment (Novelty):
My understanding is that the problem with extrapolation seems to lie with absolute positional encoding. However, there are many other encodings already designed and being used in practice including relative ones such as rotary. It is possible that the issue is actually the learnable positional encoding in which case the sinusoidal encoding proposed in the original Transformers paper is available. In light of these, it is not clear why yet another encoding (random encoding) is proposed.

Author response:
We proposed random encoding as a simple trick for the problem studied in this paper, rather than a new encoding that would work for all tasks.

Reviewer comment (Presentation):
In Table 7 it seems there is a mismatch in the intermediary steps. In particular it is written 32 + 28 while the initial addition is 239 + 821. If I understand correctly either both should be reversed or neither?

Author response:
In Table 7, we reverse the digits in all summands except the two summands at the beginning of the sentence.

Reviewer comment (Experiments):
The idea of adding spaces to make the model resilient is interesting. However, how does this compare with recently proposed methods to allow extrapolation such as Ruoss. et. al's work of using random positions?

Author response:
Adding random space modifies the data representation, which is a fundamentally different approach and can be much easier than modifying the positional encoding.

Reviewer comment (Writing):
This paper contains flippant sentences such as "Our findings reveal that even such modest-sized models can adeptly execute intricate arithmetic tasks" (when they use GPT models of >100M parameters to solve a very straight-forward task. For comparison, for the case of addition, people have been able to train 1-layer transformers to do it).

Author response:
We thank the reviewer for the review and the helpful suggestions on writing. In the first sentence, “Intricate arithmetic tasks” is not limited to the addition task the reviewer points out. It includes all the tasks studied in the paper, especially large number multiplication. We are not aware of any previous work that is able to perform $15\times 15$-digit multiplication.

Reviewer comment (Writing):
This paper contains flippant sentences such as "In Section 2.1, we show a simple 12-layer transformer can output the product of 15 × 15-multiplication directly, demonstrating the immense potential of transformers." (the authors should provide a non-arbitrary definition of the word "simple" that safely contains a 12-layer transformer and not all other conceivable neural networks. Also is it then correct to assume 6-layer transformers cannot do this task?).

Author response:
In the second sentence, “simple” means the model uses the original architecture of the transformers with no additional components. It does not imply 6-layer transformers cannot do this task. We can avoid this word in our revision.

Reviewer comment (Theory):
When positional encoding is removed and replaced by temporary random tags, it should be stated that no positional information is left other than the causal decoder mask. If the multiplication still works when removing positional embedding and the model is capable of not confusing the digits, the causal mask is the only possible origin of precise positional information. Please confirm if this assessment is correct.

Author response:
We agree the causal mask is the origin of positional information when the absolute positional embedding is removed.

Reviewer comment (Evaluation):
In general, while this paper does a large number of experiments, the reader is left very much in the dark about any mechanisms that might be involved here. Studying the mechanisms and not simply listing performance values would greatly enhance this contribution. As it stands, it feels like an arbitrary collection of experiments.

Author response:
Throughout the paper, we have discussions on the mechanisms involved in the experiment result we show in this paper. We believe it would be helpful if the reviewer could point out more concretely which mechanism could be discussed in more detail.