[Paper Review] Evaluating Transformer Language Models on Arithmetic Operations Using Number Decomposition
The paper introduces Calculon, a GPT-2 model fine-tuned to perform arithmetic by decomposing numbers into digits (units, tens, etc.), demonstrating strong results on addition/subtraction with unseen numbers but limited gains for multiplication and in GPT-3 few-shot settings.
In recent years, Large Language Models such as GPT-3 showed remarkable capabilities in performing NLP tasks in the zero and few shot settings. On the other hand, the experiments highlighted the difficulty of GPT-3 in carrying out tasks that require a certain degree of reasoning, such as arithmetic operations. In this paper we evaluate the ability of Transformer Language Models to perform arithmetic operations following a pipeline that, before performing computations, decomposes numbers in units, tens, and so on. We denote the models fine-tuned with this pipeline with the name Calculon and we test them in the task of performing additions, subtractions and multiplications on the same test sets of GPT-3. Results show an increase of accuracy of 63% in the five-digit addition task. Moreover, we demonstrate the importance of the decomposition pipeline introduced, since fine-tuning the same Language Model without decomposing numbers results in 0% accuracy in the five-digit addition task.
Motivation & Objective
- Assess whether Transformer Language Models can learn arithmetic on unseen numbers with varying digit lengths.
- Propose a number decomposition pipeline that guides LMs to perform digit-wise computations like humans.
- Evaluate fine-tuned GPT-2 (Calculon) and GPT-2 baselines, plus GPT-3 few-shot performance, on addition, subtraction, and multiplication tasks.
Proposed method
- Fine-tune GPT-2 models on datasets for 2–5 digit additions and subtractions using a decomposition pipeline that translates numbers into units, tens, hundreds, etc., and reconstructs the result.
- Create a baseline where numbers are input without decomposition to compare performance.
- Experiment with a spaced pipeline where digits are spaced to test tokenization effects.
- Evaluate GPT-3 with few-shot prompts, including a decomposition-based prompt variant.
- Use greedy decoding for GPT-2 and temperature-based sampling for GPT-3; assess accuracy on test sets not overlapping training data.
Experimental results
Research questions
- RQ1Can Transformer LMs generalize arithmetic to unseen numbers when trained with a digit-decomposition pipeline?
- RQ2How does decomposing numbers into digit-place values affect learning of addition, subtraction, and multiplication?
- RQ3Is the decomposition approach sufficient for higher-digit multiplication, or does multiplication require higher reasoning?
- RQ4Do tokenization strategies (decomposition vs. spaced digits) influence numeracy in LMs?
- RQ5What is GPT-3’s responsiveness to decomposition in few-shot settings?
Key findings
- Calculon achieves high accuracy on 2D+, 3D+, 4D+, 5D+ for addition and subtraction, with notably lower performance on 2Dx (2-digit multiplication).
- A GPT-2 model fine-tuned without decomposition performs poorly on 4D–5D tasks, showing the decomposition pipeline is critical for learning arithmetic.
- Spaced digits improve over Baseline but Calculon still outperforms, indicating magnitude-aware decomposition provides significant benefits.
- GPT-3 in few-shot without decomposition matches near-top GPT-3 results for some tasks, but applying decomposition in few-shot prompts markedly degrades performance (GPT-3 FS decomp).
- Decomposition enables LMs to learn digit-wise operations (units with units, tens with tens, etc.), but multiplication remains challenging, suggesting higher reasoning is required.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.