Saved in:
Bibliographic Details
Main Authors: Chang, Fu-Chieh, Lin, You-Chen, Wu, Pei-Yuan
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2411.16260
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913800583643136
author Chang, Fu-Chieh
Lin, You-Chen
Wu, Pei-Yuan
author_facet Chang, Fu-Chieh
Lin, You-Chen
Wu, Pei-Yuan
contents Large language models (LLMs) have demonstrated remarkable mathematical capabilities, largely driven by chain-of-thought (CoT) prompting, which decomposes complex reasoning into step-by-step solutions. This approach has enabled significant advancements, as evidenced by performance on benchmarks like GSM8K and MATH. However, the mechanisms underlying LLMs' ability to perform arithmetic in a single step of CoT remain poorly understood. Existing studies debate whether LLMs encode numerical values or rely on symbolic reasoning, while others explore attention and multi-layered processing in arithmetic tasks. In this work, we propose that LLMs learn arithmetic by capturing algebraic structures, such as commutativity and identity properties. Since these structures are observable through input-output relationships, they can generalize to unseen data. We empirically demonstrate that LLMs can learn algebraic structures using a custom dataset of arithmetic problems, as well as providing theoretical evidence showing that, under specific configurations of weights and biases, the transformer-based LLMs can generate embeddings that remain invariant to both permutations of input tokens and the presence of identity elements. Our findings indicate that leveraging algebraic structures can enhance the LLMs' arithmetic capabilities, offering insights into improving their arithmetic performance.
format Preprint
id arxiv_https___arxiv_org_abs_2411_16260
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Unraveling Arithmetic in Large Language Models: The Role of Algebraic Structures
Chang, Fu-Chieh
Lin, You-Chen
Wu, Pei-Yuan
Machine Learning
Computation and Language
Large language models (LLMs) have demonstrated remarkable mathematical capabilities, largely driven by chain-of-thought (CoT) prompting, which decomposes complex reasoning into step-by-step solutions. This approach has enabled significant advancements, as evidenced by performance on benchmarks like GSM8K and MATH. However, the mechanisms underlying LLMs' ability to perform arithmetic in a single step of CoT remain poorly understood. Existing studies debate whether LLMs encode numerical values or rely on symbolic reasoning, while others explore attention and multi-layered processing in arithmetic tasks. In this work, we propose that LLMs learn arithmetic by capturing algebraic structures, such as commutativity and identity properties. Since these structures are observable through input-output relationships, they can generalize to unseen data. We empirically demonstrate that LLMs can learn algebraic structures using a custom dataset of arithmetic problems, as well as providing theoretical evidence showing that, under specific configurations of weights and biases, the transformer-based LLMs can generate embeddings that remain invariant to both permutations of input tokens and the presence of identity elements. Our findings indicate that leveraging algebraic structures can enhance the LLMs' arithmetic capabilities, offering insights into improving their arithmetic performance.
title Unraveling Arithmetic in Large Language Models: The Role of Algebraic Structures
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2411.16260