[Paper Review] Goat: Fine-tuned LLaMA Outperforms GPT-4 on Arithmetic Tasks
Goat-7B, a fine-tuned LLaMA model, achieves state-of-the-art performance on elementary arithmetic tasks and, in zero-shot, matches or surpasses GPT-4 on several BIG-bench arithmetic sub-tasks by using supervised fine-tuning and a learnable task decomposition strategy for complex operations.
We introduce Goat, a fine-tuned LLaMA model that significantly outperforms GPT-4 on a range of arithmetic tasks. Fine-tuned on a synthetically generated dataset, Goat achieves state-of-the-art performance on BIG-bench arithmetic sub-task. In particular, the zero-shot Goat-7B matches or even surpasses the accuracy achieved by the few-shot PaLM-540B. Surprisingly, Goat can achieve near-perfect accuracy on large-number addition and subtraction through supervised fine-tuning only, which is almost impossible with previous pretrained language models, such as Bloom, OPT, GPT-NeoX, etc. We attribute Goat's exceptional performance to LLaMA's consistent tokenization of numbers. To tackle more challenging tasks like large-number multiplication and division, we propose an approach that classifies tasks based on their learnability, and subsequently decomposes unlearnable tasks, such as multi-digit multiplication and division, into a series of learnable tasks by leveraging basic arithmetic principles. We thoroughly examine the performance of our model, offering a comprehensive evaluation of the effectiveness of our proposed decomposition steps. Additionally, Goat-7B can be easily trained using LoRA on a 24GB VRAM GPU, facilitating reproducibility for other researchers. We release our model, dataset, and the Python script for dataset generation.
Motivation & Objective
- Motivate the development of an open-source arithmetic-capable LLM that can surpass closed models on basic arithmetic tasks.
- Demonstrate that supervised fine-tuning on a synthetic dataset can yield near-perfect addition/subtraction accuracy for large numbers without special prompting tricks.
- Investigate the learnability of arithmetic tasks and introduce a decomposition-based CoT strategy to tackle multi-digit multiplication and division.
- Assess the role of tokenization, especially consistent digit-level tokenization in LLaMA, in arithmetic performance.
- Provide an experimentally reproducible pipeline (dataset, model, and dataset generator) that can be replicated via LoRA on modest hardware.
Proposed method
- Fine-tune LLaMA-7B on ~1 million synthetic QA pairs for arithmetic tasks using an end-to-end supervised instruction-tuning approach.
- Exploit LLaMA’s digit-level tokenization to enable direct numeric outputs for addition/subtraction without chain-of-thought prompts.
- Categorize arithmetic tasks into learnable and unlearnable; decompose unlearnable tasks (multi-digit multiplication/division) into a sequence of learnable subtasks via a CoT-like intermediate supervision.
- Develop a specific five-step decomposition for multiplication (extraction, split, expansion, product, adding term by term) to enable solve-and-sum style computation.
- Design a slow-division CoT for division that iteratively builds the quotient via digit-wise subtraction using intermediate tasks (n-digit by 1-digit multiplication, copying, subtraction, etc.).
- Train with LoRA on 24 GB VRAM to enable accessible reproduction on common GPUs; release model, dataset, and dataset-generation scripts.
Experimental results
Research questions
- RQ1Can supervised fine-tuning on synthetic arithmetic data enable an open-source LLM to outperform closed models on arithmetic tasks?
- RQ2To what extent does LLaMA’s consistent digit-level tokenization contribute to arithmetic accuracy compared with other open models?
- RQ3How can unlearnable arithmetic tasks (like multi-digit multiplication/division) be made learnable through intermediate supervision and task decomposition?
- RQ4Does a CoT-style intermediate supervision improve final numeric outputs for complex arithmetic tasks, and how does it compare to direct generation?
- RQ5What are the limits of extrapolation for a fine-tuned arithmetic model when faced with numbers beyond the training distribution?
Key findings
- Goat-7B achieves state-of-the-art performance on elementary arithmetic tasks (addition, subtraction, multiplication, division) on BIG-bench arithmetic sub-tasks.
- In zero-shot, Goat-7B matches or surpasses the accuracy of the few-shot PaLM-540B on BIG-bench arithmetic tasks.
- For large-number addition and subtraction, supervised fine-tuning alone yields near-perfect accuracy without chain-of-thought prompting.
- Multi-digit multiplication and division are unlearnable without decomposition; applying a five-step CoT decomposition enables learning of these tasks.
- Goat-7B trained with LoRA on a 24GB GPU is easily reproducible; the authors release the model, dataset, and dataset-generation scripts.
- The decomposition-based CoT approach outperforms GPT-4’s long multiplication/division methods on the targeted tasks and highlights the importance of intermediate supervision.
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.