Lune

ICML2024顶会

Case-Based or Rule-Based: How Do Transformers Do the Math?

Yi Hu, Xiaojuan Tang, Haotong Yang, Muhan Zhang

摘要

Despite the impressive performance in a variety of complex tasks, modern large language models (LLMs) still have trouble dealing with some math problems that are simple and intuitive for humans, such as addition. While we can easily learn basic rules of addition and apply them to new problems of any length, LLMs struggle to do the same. Instead, they may rely on similar cases seen in the training corpus for help. We define these two different reasoning mechanisms as "rule-based reasoning" and "case-based reasoning". Since rule-based reasoning is essential for acquiring systematic generalization ability, we aim to explore exactly whether transformers use rule-based or case-based reasoning for math problems. Through carefully designed intervention experiments on five math tasks, we confirm that transformers are performing case-based reasoning, no matter whether scratchpad is used, which aligns with the previous observations that transformers use subgraph matching/shortcut learning to reason. To mitigate such problems, we propose a Rule-Following Fine-Tuning (RFFT) technique to teach transformers to perform rule-based reasoning. Specifically, we provide explicit rules in the input and then instruct transformers to recite and follow the rules step by step. Through RFFT, we successfully enable LLMs fine-tuned on 1-5 digit addition to generalize to up to 12digit addition with over 95% accuracy, which is over 40% higher than scratchpad. The significant improvement demonstrates that teaching LLMs to use rules explicitly helps them learn rulebased reasoning and generalize better in length.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 19 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Beyond Single-Task: Robust Multi-Task Length Generalization for LLMs 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Large Language Models are Zero-Shot Reasoners 引用了 Language Models are Few-Shot Learners
  • Large Language Models are Zero-Shot Reasoners 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Embedding Trajectory for Out-of-Distribution Detection in Mathematical Reasoning 引用了 Large Language Models are Zero-Shot Reasoners
  • Embedding Trajectory for Out-of-Distribution Detection in Mathematical Reasoning 引用了 Language Models are Few-Shot Learners
  • Embedding Trajectory for Out-of-Distribution Detection in Mathematical Reasoning 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • What Can Transformers Learn In-Context? A Case Study of Simple Function Classes 引用了 Language Models are Few-Shot Learners
  • What Can Transformers Learn In-Context? A Case Study of Simple Function Classes 引用了 Are Transformers universal approximators of sequence-to-sequence functions?
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper19

  1. Embedding Trajectory for Out-of-Distribution Detection in Mathematical ReasoningYiming Wang, Pei Zhang, Baosong Yang, Derek F. Wong 等NeurIPS 2024 · 23 次引用
  2. Mixture-of-Experts Can Surpass Dense LLMs Under Strictly Equal ResourceHouyi Li, Ka Man Lo, Shijie Xuyang, Ziqi Wang 等ICLR 2026 · 8 次引用
  3. Beyond Single-Task: Robust Multi-Task Length Generalization for LLMsYi Hu, Shijia Kang, Haotong Yang, Haotian Xu 等NeurIPS 2025 · 6 次引用
  4. Physically Ground Commonsense Knowledge for Articulated Object Manipulation with Analytic ConceptsJiude Wei, Yuxuan Li, Cewu Lu, Jianhua SunCVPR 2026 · 6 次引用
  5. Curing Miracle Steps in LLM Mathematical Reasoning with Rubric RewardsYouliang Yuan, Qiuyang Mang, Jingbang Chen, Hong Wan 等ACL 2026 · 5 次引用

它引用的 Paper21

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
  2. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  3. Large Language Models are Zero-Shot ReasonersTakeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo 等NeurIPS 2022 · 8,168 次引用
  4. What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 次引用
  5. Are Transformers universal approximators of sequence-to-sequence functions?Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J. Reddi 等ICLR 2020 · 481 次引用

相关 Paper

  1. Exploring the Hidden Reasoning Process of Large Language Models by Misleading ThemGuanyu Chen, Peiyang Wang, Yizhou Jiang, Yuqian Liu 等EMNLP Findings 2025
  2. Exploring Length Generalization in Large Language ModelsCem Anil, Yuhuai Wu, Anders Andreassen, Aitor Lewkowycz 等NeurIPS 2022 · 267 次引用
  3. Memory or Reasoning? Explore How LLMs Compute Mixed Arithmetic ExpressionsChengzhi Li, Heyan Huang, Ping Jian, Zhen Yang 等ACL Findings 2025
  4. ReFT: Reasoning with Reinforced Fine-TuningLuong Quoc Trung, Xinbo Zhang, Zhanming Jie, Peng Sun 等ACL 2024
  5. Incentivizing LLM Reasoning via Reinforcement Learning with Functional Monte Carlo Tree SearchKongcheng Zhang, QI YAO, Baisheng Lai, Jiaxing Huang 等ICLR 2026
黄昏的海面,两侧是细线勾勒的悬崖