让大模型像图灵机一样算数,突破记忆式计算瓶颈
Executing Arithmetic: Fine-Tuning Large Language Models as Turing Machines
- 用图灵机模拟让模型学会分步执行算术逻辑
- 在100位数字运算上达到近100%准确率
- 可组合算子,适合需要精准计算的场景
大型语言模型在自然语言处理和推理任务中表现出色,但在基础算术领域表现仍不理想。面对算术任务时,它们常依赖记忆而非掌握底层计算逻辑,导致泛化能力受限。本文提出可组合算术执行框架(CAEF),使大模型通过模拟图灵机来逐步执行计算,从而真正理解计算逻辑。该框架高度可扩展,可通过组合已学算子显著降低复杂算子的学习难度。实验表明,在LLaMA 3.1-8B模型上,CAEF在七种常见数学运算中达到近100%准确率,支持最多100位数字的运算,而GPT-4o在部分情形下表现明显不足。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have demonstrated remarkable capabilities across a wide range of natural language processing and reasoning tasks. However, their performance in the foundational domain of arithmetic remains unsatisfactory. When dealing with arithmetic tasks, LLMs often memorize specific examples rather than learning the underlying computational logic, limiting their ability to generalize to new problems. In this paper, we propose a Composable Arithmetic Execution Framework (CAEF) that enables LLMs to learn to execute step-by-step computations by emulating Turing Machines, thereby gaining a genuine understanding of computational logic. Moreover, the proposed framework is highly scalable, allowing composing learned operators to significantly reduce the difficulty of learning complex operators. In our evaluation, CAEF achieves nearly 100% accuracy across seven common mathematical operations on the LLaMA 3.1-8B model, effectively supporting computations involving operands with up to 100 digits, a level where GPT-4o falls short noticeably in some settings.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。