ChatPaper.aiChatPaper

I Transformer Possono Eseguire Operazioni Aritmetiche con gli Embedding Appropriati

Transformers Can Do Arithmetic with the Right Embeddings

May 27, 2024
Autori: Sean McLeish, Arpit Bansal, Alex Stein, Neel Jain, John Kirchenbauer, Brian R. Bartoldson, Bhavya Kailkhura, Abhinav Bhatele, Jonas Geiping, Avi Schwarzschild, Tom Goldstein
cs.AI

Abstract

Le scarse prestazioni dei transformer nei compiti aritmetici sembrano derivare in gran parte dalla loro incapacità di tenere traccia della posizione esatta di ciascuna cifra all'interno di una lunga sequenza di cifre. Risolviamo questo problema aggiungendo un embedding a ciascuna cifra che codifica la sua posizione relativa all'inizio del numero. Oltre al miglioramento che questi embedding forniscono di per sé, dimostriamo che questa correzione consente modifiche architetturali come l'iniezione di input e l'aggiunta di strati ricorrenti per migliorare ulteriormente le prestazioni. Con le posizioni risolte, possiamo studiare la capacità di estrapolazione logica dei transformer. Riescono a risolvere problemi aritmetici più grandi e complessi rispetto a quelli presenti nei loro dati di addestramento? Scopriamo che, addestrando su numeri di sole 20 cifre con una singola GPU per un giorno, possiamo raggiungere prestazioni all'avanguardia, ottenendo fino al 99% di accuratezza su problemi di addizione con 100 cifre. Infine, dimostriamo che questi guadagni nella capacità numerica sbloccano anche miglioramenti in altri compiti di ragionamento multi-step, inclusi l'ordinamento e la moltiplicazione.
English
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.
PDF542December 12, 2024