RevOrder: A Novel Method for Enhanced Arithmetic in Language Models

Si Shen, Peijun Shen, Danhao Zhu
2/6/2024
cs.AIcs.CLcs.LG

No confident code implementation found for this paper.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{shen2024revorder,
  title  = {RevOrder: A Novel Method for Enhanced Arithmetic in Language Models},
  author = {Si Shen and Peijun Shen and Danhao Zhu},
  year   = {2024},
  eprint = {2402.03822},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.03822v2}
}

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

Discussion