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

Xingcheng Xu, Zibo Zhao, Haipeng Zhang, Yanqing Yang
7/25/2024
cs.LGcs.AI

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{xu2024principled,
  title  = {Principled Understanding of Generalization for Generative Transformer Models in Arithmetic Reasoning Tasks},
  author = {Xingcheng Xu and Zibo Zhao and Haipeng Zhang and Yanqing Yang},
  year   = {2024},
  eprint = {2407.17963},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.17963v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.17963.svg)](https://codeofpaper.com/paper/2407.17963)

Discussion