Arithmetic with Language Models: from Memorization to Computation

Davide Maltoni, Matteo Ferrara
8/2/2023
cs.AIcs.CL

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

A better understanding of the emergent computation and problem-solving capabilities of recent large language models is of paramount importance to further improve them and broaden their applicability. This work investigates how a language model, trained to predict the next token, can perform arithmetic computations generalizing beyond training data.

Show full abstract

Binary addition and multiplication constitute a good testbed for this purpose, since they require a very small vocabulary and exhibit relevant input/output discontinuities making smooth input interpolation ineffective for novel data. We successfully trained a light language model to learn these tasks and ran a number of experiments to investigate the extrapolation capabilities and internal information processing. Our findings support the hypothesis that the language model works as an Encoding-Regression-Decoding machine where the computation takes place in the value space once the input token representation is mapped to an appropriate internal representation.

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. 1 weaker match is 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{maltoni2023arithmetic,
  title  = {Arithmetic with Language Models: from Memorization to Computation},
  author = {Davide Maltoni and Matteo Ferrara},
  year   = {2023},
  eprint = {2308.01154},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.01154v4}
}

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/2308.01154.svg)](https://codeofpaper.com/paper/2308.01154)

Discussion