paper-with-me

홈 › Papers

Transformers Can Do Arithmetic with the Right Embeddings

2024-05-27 · Sean McLeish, Arpit Bansal, Alex Stein, Neel Jain, John Kirchenbauer, Brian R. Bartoldson, Bhavya Kailkhura, Abhinav Bhatele, Jonas Geiping, Avi Schwarzschild, Tom Goldstein

The poor performance of transformers on arithmetic tasks seems to stem in large part from their inability to keep track of the exact position of each digit inside of a large span of digits. We mend this problem by adding an embedding to each digit that encodes its position relative to the start of the number. In addition to the boost these embeddings provide on their own, we show that this fix enables architectural modifications such as input injection and recurrent layers to improve performance even further. With positions resolved, we can study the logical extrapolation ability of transformers. Can they solve arithmetic problems that are larger and more complex than those in their training data? We find that training on only 20 digit numbers with a single GPU for one day, we can reach state-of-the-art performance, achieving up to 99% accuracy on 100 digit addition problems. Finally, we show that these gains in numeracy also unlock improvements on other multi-step reasoning tasks including sorting and multiplication.

📄 PDF Abstract BibTeX arXiv:2405.17399

Code (1)

mcleish7/arithmetic 공식 구현 pytorch

Tasks

GPUPosition

Methods 이 논문이 사용한 방법론

MEND 설명 없음

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

Length Generalization in Arithmetic Transformers

2023-06-27 · Samy Jelassi, Stéphane d'Ascoli, Carles Domingo-Enrich, Yuhuai Wu 외

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

Position

Adaptive Control Flow in Transformers Improves Systematic Generalization

2021-09-29 · ICLR 2022 4 · Róbert Csordás, Kazuki Irie, Jürgen Schmidhuber

Despite successes across a broad range of applications, Transformers have limited capability in systematic generalization. The situation is especially frustrating in the case of algorithmic tasks, where they often fail t…

ListOpsSystematic Generalization

The Neural Data Router: Adaptive Control Flow in Transformers Improves Systematic Generalization

2021-10-14 · Róbert Csordás, Kazuki Irie, Jürgen Schmidhuber

Despite progress across a broad range of applications, Transformers have limited success in systematic generalization. The situation is especially frustrating in the case of algorithmic tasks, where they often fail to fi…

ListOpsSystematic Generalization

Going Beyond T-SNE: Exposing whatlies in Text Embeddings

2020-11-01 · EMNLP (NLPOSS) 2020 11 · Vincent Warmerdam, Thomas Kober, Rachael Tatman

We introduce whatlies, an open source toolkit for visually inspecting word and sentence embeddings. The project offers a unified and extensible API with current support for a range of popular embedding backends including…

Dimensionality ReductionSentenceSentence EmbeddingsWord Embeddings