Learning the greatest common divisor: explaining transformer predictions
The predictions of small transformers, trained to calculate the greatest common divisor (GCD) of two positive integers, can be fully characterized by looking at model inputs and outputs. As training proceeds, the model learns a list $\mathcal D$ of integers, products of divisors of the base used to represent integers and small primes, and predicts the largest element of $\mathcal D$ that divides both inputs. Training distributions impact performance. Models trained from uniform operands only learn a handful of GCD (up to $38$ GCD $\leq100$). Log-uniform operands boost performance to $73$ GCD $\leq 100$, and a log-uniform distribution of outcomes (i.e. GCD) to $91$. However, training from uniform (balanced) GCD breaks explainability.
Code (1)
Methods 이 논문이 사용한 방법론
Similar Papers 제목 키워드 기반
On a correlational clustering of integers
Correlation clustering is a concept of machine learning. The ultimate goal of such a clustering is to find a partition with minimal conflicts. In this paper we investigate a correlation clustering of integers, based upon…
BIG-bench Machine LearningClusteringEmergent properties with repeated examples
We study the performance of transformers as a function of the number of repetitions of training examples with algorithmically generated datasets. On three problems of mathematics: the greatest common divisor, modular mul…
DiversityMemorizationModels That Prove Their Own Correctness
How can we trust the correctness of a learned model on a particular input of interest? Model accuracy is typically measured *on average* over a distribution of inputs, giving no guarantee for any fixed input. This paper …
Universal evolutionary model for periodical species
Real-world examples of periods of periodical organisms range from cicadas whose life-cycles are larger prime numbers, like 13 or 17, to bamboos whose periods are large multiples of small primes, like 40 or even 120. The …
modelPolarimetric phase retrieval: uniqueness and algorithms
This work introduces a novel Fourier phase retrieval model, called polarimetric phase retrieval that enables a systematic use of polarization information in Fourier phase retrieval problems. We provide a complete charact…
Retrieval