paper-with-me

Papers

Length Generalization in Arithmetic Transformers

2023-06-27 · Samy Jelassi, Stéphane d'Ascoli, Carles Domingo-Enrich, Yuhuai Wu, Yuanzhi Li, François Charton

We examine how transformers cope with two challenges: learning basic integer arithmetic, and generalizing to longer sequences than seen during training. We find that relative position embeddings enable length generalization for simple tasks, such as addition: models trained on $5$-digit numbers can perform $15$-digit sums. However, this method fails for multiplication, and we propose train set priming: adding a few ($10$ to $50$) long sequences to the training set. We show that priming allows models trained on $5$-digit $\times$ $3$-digit multiplications to generalize to $35\times 3$ examples. We also show that models can be primed for different generalization lengths, and that the priming sample size scales as the logarithm of the training set size. Finally, we discuss potential applications of priming beyond arithmetic.

📄 PDF Abstract BibTeX arXiv:2306.15400

Code (0)

등록된 구현이 없습니다.

Tasks

Position

Similar Papers 제목 키워드 기반

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

2024-10-21 · Hanseul Cho, Jaeyoung Cha, Srinadh Bhojanapalli, Chulhee Yun

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,…

Position

Looped Transformers for Length Generalization

2024-09-24 · Ying Fan, Yilun Du, Kannan Ramchandran, Kangwook Lee

Recent work has shown that Transformers trained from scratch can successfully solve various arithmetic and algorithmic tasks, such as adding numbers and computing parity. While these Transformers generalize well on unsee…

From Interpolation to Extrapolation: Complete Length Generalization for Arithmetic Transformers

2023-10-18 · Shaoxiong Duan, Yining Shi, Wei Xu

In this paper, we investigate the inherent capabilities of transformer models in learning arithmetic algorithms, such as addition and parity. Through experiments and attention analysis, we identify a number of crucial fa…

Position

What Algorithms can Transformers Learn? A Study in Length Generalization

2023-10-24 · Hattie Zhou, Arwen Bradley, Etai Littwin, Noam Razin 외

Large language models exhibit surprising emergent generalization properties, yet also struggle on many simple reasoning tasks such as arithmetic and parity. This raises the question of if and when Transformer models can …

Softmax Transformers are Turing-Complete

2025-11-25 · Hongjian Jiang, Michael Hahn, Georg Zetzsche, Anthony Widjaja Lin arxiv

Hard attention Chain-of-Thought (CoT) transformers are known to be Turing-complete. However, it is an open problem whether softmax attention Chain-of-Thought (CoT) transformers are Turing-complete. In this paper, we prov…

Arithmetic Reasoning