Exploring the Compositional Deficiency of Large Language Models in Mathematical Reasoning

Jun Zhao, Jingqi Tong, Yurong Mou, Ming Zhang, Qi Zhang +1 more
5/5/2024
27 citations
cs.CLcs.AI

Official code: tongjingqi/MathTrap (60 stars, Python, Apache-2.0, last commit 2025-03-15).

Abstract

Human cognition exhibits systematic compositionality, the algebraic ability to generate infinite novel combinations from finite learned components, which is the key to understanding and reasoning about complex logic. In this work, we investigate the compositionality of large language models (LLMs) in mathematical reasoning.

Show full abstract

Specifically, we construct a new dataset \textsc{MathTrap} by introducing carefully designed logical traps into the problem descriptions of MATH and GSM8K. Since problems with logical flaws are quite rare in the real world, these represent "unseen" cases to LLMs. Solving these requires the models to systematically compose (1) the mathematical knowledge involved in the original problems with (2) knowledge related to the introduced traps. Our experiments show that while LLMs possess both components of requisite knowledge, they do not \textbf{spontaneously} combine them to handle these novel cases. We explore several methods to mitigate this deficiency, such as natural language prompts, few-shot demonstrations, and fine-tuning. Additionally, we test the recently released OpenAI o1 model and find that human-like `slow thinking' helps improve the compositionality of LLMs. Overall, systematic compositionality remains an open challenge for large language models.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

In this work, we investigate the compositionality of large language models (LLMs) in mathematical reasoning. Specifically, we construct a new dataset MATHTRAP‡ by introducing carefully designed logical traps into the problem descriptions of MATH and GSM8K.

601Python, ShellMay 5, 20241 years agoApache-2.0
mathreasoning

Similar Papers

Cite this paper

@article{zhao2024exploring,
  title  = {Exploring the Compositional Deficiency of Large Language Models in Mathematical Reasoning},
  author = {Jun Zhao and Jingqi Tong and Yurong Mou and Ming Zhang and Qi Zhang and Xuanjing Huang},
  year   = {2024},
  eprint = {2405.06680},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.06680v4}
}

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

Discussion