Memory or Reasoning? Explore How LLMs Compute Mixed Arithmetic Expressions
Chengzhi Li, Heyan Huang, Ping Jian, Zhen Yang, Chenxu Wang, Yifan Wang
Abstract
Large language models (LLMs) can solve complex multi-step math reasoning problems, but little is known about how these computations are implemented internally. Many recent studies have investigated the mechanisms of LLMs on simple arithmetic tasks (e.g., a+b, a× b), but how LLMs solve mixed arithmetic tasks still remains unexplored. This gap highlights the limitation of these findings in reflecting real-world scenarios. In this work, we take a step further to explore how LLMs compute mixed arithmetic expressions. We find that LLMs follow a similar workflow to mixed arithmetic calculations: first parsing the complete expression, then using attention heads to aggregate information to the last token position for result generation, without step-by-step reasoning at the token dimension. However, **for some specific expressions, the model generates the final result depends on the generation of intermediate results at the last token position, which is similar to human thinking.** Furthermore, we propose a **C**ausal **E**ffect **D**riven **F**ine-tuning method (CEDF) to adaptively enhance the identified key components used to execute mixed arithmetic calculations to improve LLMs reasoning ability.- Anthology ID:
- 2025.findings-acl.299
- Volume:
- Findings of the Association for Computational Linguistics: ACL 2025
- Month:
- July
- Year:
- 2025
- Address:
- Vienna, Austria
- Editors:
- Wanxiang Che, Joyce Nabende, Ekaterina Shutova, Mohammad Taher Pilehvar
- Venue:
- Findings
- SIG:
- Publisher:
- Association for Computational Linguistics
- Note:
- Pages:
- 5742–5763
- Language:
- URL:
- https://preview.aclanthology.org/landing_page/2025.findings-acl.299/
- DOI:
- Cite (ACL):
- Chengzhi Li, Heyan Huang, Ping Jian, Zhen Yang, Chenxu Wang, and Yifan Wang. 2025. Memory or Reasoning? Explore How LLMs Compute Mixed Arithmetic Expressions. In Findings of the Association for Computational Linguistics: ACL 2025, pages 5742–5763, Vienna, Austria. Association for Computational Linguistics.
- Cite (Informal):
- Memory or Reasoning? Explore How LLMs Compute Mixed Arithmetic Expressions (Li et al., Findings 2025)
- PDF:
- https://preview.aclanthology.org/landing_page/2025.findings-acl.299.pdf