SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Having trained the terminality classifier, we used it to explore the landscape of  $\mathbb{Q}$ -Fano toric varieties with Picard rank two. To do so, we built a large dataset of examples and analysed their regularized quantum period, a numerical invariant of  $\mathbb{Q}$ -Fano varieties [8]. For smooth low-dimensional Fano varieties, it is known that the regularized quantum period is a complete invariant [9]. This is believed to be true in higher dimension, but is still conjectural. Given a  $\mathbb{Q}$ -Fano variety  $X$ , its regularized quantum period is a power series
$$
\hat {G} _ {X} (t) = \sum_ {d = 0} ^ {\infty} c _ {d} t ^ {d}
$$
where  $c_{0} = 1$ ,  $c_{1} = 0$ ,  $c_{d} = d! r_{d}$ , and  $r_{d}$  is the number of degree- $d$  rational curves in  $X$  that satisfy certain geometric conditions. Formally speaking,  $r_{d}$  is a degree- $d$ , genus-zero Gromov-Witten invariant [28]. The period sequence of  $X$  is the sequence  $(c_{d})$  of coefficients of the regularized quantum period. This sequence grows rapidly. In the case where  $X$  is a  $\mathbb{Q}$ -Fano toric variety of Picard rank two, rigorous asymptotics for this growth are known.
Theorem 6.1 (Theorem 5.2, [10]). Consider a weight matrix
$$
\left[ \begin{array}{c c c} a _ {1} & \ldots & a _ {N} \\ b _ {1} & \ldots & b _ {N} \end{array} \right]
$$
for a  $\mathbb{Q}$ -factorial Fano toric variety  $X$  of Picard rank two. Let  $a = \sum_{i=1}^{N} a_i$  and  $b = \sum_{i=1}^{N} b_i$ , and let  $[\mu : \nu] \in \mathbb{P}^1$  be the unique real root of the homogeneous polynomial
$$
\prod_ {i = 1} ^ {N} \left(a _ {i} \mu + b _ {i} \nu\right) ^ {a _ {i} b} - \prod_ {i = 1} ^ {N} \left(a _ {i} \mu + b _ {i} \nu\right) ^ {b _ {i} a} \tag {6.1}
$$
such that  $a_{i}\mu +b_{i}\nu \geq 0$  for all  $i\in \{1,2,\ldots ,N\}$  . Let  $(c_d)$  be the corresponding period sequence.
Then non-zero coefficients  $c_d$  satisfy
$$
\log c _ {d} \sim A d - \frac {\dim X}{2} \log d + B
$$
(b)
Figure 3: A dataset of 100M probably- $\mathbb{Q}$ -Fano toric varieties of Picard rank two and dimension eight, projected to  $\mathbb{R}^2$  using the growth coefficients  $A$  and  $B$  from (6.2). In (a) we colour by Fano index, while in (b) we colour a heatmap according to the frequency.
as  $d\to \infty$  ,where
$$
A = - \sum_ {i = 1} ^ {N} p _ {i} \log p _ {i}
$$
$$
B = - \frac {\dim X}{2} \log (2 \pi) - \frac {1}{2} \sum_ {i = 1} ^ {N} \log p _ {i} - \frac {1}{2} \log \left(\sum_ {i = 1} ^ {N} \frac {\left(a _ {i} b - b _ {i} a\right) ^ {2}}{\ell^ {2} p _ {i}}\right) \tag {6.2}
$$
Here  $p_i = \frac{\mu a_i + \nu b_i}{\mu a + \nu b}$ , so that  $\sum_{i}p_{i} = 1$ , and  $\ell = \gcd \{a,b\}$  is the Fano index.
In Figure 3 we picture our dataset of  $\mathbb{Q}$ -Fano varieties by using the coefficients  $A$  and  $B$  to project it to  $\mathbb{R}^2$ ; for the corresponding images for terminal Fano weighted projective spaces, see [10, Figure 7a]. Note the stratification by Fano index. Although many weight matrices can give rise to the same toric variety, in our context we are using well-formed weight matrices in standard form (2.3) and so at most two weight matrices can give rise to the same toric variety. We removed any such duplicates from our dataset, so the heatmap in Figure 3b reflects genuine variation in the distribution of  $\mathbb{Q}$ -Fano varieties, rather than simply the many-to-one correspondence between weight matrices and toric varieties.
Data generation The dataset pictured in Figure 3 was generated using an AI-assisted data generation workflow that combines algorithmic checks and our machine learning model, as follows.
- Generate a random  $2 \times 10$  matrix with entries chosen uniformly from  $\{0,1,2,3,4,5,6,7\}$ .
- Cyclically order the columns and only keep the matrix if it is in standard form, as in (2.3).
- Check conditions (1)-(4) from §3.
- Predict terminality using the neural network classifier from  $\S 4$ , only keeping examples that are classified as terminal and storing their probabilities.
- Set  $\mu = 1$  in (6.1) and solve the univariate real polynomial in the correct domain to obtain the solution  $(1, \nu)$ .
- Calculate the coefficients  $A$  and  $B$  using the formulae in (6.2).
The final dataset is composed of 100M samples. Each of these represents a  $\mathbb{Q}$ -factorial toric Fano variety of dimension eight and Picard rank two that the classifier predicts is a  $\mathbb{Q}$ -Fano variety.
Data analysis We note that the vertical boundary in Figure 3 is not a surprise. In fact, we can apply the log-sum inequality to the formula for  $A$  to obtain
$$
A = - \sum_ {i = 1} ^ {N} p _ {i} \log (p _ {i}) \leq - \left(\sum_ {i = 1} ^ {N} p _ {i}\right) \log \left(\frac {\sum_ {i = 1} ^ {N} p _ {i}}{N}\right) = \log (N)
$$
Figure 4: Confusion matrices for the neural network classifier on in-sample and out-of-sample data. In each case a balanced set of 10000 random examples was tested.
In our case  $N = 10$ , and the vertical boundary that we see in Figure 3a is the line  $x = \log (10) \sim 2.3$ . We also see what looks like a linear lower bound for the cluster; a similar bound was observed, and established rigorously, for weighted projective spaces in [10].
Closer analysis (see the Supplementary Material) reveals large overlapping clusters that correspond to Fano varieties of different Fano index. Furthermore the simplest toric varieties of Picard rank two – products of projective spaces, and products of weighted projective spaces – appear to lie in specific regions of the diagram.
7 Limitations and future directions
The main message of this work is a new proposed AI-assisted workflow for data generation in pure mathematics. This allowed us to construct, for the first time, an approximate landscape of objects of mathematical interest (Q-Fano varieties) which is inaccessible by traditional methods. We hope that this methodology will have broad application, especially to other large-scale classification questions in mathematics, of which there are many [1, 13, 21].
Our approach has some limitations, however, which we enumerate here. Some of these limitations suggest directions for future research. A key drawback, common to most ML models, is that our classifier performs poorly on out-of-sample data. Recall from §3 that the dataset we generated bounded the entries of the matrices by seven. For weight matrices within this range the model is extremely accurate (95%), however this accuracy drops off rapidly for weight matrices that fall outside of this range: 62% for entries bounded by eight; 52% for entries bounded by nine; and 50% for entries bounded by ten. See Figure 4 for details. Note that the network quickly degenerates to always predicting non-terminal singularities.
Furthermore the training process seems to require more data than we would like, given how computationally expensive the training data is to generate. It is possible that a more sophisticated network architecture, that is better adapted to this specific problem, might require less data to train.
Mathematically, our work here was limited to toric varieties, and furthermore only to toric varieties of Picard rank two. Finding a meaningful vectorisation of an arbitrary algebraic variety looks like an impossible task. But if one is interested in the classification of algebraic varieties up to deformation, this might be less of a problem than it first appears. Any smooth Fano variety in low dimensions is, up to deformation, either a toric variety, a toric complete intersection, or a quiver flag zero locus [9, 22]; one might hope that this also covers a substantial fraction of the  $\mathbb{Q}$ -Fano landscape. Each of these classes of geometry is controlled by combinatorial structures, and it is possible to imagine a generalisation of our vectorisation by weight matrices to this broader context.
Generalising to  $\mathbb{Q}$ -factorial Fano toric varieties in higher Picard rank will require a more sophisticated approach to equivariant machine learning. In this paper, we could rely on the fact that there is a normal form (2.3) for rank-two weight matrices that gives an almost unique representative of each  $\mathrm{SL}_2(\mathbb{Z}) \times S_N$ -orbit of weight matrices. For higher Picard rank  $r$  we need to consider weight matrices up to the action of  $G = \mathrm{SL}_r(\mathbb{Z}) \times S_N$ . Here no normal form is known, so to work  $G$ -equivariantly we will need to augment our dataset, to fill out the different  $G$ -orbits, or to use invariant functions of the weights as features. The latter option, geometrically speaking, is working directly with the quotient space.
The best possible path forward would be to train an explainable model that predicted terminality from the weight data. This would allow us to extract from the machine learning not only that the problem is tractable, but also a precise mathematical conjecture for the solution. At the moment,
however, we are very far from this. The multilayer perceptron that we trained is a black-box model, and post-hoc explanatory methods such as SHAP analysis [32] yielded little insight: all features were used uniformly, as might be expected. We hope to return to this point elsewhere.
TC was partially supported by ERC Consolidator Grant 682603 and EPSRC Programme Grant EP/N03189X/1. AK is supported by EPSRC Fellowship EP/N022513/1. SV is supported by the Engineering and Physical Sciences Research Council [EP/S021590/1], the EPSRC Centre for Doctoral Training in Geometry and Number Theory (The London School of Geometry and Number Theory), University College London. The authors would like to thank Hamid Abbas, Alessio Corti, and Challenger Mishra for many useful conversations, and the anonymous referees for their insightful feedback and suggestions. The authors have no competing interests.
[1] Jeffrey Adams, Annegret Paul, Ran Cui, Susana Salamanca-Riba, Peter Trapa, Marc van Leeuwen, and David Vogan. Atlas of Lie groups and representations. Online, 2016. http://www.liegroups.org.
[2] Hamid Ahmadinezhad. On pliability of del Pezzo fibrations and Cox rings. J. Reine Angew. Math., 723: 101-125, 2017. doi:10.1515/crelle-2014-0095.
[3] Michael F. Atiyah, Nigel J. Hitchin, Vladimir G. Drinfeld, and Yuri I. Manin. Construction of instantons. Phys. Lett. A, 65(3):185-187, 1978. doi:10.1016/0375-9601(78)90141-X.
[4] Caucher Birkar. Singularities of linear systems and boundedness of Fano varieties. Ann. of Math. (2), 193 (2):347-405, 2021. doi:10.4007/annals.2021.193.2.1.
[5] Wieb Bosma, John Cannon, and Catherine Playoust. The Magma algebra system. I. The user language. J. Symbolic Comput., 24(3-4):235-265, 1997. doi:10.1006/jsc0.1996.0125. Computational algebra and number theory (London, 1993).
[6] Gavin Brown, Alessio Corti, and Francesco Zucconi. Birational geometry of 3-fold Mori fibre spaces. In The Fano Conference, pages 235-275. Univ. Torino, Turin, 2004.
[7] Paolo Cascini. New directions in the minimal model program. Boll. Unione Mat. Ital., 14(1):179-190, 2021. doi:10.1007/s40574-020-00250-9.
[8] Tom Coates, Alessio Corti, Sergey Galkin, Vasily Golyshev, and Alexander M. Kasprzyk. Mirror symmetry and Fano manifolds. In European Congress of Mathematics, pages 285-300. Eur. Math. Soc., Zürich, 2013. doi:10.4171/120.
[9] Tom Coates, Alessio Corti, Sergey Galkin, and Alexander M. Kasprzyk. Quantum periods for 3-dimensional Fano manifolds. Geom. Topol., 20(1):103-256, 2016. doi:10.2140/gt.2016.20.103.
[10] Tom Coates, Alexander M. Kasprzyk, and Sara Veneziale. Machine learning the dimension of a Fano variety. Nat. Commun., 14:5526, 2023. doi:10.1038/s41467-023-41157-1.
[11] Tom Coates, Alexander M. Kasprzyk, and Sara Veneziale. A dataset of 8-dimensional  $\mathbb{Q}$ -factorial Fano toric varieties of Picard rank 2. Zenodo, 2023. doi:10.5281/zenodo.10046893.
[12] Tom Coates, Alexander M. Kasprzyk, and Sara Veneziale. Supporting code. https://bitbucket.org/fanosearch/ml Terminality, 2023.
[13] John Cremona. The L-functions and modular forms database project. Found. Comput. Math., 16(6): 1541-1553, 2016. doi:10.1007/s10208-016-9306-z.
[14] Alex Davies, Petar Velicković, Lars Buesing, Sam Blackwell, Daniel Zheng, Nenad Tomasev, Richard Tanburn, Peter Battaglia, Charles Blundell, András Juhász, Marc Lackenby, Georgie Williamson, Demis Hassabis, and Pushmeet Kohli. Advancing mathematics by guiding human intuition with AI. Nature, 600: 70-74, 2021. doi:10.1038/s41586-021-04086-x.
[15] Pasquale Del Pezzo. Sulle superficie dell  $n^{\mathrm{mo}}$  ordine immer nello spazio ad  $n$  dimensioni. Rend. del Circolo Mat. di Palermo, 1:241-255, 1887.
[37] Fabina Pedregosa, Gael Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, Jake Vanderplas, Alexandre Passos, David Cournapeau, Matthieu Brucher, Matthieu Perrot, and Edouard Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011. doi:10.5555/1953048.2078195.
[38] Miles Reid. Young person's guide to canonical singularities. In Algebraic geometry, Bowdoin, 1985 (Brunswick, Maine, 1985), volume 46 of Proc. Sympos. Pure Math., pages 345-414. Amer. Math. Soc., Providence, RI, 1987.
[39] Adam Zsolt Wagner. *Constructions in combinatorics via neural networks.* arXiv:2104.14516 [math.CO], 2021.
[40] Georgie Williamson. Is deep learning a useful tool for the pure mathematician? arXiv:2304.12602 [math.RT], 2023.
[41] Yue Wu and Jesus A De Loera. Turning mathematics problems into games: Reinforcement learning and Gröbner bases together solve integer feasibility problems. arXiv:2208.12191 [cs.LG], 2022.