Table of Contents
Fetching ...

Language Models Do Hard Arithmetic Tasks Easily and Hardly Do Easy Arithmetic Tasks

Andrew Gambardella, Yusuke Iwasawa, Yutaka Matsuo

TL;DR

This work investigates arithmetic capabilities of autoregressive LLMs using Monte Carlo Dropout to obtain uncertainty estimates on open-weight models. It reveals a surprising dichotomy: the first digit of $n$-digit by $m$-digit products can be predicted confidently without decomposition, while the last digit is unreliable unless higher-order digits are conditioned. Conditioning on correct higher digits can significantly boost last-digit confidence (e.g., from $0.13$ to $0.43$ for $Llama ext{-}2 ext{-}13B$ and from $0.22$ to $0.55$ for $Mistral ext{-}7B$). The findings illuminate unexpected internal-state dynamics of LLMs in arithmetic tasks and connect to broader discussions on hallucination detection, while noting that results are restricted to open-weight models with dropout-trained weights and may not generalize to closed, state-of-the-art systems.

Abstract

The ability (and inability) of large language models (LLMs) to perform arithmetic tasks has been the subject of much theoretical and practical debate. We show that LLMs are frequently able to correctly and confidently predict the first digit of n-digit by m-digit multiplication tasks without using chain of thought reasoning, despite these tasks require compounding operations to solve. Simultaneously, LLMs in practice often fail to correctly or confidently predict the last digit of an n-digit by m-digit multiplication, a task equivalent to 1-digit by 1-digit multiplication which can be easily learned or memorized. We show that the latter task can be solved more robustly when the LLM is conditioned on all of the correct higher-order digits, which on average increases the confidence of the correct last digit on 5-digit by 5-digit multiplication tasks using Llama 2-13B by over 230% (0.13 to 0.43) and Mistral-7B by 150% (0.22 to 0.55).

Language Models Do Hard Arithmetic Tasks Easily and Hardly Do Easy Arithmetic Tasks

TL;DR

This work investigates arithmetic capabilities of autoregressive LLMs using Monte Carlo Dropout to obtain uncertainty estimates on open-weight models. It reveals a surprising dichotomy: the first digit of -digit by -digit products can be predicted confidently without decomposition, while the last digit is unreliable unless higher-order digits are conditioned. Conditioning on correct higher digits can significantly boost last-digit confidence (e.g., from to for and from to for ). The findings illuminate unexpected internal-state dynamics of LLMs in arithmetic tasks and connect to broader discussions on hallucination detection, while noting that results are restricted to open-weight models with dropout-trained weights and may not generalize to closed, state-of-the-art systems.

Abstract

The ability (and inability) of large language models (LLMs) to perform arithmetic tasks has been the subject of much theoretical and practical debate. We show that LLMs are frequently able to correctly and confidently predict the first digit of n-digit by m-digit multiplication tasks without using chain of thought reasoning, despite these tasks require compounding operations to solve. Simultaneously, LLMs in practice often fail to correctly or confidently predict the last digit of an n-digit by m-digit multiplication, a task equivalent to 1-digit by 1-digit multiplication which can be easily learned or memorized. We show that the latter task can be solved more robustly when the LLM is conditioned on all of the correct higher-order digits, which on average increases the confidence of the correct last digit on 5-digit by 5-digit multiplication tasks using Llama 2-13B by over 230% (0.13 to 0.43) and Mistral-7B by 150% (0.22 to 0.55).
Paper Structure (13 sections, 3 figures, 2 tables)

This paper contains 13 sections, 3 figures, 2 tables.

Figures (3)

  • Figure 1: Confidence and accuracy of Llama 2-7B and Llama 2-13B predicting the first digit of the result of $592*392$. Both language models are able to confidently and correctly predict that the first digit should be $2$, despite this not being immediately apparent from the problem.
  • Figure 2: Confidence and accuracy of Llama 2-7B and Llama 2-13B predicting the sixth digit of the result of $592*392$. Neither are able to predict this digit confidently, with the mode of the distribution on the "end string" character in both cases. Both only output $4$ in about 20% of samples, despite it being immediately apparent that the final digit should be $4$.
  • Figure 3: Confidence and accuracy of Llama 2-7B and Llama 2-13B predicting the last digit of the result of $592*392$, when conditioned on the first five correct digits. The confidence in the correct answer being $4$ doubles for Llama 2-7B and more than triples for Llama 2-13B, despite the computation of the last digit not depending on the prior digits being correct at all.