paper-with-me

Papers

Transformers Can Achieve Length Generalization But Not Robustly

2024-02-14 · Yongchao Zhou, Uri Alon, Xinyun Chen, Xuezhi Wang, Rishabh Agarwal, Denny Zhou

Length generalization, defined as the ability to extrapolate from shorter training sequences to longer test ones, is a significant challenge for language models. This issue persists even with large-scale Transformers handling relatively straightforward tasks. In this paper, we test the Transformer's ability of length generalization using the task of addition of two integers. We show that the success of length generalization is intricately linked to the data format and the type of position encoding. Using the right combination of data format and position encodings, we show for the first time that standard Transformers can extrapolate to a sequence length that is 2.5x the input length. Nevertheless, unlike in-distribution generalization, length generalization remains fragile, significantly influenced by factors like random weight initialization and training data order, leading to large variances across different random seeds.

📄 PDF Abstract BibTeX arXiv:2402.09371

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

On Vanishing Variance in Transformer Length Generalization

2025-04-03 · Ruining Li, Gabrijel Boduljak, Jensen, Zhou

It is a widely known issue that Transformers, when trained on shorter sequences, fail to generalize robustly to longer ones at test time. This raises the question of whether Transformer models are real reasoning engines,…

AttributeMathematical Problem-Solving

Quantitative Bounds for Length Generalization in Transformers

2025-10-30 · Zachary Izzo, Eshaan Nichani, Jason D. Lee arxiv

We study the problem of length generalization (LG) in transformers: the ability of a model trained on shorter sequences to maintain performance when evaluated on much longer, previously unseen inputs. Prior work by Huang…

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…

The Role of Sparsity for Length Generalization in Transformers

2025-02-24 · Noah Golowich, Samy Jelassi, David Brandfonbrener, Sham M. Kakade 외

Training large language models to predict beyond their training context lengths has drawn much attention in recent years, yet the principles driving such behavior of length generalization remain underexplored. We propose…

Position