Learning to Add, Multiply, and Execute Algorithmic Instructions Exactly with Neural Networks

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: de Luca, Artur Back, Giapitzakis, George, Fountoulakis, Kimon
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866908800808648704
author de Luca, Artur Back
Giapitzakis, George
Fountoulakis, Kimon
author_facet de Luca, Artur Back
Giapitzakis, George
Fountoulakis, Kimon
contents Neural networks are known for their ability to approximate smooth functions, yet they fail to generalize perfectly to unseen inputs when trained on discrete operations. Such operations lie at the heart of algorithmic tasks such as arithmetic, which is often used as a test bed for algorithmic execution in neural networks. In this work, we ask: can neural networks learn to execute binary-encoded algorithmic instructions exactly? We use the Neural Tangent Kernel (NTK) framework to study the training dynamics of two-layer fully connected networks in the infinite-width limit and show how a sufficiently large ensemble of such models can be trained to execute exactly, with high probability, four fundamental tasks: binary permutations, binary addition, binary multiplication, and Subtract and Branch if Negative (SBN) instructions. Since SBN is Turing-complete, our framework extends to computable functions. We show how this can be efficiently achieved using only logarithmically many training data. Our approach relies on two techniques: structuring the training data to isolate bit-level rules, and controlling correlations in the NTK regime to align model predictions with the target algorithmic executions.
format Preprint
id arxiv_https___arxiv_org_abs_2502_16763
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Learning to Add, Multiply, and Execute Algorithmic Instructions Exactly with Neural Networks
de Luca, Artur Back
Giapitzakis, George
Fountoulakis, Kimon
Machine Learning
Neural networks are known for their ability to approximate smooth functions, yet they fail to generalize perfectly to unseen inputs when trained on discrete operations. Such operations lie at the heart of algorithmic tasks such as arithmetic, which is often used as a test bed for algorithmic execution in neural networks. In this work, we ask: can neural networks learn to execute binary-encoded algorithmic instructions exactly? We use the Neural Tangent Kernel (NTK) framework to study the training dynamics of two-layer fully connected networks in the infinite-width limit and show how a sufficiently large ensemble of such models can be trained to execute exactly, with high probability, four fundamental tasks: binary permutations, binary addition, binary multiplication, and Subtract and Branch if Negative (SBN) instructions. Since SBN is Turing-complete, our framework extends to computable functions. We show how this can be efficiently achieved using only logarithmically many training data. Our approach relies on two techniques: structuring the training data to isolate bit-level rules, and controlling correlations in the NTK regime to align model predictions with the target algorithmic executions.
title Learning to Add, Multiply, and Execute Algorithmic Instructions Exactly with Neural Networks
topic Machine Learning
url https://arxiv.org/abs/2502.16763