[论文解读] Investigating the Limitations of Transformers with Simple Arithmetic Tasks
该论文表明,数字的表面表示对变换器中的算术学习具有关键影响;在具有正确位置感知的表示下,模型可以在非常长的数字上学习加减运算,而标准分词则难以实现,外推仍然具有挑战性。
The ability to perform arithmetic tasks is a remarkable trait of human intelligence and might form a critical component of more complex reasoning tasks. In this work, we investigate if the surface form of a number has any influence on how sequence-to-sequence language models learn simple arithmetic tasks such as addition and subtraction across a wide range of values. We find that how a number is represented in its surface form has a strong influence on the model's accuracy. In particular, the model fails to learn addition of five-digit numbers when using subwords (e.g., "32"), and it struggles to learn with character-level representations (e.g., "3 2"). By introducing position tokens (e.g., "3 10e1 2"), the model learns to accurately add and subtract numbers up to 60 digits. We conclude that modern pretrained language models can easily learn arithmetic from very few examples, as long as we use the proper surface representation. This result bolsters evidence that subword tokenizers and positional encodings are components in current transformer designs that might need improvement. Moreover, we show that regardless of the number of parameters and training examples, models cannot learn addition rules that are independent of the length of the numbers seen during training. Code to reproduce our experiments is available at https://github.com/castorini/transformers-arithmetic
研究动机与目标
- 评估数字的不同表面表示如何影响变换器对简单算术(加法/减法)的学习。
- 探究是否可以将显式的位置语义注入输入,以在不重新预训练的情况下提升算术能力。
提出的方法
- 将加法和减法建模为序列到序列任务,使用诸如 'What is [number1] [operation] [number2]?' 的输入模板。
- 系统地比较六种数字表示(十进制、字符、固定字符、下划线、单词、基于10的位标记、基于10e的)对模型准确性的影响。
- 使用不同规模的T5模型(以及标准Transformer),通过平衡/随机采样进行训练;使用贪婪解码来衡量准确性。
- 通过比较表示并在附录中进行外推/内插和位置嵌入的实验来分析预训练的影响。
实验结果
研究问题
- RQ1数字的表面形式如何影响变换器模型对简单算术的学习?
- RQ2显式的位置为基础的表示(基于10和基于10e)是否能够在非常长的数字上实现准确的加减运算?
- RQ3更大的模型或更多数据是否能够克服由表示引起的算术学习局限?
- RQ4在不同表示和模型规模下,未知位数的外推是否可行?
主要发现
- 十进制和子词样的分词会阻碍对较长数字的算术学习;在5位数及以上的加法中准确性降至为零。
- 字符和下划线表示法提高了学习效果,但随着数字长度增加仍会下降;记忆化策略在大约12–15位数字以上就失败。
- 基于10和基于10e的表示以及位置标记在主要结果中实现近乎完美的准确性,达到60位数字(文本在讨论中提到达到60位)。
- 固定字符表示在较长数字上优于字符/下划线表示,但在大约15位时最终会失效。
- 预训练与表示存在交互;单词表示受益于内在的位置标记,但由于标记长度限制在非常长的数字上失败;基于10/10e的表示在适当定位下能获得高准确性。
- 对于许多模型,外推仍然具有挑战性;即使是3B参数的模型也很难学习独立于训练长度分布的算术规则。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。