Papers › Neural Arithmetic Logic Units

Neural Arithmetic Logic Units

1 Aug 2018NeurIPS 2018 12arXiv:1808.00508archive 2025-07-28

Andrew Trask, Felix Hill, Scott Reed, Jack Rae, Chris Dyer, Phil Blunsom

Neural networks can learn to represent and manipulate numerical information, but they seldom generalize well outside of the range of numerical values encountered during training. To encourage more systematic numerical extrapolation, we propose an architecture that represents numerical quantities as linear activations which are manipulated using primitive arithmetic operators, controlled by learned gates. We call this module a neural arithmetic logic unit (NALU), by analogy to the arithmetic logic unit in traditional processors. Experiments show that NALU-enhanced neural networks can learn to track time, perform arithmetic over images of numbers, translate numerical language into real-valued scalars, execute computer code, and count objects in images. In contrast to conventional architectures, we obtain substantially better generalization both inside and outside of the range of numerical values encountered during training, often extrapolating orders of magnitude beyond trained numerical ranges.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1808.00508")

Code

Syntology Ran 6 of 24 code samples harvested from 8 repositories linked to this paper; 18 have no recorded run. Of those that ran: 6 ran · our draft was wrong.

By repository: community (archive-listed): 24 samples from 8 repositories, 6 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

36 repositories listed; official and paper-mentioned ones first.

AnikMallick/NALU_tf mentioned on GitHubtf report
FlorianWilhelm/snalu.pytorch mentioned on GitHubpytorchMIT report
FrederikWarburg/latent_disagreement mentioned on GitHubpytorch report
Nilabhra/NALU mentioned on GitHubpytorch report
Ragabov/tensorflow-nalu mentioned on GitHubtfMIT report
acyrl/NALU mentioned on GitHubtfApache-2.0 report
ahylton19/simpleNALU-tf mentioned on GitHubtfMIT report
akilhylton/simpleNALU-tf mentioned on GitHubtfMIT report
arthurdouillard/nalu.pytorch mentioned on GitHubpytorchMIT report
bmistry4/nalm-benchmark mentioned on GitHubpytorchMIT report
dillondaudert/neural-alu mentioned on GitHubMIT report
grananqvist/NALU-tf mentioned on GitHubtf report
llealgt/NALUs mentioned on GitHubtf report
merrymercy/NALU mentioned on GitHubtfMIT report
nmheim/NeuralArithmetic.jl mentioned on GitHubMIT report
pushpulldecoder/Enhanced-NALU mentioned on GitHubpytorch report
sayakpaul/NALU mentioned on GitHubpytorch report
tejank10/NeuralALU.jl mentioned on GitHubpytorchNOASSERTION report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

24 samples harvested; 6 ran; 0 honoured the contract we drafted; 18 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

6ran · our draft was wrong
18unverified

Licence: 7 of the 24 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 8 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

generate_dataset grananqvist/NALU-tf/nalu.py community (archive-listed) ran · our draft was wrong fingerprinted no licence file found · pointer only · f6354fda6a1b24c3 · report
generate_ds shshemi/NeuralArithmeticLogicUnit/basic_operation_test.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 206d5718bbc9d36f · report
get_eval_loss Nilabhra/NALU/utilities/train_utils.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 93425add40eab6de · report
get_eval_preds Nilabhra/NALU/utilities/train_utils.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · c82bfe1c77a83835 · report
test FrederikWarburg/latent_disagreement/Experiments/NALU_all_we_need.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 634dd1dd6bda3381 · report
train Nilabhra/NALU/utilities/train_utils.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 8db99284cbba319d · report
NALU ahylton19/simpleNALU-tf/NALU.py community (archive-listed) unverified MIT (permissive) · c70a13cdc8217e8e · report
calc_nac_mnac_loss bmistry4/nalm-benchmark/misc/singularity_issue.py community (archive-listed) unverified MIT (permissive) · b80193f38302696b · report
calc_num_steps bmistry4/nalm-benchmark/misc/singularity_issue.py community (archive-listed) unverified MIT (permissive) · a9671ab549458806 · report
discrete_NAU_W_test bmistry4/nalm-benchmark/misc/utils.py community (archive-listed) unverified MIT (permissive) · 5a98a304d15b258e · report
do_operation bmistry4/nalm-benchmark/stable_nalu/dataset/single_layer_check.py community (archive-listed) unverified MIT (permissive) · 7b8f8d046f9d8109 · report
gd_paper acyrl/NALU/nalu/GenData.py community (archive-listed) unverified Apache-2.0 (permissive) · 17b7d41df774d236 · report
gd_paper acyrl/NALU/tf-prototype/GenData.py community (archive-listed) unverified Apache-2.0 (permissive) · 6b220622e60d9d40 · report
gd_uniform acyrl/NALU/nalu/GenData.py community (archive-listed) unverified Apache-2.0 (permissive) · b4f56e94408affbb · report
gd_uniform acyrl/NALU/tf-prototype/GenData.py community (archive-listed) unverified Apache-2.0 (permissive) · 9567ec335184d418 · report
generate_synthetic_arithmetic_dataset Ragabov/tensorflow-nalu/experiments/utils.py community (archive-listed) unverified MIT (permissive) · 99d41079ce1ef313 · report
matcher bmistry4/nalm-benchmark/export/sequential_mnist.py community (archive-listed) unverified MIT (permissive) · ce12fc160f0618e0 · report
matcher bmistry4/nalm-benchmark/export/simple_function_static.py community (archive-listed) unverified MIT (permissive) · 2799665e88062be6 · report
nac acyrl/NALU/tf-prototype/nac.py community (archive-listed) unverified Apache-2.0 (permissive) · e1011e67d1ed1345 · report
nalu acyrl/NALU/tf-prototype/nalu.py community (archive-listed) unverified Apache-2.0 (permissive) · cc0432c89fad9dd8 · report
print_mnist_cell_weights bmistry4/nalm-benchmark/misc/utils.py community (archive-listed) unverified MIT (permissive) · ebbd20959f75fe66 · report
print_model_params bmistry4/nalm-benchmark/misc/utils.py community (archive-listed) unverified MIT (permissive) · 8d079f326a7bfb7d · report
rmse bmistry4/nalm-benchmark/misc/singularity_issue.py community (archive-listed) unverified MIT (permissive) · 3c7139452df8334e · report
train FrederikWarburg/latent_disagreement/Experiments/NALU_all_we_need.py community (archive-listed) unverified no licence file found · pointer only · e7f88fa947dc31b3 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections