NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Measuring Arithmetic Extrapolation Performance

Andreas Madsen, Alexander Rosenberg JohansenarXiv 2019

Abstract

Neural Arithmetic Logic Units (NALUs) were designed to enable neural networks to learn exact arithmetic and extrapolate to unseen numerical ranges. However, standard evaluation metrics like Mean Squared Error (MSE) often mask the inherent unreliability and initialization sensitivity of these models. This paper introduces a rigorous "success-criterion" metric to evaluate NALUs across multiple initialization seeds. Our findings reveal that NALUs are highly unstable, frequently failing to learn basic operations such as multiplication and division, and that their performance is significantly impacted by architectural choices and dataset characteristics.

Introduction

Standard neural networks struggle with arithmetic extrapolation, often memorizing patterns within the training range rather than learning underlying logical rules. For instance, a network trained on addition within [1, 10] typically fails when tested on [100, 200]. The Neural Arithmetic Logic Unit (NALU) was proposed to address this via specific inductive biases. However, current evaluation methods relying on single-instance MSE are insufficient. They fail to capture whether a model has truly learned the discrete logic and hide the extreme sensitivity to random initialization. A model might succeed on one seed but fail on the next 99, a fact obscured by reporting only the best or average MSE.

Methodology

We propose a binary success-criterion to replace continuous MSE. Arithmetic logic is discrete; a model has either learned the rule or it hasn't. We define success as achieving a test MSE below a threshold $\epsilon = 10^{-5}$, representing a "nearly-perfect" solution. To ensure robustness, we report the success rate over 100 random seeds with binomial confidence intervals. Additionally, we track convergence time (the iteration step at which success is achieved) and sparsity error, which measures how closely NALU weights approach the ideal discrete values of $\{-1, 0, 1\}$.

Experimental Setup

We utilize a generalized "Simple Function Learning Tasks" benchmark. The task involves generating a vector of real numbers, summing two random subsets, and applying an arithmetic operation ($+, -, \times, \div$) to those sums. Models are trained on an interpolation range (e.g., [1, 2]) and evaluated on an extrapolation range (e.g., [10, 20]) to test logical generalization.

Results and Analysis

Our large-scale evaluation (4,800 experiments) shows that while isolated sub-units like NAC$_+$ are reliable for addition/subtraction (100% success), the full NALU model struggles significantly, achieving only a 14% success rate. Multiplication and division are particularly problematic; the full NALU achieved a 0% success rate across all seeds for these operations.

Performance metrics (success rate, convergence time, and sparsity error) across different interpolation ranges.

As shown in Figure 5, success rates are highly sensitive to the interpolation range. Even when models succeed, they often require between $10^4$ and $10^6$ iterations to converge. Furthermore, sparsity is not guaranteed; even successful models do not always achieve perfectly discrete weights, challenging the assumption that NALU parameters naturally bias toward sparse values.

Success rate sensitivity to architectural parameters (Hidden Size, Input Size) and dataset characteristics (Overlap Ratio, Subset Ratio).

Figure 1 illustrates that success rates are also sensitive to architectural choices. Notably, increasing hidden size beyond a small threshold can actually degrade performance, and the full NALU consistently underperforms its isolated NAC components.

Conclusion

The reliance on single-instance MSE in arithmetic tasks is misleading and masks model instability. We advocate for the adoption of success rates over multiple seeds as a standard metric to provide a transparent view of model reliability. Future research must address the high sensitivity to initialization and the failure of current architectures to reliably learn non-linear operations like multiplication and division.

Summary updated

BibTeX
@misc{madsen2019measuring,
  author = {Andreas Madsen and Alexander Rosenberg Johansen},
  title = {{Measuring Arithmetic Extrapolation Performance}},
  year = {2019},
  eprint = {1910.01888},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.01888},
}
Figure