Neural Arithmetic Units
Andreas Madsen, Alexander Rosenberg Johansen
Abstract
Neural networks can approximate complex functions, but they struggle to perform exact arithmetic operations over real numbers. The lack of inductive bias for arithmetic operations leaves neural networks without the underlying logic necessary to extrapolate on tasks such as addition, subtraction, and multiplication. We present two new neural network components: the Neural Addition Unit (NAU), which can learn exact addition and subtraction; and the Neural Multiplication Unit (NMU) that can multiply subsets of a vector. The NMU is, to our knowledge, the first arithmetic neural network component that can learn to multiply elements from a vector, when the hidden size is large. The two new components draw inspiration from a theoretical analysis of recently proposed arithmetic components. We find that careful initialization, restricting parameter space, and regularizing for sparsity is important when optimizing the NAU and NMU. Our proposed units NAU and NMU, compared with previous neural units, converge more consistently, have fewer parameters, learn faster, can converge for larger hidden sizes, obtain sparse and meaningful weights, and can extrapolate to negative and small values.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext d450b40f-2b78-45a7-a5d1-6122fa8724b5Cited by top-tier papers7
- How Neural Networks Extrapolate: From Feedforward to Graph Neural NetworksKeyulu Xu, Mozhi Zhang, Jingling Li, Simon Shaolei Du et al.ICLR 2021 · 364 citations
- MC-LSTM: Mass-Conserving LSTMPieter-Jan Hoedt, Frederik Kratzert, Daniel Klotz, Christina Halmich et al.ICML 2021 · 75 citations
- StateFormer: fine-grained type recovery from binaries using generative state modelingKexin Pei, Jonas Guan, Matthew Broughton, Zhongtian Chen et al.FSE 2021 · 53 citations
- An Empirical Investigation of Contextualized Number PredictionTaylor Berg-Kirkpatrick, Daniel SpokoynyEMNLP 2020 · 34 citations
- Neural Status RegistersLukas Faber, Roger WattenhoferICML 2023 · 9 citations
Related papers
- Neural Power UnitsNiklas Heim, Tomás Pevný, Václav SmídlNeurIPS 2020 · 14 citations
- Learning to Add, Multiply, and Execute Algorithmic Instructions Exactly with Neural NetworksArtur Back de Luca, George Giapitzakis, Kimon FountoulakisNeurIPS 2025 · 4 citations
- NACU: A Non-Linear Arithmetic Unit for Neural NetworksGuido Baccelli, Dimitrios Stathis, Ahmed Hemani, Maurizio MartinaDAC 2020 · 11 citations
- Memorization Capacity of Neural Networks with Conditional ComputationErdem KoyuncuICLR 2023
- Floating-Point Neural Networks are Provably Robust Universal ApproximatorsGeonho Hwang, Wonyeol Lee, Yeachan Park, Sejun Park et al.CAV 2025
