arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2410.15787cs.LGcs.AI
收藏

算术Transformer可在操作数长度和数量两方面实现长度泛化

Arithmetic Transformers Can Length-Generalize in Both Operand Length and Count

Kim Jaechul Graduate School of AI, KAIST(韩国科学技术院金在哲人工智能研究生院);Google Research(谷歌研究院)

Hanseul Cho, Jaeyoung Cha, Srinadh Bhojanapalli, Chulhee Yun

AI总结:

针对Transformer在算术任务中难以对操作数长度和数量进行长度泛化的问题,本研究设计特定任务草稿本并应用多层级Position Coupling,首次在相关任务上实现约2-3倍长度泛化,且理论证明1层模型可解决指数级规模的多操作数加法。

摘要:

Transformer常难以实现长度泛化,即无法泛化到训练时未接触过的更长序列。尽管算术任务常用于研究长度泛化,但某些任务难度极高,如多操作数加法(需同时对操作数数量和长度泛化)与乘法(需对操作数长度泛化)。本研究在这两项任务上实现了约2-3倍的长度泛化,为算术Transformer领域首次此类成果。我们设计了特定任务草稿本,使模型在每个下一个token预测步骤聚焦固定数量的token,并应用多层级版本的Position Coupling(Cho等,2024;McLeish等,2024)让Transformer知晓应关注的正确位置。理论层面,我们证明使用该方法的1层Transformer可解决多操作数加法问题,且操作数长度和数量可达到嵌入维度的指数级。

英文摘要:

Transformers often struggle with length generalization, meaning they fail to generalize to sequences longer than those encountered during training. While arithmetic tasks are commonly used to study length generalization, certain tasks are considered notoriously difficult, e.g., multi-operand addition (requiring generalization over both the number of operands and their lengths) and multiplication (requiring generalization over both operand lengths). In this work, we achieve approximately 2-3x length generalization on both tasks, which is the first such achievement in arithmetic Transformers. We design task-specific scratchpads enabling the model to focus on a fixed number of tokens per each next-token prediction step, and apply multi-level versions of \Position Coupling (Cho et al., 2024; McLeish et al., 2024) to let Transformers know the right position to attend to. On the theory side, we prove that a 1-layer Transformer using our method can solve multi-operand addition, up to operand length and operand count that are exponential in embedding dimension.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑