arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.17963cs.LGcs.AI
收藏

生成式Transformer模型在算术推理任务中泛化能力的原则性理解

Principled Understanding of Generalization for Generative Transformer Models in Arithmetic Reasoning Tasks

Shanghai Artificial Intelligence Laboratory(上海人工智能实验室);ShanghaiTech University(上海科技大学);University of Hong Kong(香港大学);Fudan University(复旦大学)

Xingcheng Xu, Zibo Zhao, Haipeng Zhang, Yanqing Yang

AI总结:

本文提出统一理论框架,通过分析加法、乘法及模运算,揭示平移不变性与相对位置编码对长度泛化的作用,并经GPT系列实验验证,强调任务结构与数据分布的重要性。

摘要:

基于Transformer的模型在各种任务中表现出色,但其泛化能力,尤其是在算术推理方面,仍未得到完全理解。算术任务为探索这些能力提供了一个受控框架,然而性能异常现象依然存在,例如在乘法中效果不一致,以及在模加法(如模100与模101)中泛化表现不稳定。本文开发了一个统一的理论框架,用于理解Transformer在算术任务中的泛化行为,重点关注长度泛化。通过对加法、乘法和模运算的详细分析,我们揭示了加法中的平移不变性与相对位置编码相结合,可实现稳健的泛化,而模运算中的基数不匹配则破坏了这种对齐。跨GPT系列模型的实验验证了我们的框架,确认了其预测泛化行为的能力。我们的工作强调了任务结构和训练数据分布对于实现数据高效且结构感知训练的重要性,为理解Transformer中的长度泛化提供了一种系统方法。

英文摘要:

Transformer-based models excel in various tasks but their generalization capabilities, especially in arithmetic reasoning, remain incompletely understood. Arithmetic tasks provide a controlled framework to explore these capabilities, yet performance anomalies persist, such as inconsistent effectiveness in multiplication and erratic generalization in modular addition (e.g., modulo 100 vs. 101). This paper develops a unified theoretical framework for understanding the generalization behaviors of transformers in arithmetic tasks, focusing on length generalization. Through detailed analysis of addition, multiplication, and modular operations, we reveal that translation invariance in addition aligns with relative positional encoding for robust generalization, while base mismatch in modular operations disrupts this alignment. Experiments across GPT-family models validate our framework, confirming its ability to predict generalization behaviors. Our work highlights the importance of task structure and training data distribution for achieving data-efficient and structure-aware training, providing a systematic approach to understanding of length generalization in transformers.

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

↑