Introduction
Large Language Models (LLMs) have demonstrated remarkable capabilities across various domains, yet arithmetic remains a persistent "Achilles' heel." This struggle stems largely from their autoregressive nature: LLMs predict tokens from left to right. In standard Big-Endian notation, the most significant digit (e.g., the "1" in 123) is processed first. However, arithmetic logic typically flows from right to left, as the value of leading digits often depends on "carries" generated by less significant digits. This creates a "reversed computation order" problem where models must commit to complex leading digits before computing the simpler ones.
The LEFT Method: Little-Endian Fine-Tuning
To address this misalignment, we introduce LEFT (Little-Endian Fine-Tuning). The core innovation is reversing numerical representations during training so the model predicts the least significant digit first.
As shown in Figure 1, a number like 72,001 is represented as 1-0-0-2-7. This shift fundamentally changes the computational complexity. In Big-Endian, predicting a digit requires accounting for potential carries across all subsequent positions, leading to exponential complexity growth. In Little-Endian, because the model can infer the carry from previously generated tokens, complexity becomes linear.
For addition and subtraction, the model predicts results directly in reverse order. Multiplication, being inherently more complex, utilizes a "Little-Endian Step-by-Step" approach that decomposes the problem into intermediate products and cumulative sums, all maintained in reversed order.
Experimental Evaluation
We evaluated LEFT using a Llama2-13B backbone on a synthetic dataset of 18,000 cases (15,000 training, 3,000 test). Operations included addition, subtraction, and multiplication with numbers ranging from 5 to 12 digits to ensure a balanced difficulty distribution.
Performance and Efficiency
LEFT achieved an overall accuracy of 94.4%, a significant 11.1% improvement over the previous state-of-the-art (83.3%). The most dramatic gains were observed in multiplication, which saw a 35.7% accuracy boost.
Beyond raw accuracy, LEFT demonstrates exceptional token efficiency. As illustrated in Figure 3, Little-Endian models (orange and red lines) achieve high accuracy with significantly fewer tokens than Big-Endian counterparts. For addition and subtraction, LEFT reached near-perfect accuracy using only 1/20th of the tokens required by "Detailed-Scratchpad" methods. This suggests that the verbosity of current "Chain-of-Thought" reasoning is often a byproduct of suboptimal data formatting rather than a fundamental requirement for LLM logic.
Key Insights
Analysis of the model's internal attention mechanisms (specifically at layer 22 of Llama2-13B) reveals that the model learns to "re-compute" carries on the fly by looking back at previously generated digits. By reversing the order, the model's attention maps align digits from the ones-place upward, mirroring human long-addition techniques.
Conclusion and Future Work
LEFT proves that decoding order is a critical factor in LLM arithmetic performance. By aligning the model's output with the natural flow of arithmetic logic, we achieve higher accuracy with drastically reduced computational costs. Future research will explore extending this method to more complex operations like division and roots, and investigate whether Little-Endian pre-training can produce "math-native" models that excel at calculation without specialized fine-tuning.
Summary updated