Abstract
Symbolic regression, i.e. predicting a function from the observation of itsvalues, is well-known to be a challenging task. In this paper, we trainTransformers to infer the function or recurrence relation underlying sequencesof integers or floats, a typical task in human IQ tests which has hardly beentackled in the machine learning literature. We evaluate our integer model on asubset of OEIS sequences, and show that it outperforms built-in Mathematicafunctions for recurrence prediction. We also demonstrate that our float modelis able to yield informative approximations of out-of-vocabulary functions andconstants, e.g. $\operatorname{bessel0}(x)\approx\frac{\sin(x)+\cos(x)}{\sqrt{\pi x}}$ and $1.644934\approx \pi^2/6$. Aninteractive demonstration of our models is provided at https://bit.ly/3niE5FS.