This paper presents RevOrder, a novel technique aimed at improving arithmetic operations in large language models (LLMs) by reversing the output digits in addition, subtraction, and n-digit by 1-digit (nD by 1D) multiplication tasks. Our method significantly reduces the Count of Sequential Intermediate Digits (CSID) to $\mathcal{O}(1)$, a new metric we introduce to assess equation complexity. Through comprehensive testing, RevOrder not only achieves perfect accuracy in basic arithmetic operations but also substantially boosts LLM performance in division tasks, particularly with large numbers where traditional models struggle. Implementation of RevOrder is cost-effective for both training and inference phases. Moreover, applying RevOrder to fine-tune the LLaMA2-7B model on the GSM8K math task results in a considerable improvement, reducing equation calculation errors by 46% and increasing overall scores from 41.6 to 44.4.
翻译:本文提出RevOrder,一种通过反转加法、减法及n位数乘以1位数(nD×1D)任务中输出数字来提升大语言模型算术运算能力的新技术。该方法显著降低了顺序中间位计数(CSID)至$\mathcal{O}(1)$——我们引入的用于评估方程复杂度的新指标。经过全面测试,RevOrder不仅在基本算术运算中达到完美精度,还大幅提升了LLM在除法任务中的表现,尤其在传统模型难以处理的大数运算中效果显著。RevOrder的实现对训练和推理阶段均具有成本效益。此外,将RevOrder应用于GSM8K数学任务微调LLaMA2-7B模型,可使方程计算错误率降低46%,整体得分从41.6提升至44.4。