Title: Machine learning detects terminal singularities
Venue: NeurIPS 2023
Accepted: yes
Keywords: mathematics

geometry

Fano varieties

terminal singularities

theorem discovery

neural network classifier

supervised learning
Abstract: Algebraic varieties are the geometric shapes defined by systems of polynomial equations; they are ubiquitous across mathematics and science. Amongst these algebraic varieties are Q-Fano varieties: positively curved shapes which have Q-factorial terminal singularities. Q-Fano varieties are of fundamental importance in geometry as they are `atomic pieces’ of more complex shapes – the process of breaking a shape into simpler pieces in this sense is called the Minimal Model Programme.

Despite their importance, the classification of Q-Fano varieties remains unknown. In this paper we demonstrate that machine learning can be used to understand this classification. We focus on eight-dimensional positively-curved algebraic varieties that have toric symmetry and Picard rank two, and develop a neural network classifier that predicts with 95% accuracy whether or not such an algebraic variety is Q-Fano. We use this to give a first sketch of the landscape of Q-Fano varieties in dimension eight.

How the neural network is able to detect Q-Fano varieties with such accuracy remains mysterious, and hints at some deep mathematical theory waiting to be uncovered. Furthermore, when visualised using the quantum period, an invariant that has played an important role in recent theoretical developments, we observe that the classification as revealed by ML appears to fall within a bounded region, and is stratified by the Fano index. This suggests that it may be possible to state and prove conjectures on completeness in the future.

Inspired by the ML analysis, we formulate and prove a new global combinatorial criterion for a positively curved toric variety of Picard rank two to have terminal singularities. Together with the first sketch of the landscape of Q-Fano varieties in higher dimensions, this gives strong new evidence that machine learning can be an essential tool in developing mathematical conjectures and accelerating theoretical discovery.

Machine learning detects terminal singularities

Abstract

Algebraic varieties are the geometric shapes defined by systems of polynomial equations; they are ubiquitous across mathematics and science. Amongst these algebraic varieties are Q -Fano varieties: positively curved shapes which have Q -factorial terminal singularities. Q -Fano varieties are of fundamental importance in geometry as they are 'atomic pieces' of more complex shapes - the process of breaking a shape into simpler pieces in this sense is called the Minimal Model Programme.

Despite their importance, the classification of Q -Fano varieties remains unknown. In this paper we demonstrate that machine learning can be used to understand this classification. We focus on eight-dimensional positively-curved algebraic varieties that have toric symmetry and Picard rank two, and develop a neural network classifier that predicts with 95% accuracy whether or not such an algebraic variety is Q -Fano. We use this to give a first sketch of the landscape of Q -Fano varieties in dimension eight.

How the neural network is able to detect Q -Fano varieties with such accuracy remains mysterious, and hints at some deep mathematical theory waiting to be uncovered. Furthermore, when visualised using the quantum period, an invariant that has played an important role in recent theoretical developments, we observe that the classification as revealed by ML appears to fall within a bounded region, and is stratified by the Fano index. This suggests that it may be possible to state and prove conjectures on completeness in the future.

Inspired by the ML analysis, we formulate and prove a new global combinatorial criterion for a positively curved toric variety of Picard rank two to have terminal singularities. Together with the first sketch of the landscape of Q -Fano varieties in higher dimensions, this gives strong new evidence that machine learning can be an essential tool in developing mathematical conjectures and accelerating theoretical discovery.

1 Introduction

Systems of polynomial equations occur throughout mathematics and science; see e.g. [3, 17, 18, 35]. Solutions of these systems define shapes called algebraic varieties . Depending on the equations involved, algebraic varieties can be smooth (as in Figure 1a) or have singularities (as in Figures 1b and 1c). In this paper we show that machine learning methods can detect a class of singularities called terminal singularities .

(a)

x

2

+

y

2

=

z

2

+1

(b)

x

2

+

y

2

=

z

2

(c)

x

2

+

y

2

=

z

3

A key class of algebraic varieties are Fano varieties : positively curved shapes that are basic building blocks in algebraic geometry. Fano varieties are 'atomic pieces' of more complex shapes, in the sense of the Minimal Model Programme [7, 25, 26]. Running the Minimal Model Programme - that is, breaking an algebraic variety X into atomic pieces - involves making birational transformations of X . These are modifications on subsets with zero volume (and codimension at least one), and can either introduce or remove singularities. The building blocks that emerge from this process are not necessarily smooth: they satisfy a weaker condition called Q -factoriality, 2 and can have mild singularities called terminal singularities [38]. Fano varieties that are Q -factorial and have terminal singularities are called Q -Fano varieties .

The classification of Q -Fano varieties is therefore a long-standing problem of great importance [4, 15, 27, 33, 34] - one can think of this as building a Periodic Table for geometry. But, despite more than a century of study, very little is known. In what follows we exploit the fact that machine learning can detect terminal singularities to give the first sketch of part of the classification of higher-dimensional Q -Fano varieties.

We probe the classification of Q -Fano varieties using a class of highly-symmetrical shapes called toric varieties . (For example, the algebraic varieties pictured in Figure 1 are toric varieties.) Toric varieties are particularly suitable for computation and machine learning, because their geometric properties are encoded by simple combinatorial objects. We consider Fano toric varieties of Picard rank two. These can be encoded using a 2 × N matrix of non-negative integers called the weight matrix ; here the dimension of the toric variety is N -2 .

To determine whether such a toric variety X is a Q -Fano variety we need to check whether X is Q -factorial, and whether the singularities of X are terminal. Checking Q -factoriality from the weight matrix of X turns out to be straightforward (see §3) but checking terminality is extremely challenging. This is because there is no satisfactory theoretical understanding of the problem. We lack a global criterion for detecting terminality in terms of weight data (such as [24] in a simpler setting) and so have to fall back on first enumerating all the singularities to analyse, and then checking terminality for each singularity. Each step is a challenging problem in discrete geometry: the first step involves building a different combinatorial object associated to the n -dimensional toric variety X , which is a collection of cones in R n called the fan Σ( X ) ; the second step involves checking for various cones in the fan whether or not they contain lattice points on or below a certain hyperplane. To give a sense of the difficulty of the computations involved, generating and post-processing our dataset of 10 million toric varieties in dimension eight took around 30 CPU years.

To overcome this difficulty, and hence to begin to investigate the classification of Q -Fano varieties in dimension eight, we used supervised machine learning. We trained a feed-forward neural network classifier on a balanced dataset of 5 million examples; these are eight-dimensional Q -factorial Fano toric varieties of Picard rank two, of which 2.5 million are terminal and 2.5 million non-terminal. Testing on a further balanced dataset of 5 million examples showed that the neural network classifies such toric varieties as terminal or non-terminal with an accuracy of 95%. This high accuracy allowed us to rapidly generate many additional examples that are with high probability Q -Fano varieties - that is, examples that the classifier predicts have terminal singularities. This ML-assisted generation step is much more efficient: generating 100 million examples in dimension eight took less than 120 CPU hours.

The fact that the ML classifier can detect terminal singularities with such high accuracy suggests that there is new mathematics waiting to be discovered here - there should be a simple criterion in terms of the weight matrix to determine whether or not a toric variety X has terminal singularities. In §5 we take the first steps in this direction, giving in Algorithm 1 a new method to check terminality directly from the weight matrix, for toric varieties of Picard rank two. A proof of correctness is given in the Supplementary Material. This new algorithm is fifteen times faster than the naïve approach that we used to generate our labelled dataset, but still several orders of magnitude slower than the neural network classifier. We believe that this is not the end of the story, and that the ML results suggest that a simpler criterion exists. Note that the neural network classifier cannot be doing anything analogous to Algorithm 1: the algorithm relies on divisibility relations between entries of the weight matrix (GCDs etc.) that are not visible to the neural network, as they are destroyed by the rescaling and standardisation that is applied to the weights before they are fed to the classifier.

In §6 we use the ML-assisted dataset of 100 million examples to begin to explore the classification of Q -Fano varieties in dimension eight. We visualise the dataset using the regularized quantum period , an invariant that has played an important role in recent theoretical work on Q -Fano classification, discovering that an appropriate projection of the data appears to fill out a wedge-shaped region bounded by two straight lines. This visualisation suggests some simple patterns in the classification: for example, the distance from one edge of the wedge appears to be determined by the Fano index of the variety.

Our work is further evidence that machine learning can be an indispensable tool for generating and guiding mathematical understanding. The neural network classifier led directly to Algorithm 1, a new theoretical result, by revealing that the classification problem was tractable and thus there was probably new mathematics waiting to be found. This is part of a new wave of application of artificial intelligence to pure mathematics [10, 14, 16, 20, 39-41], where machine learning methods drive theorem discovery.

A genuinely novel contribution here, though, is the use of machine learning for data generation and data exploration in pure mathematics. Sketching the landscape of higher-dimensional Q -Fano varieties using traditional methods would be impossible with the current theoretical understanding, and prohibitively expensive using the current exact algorithms. Training a neural network classifier however, allows us to explore this landscape easily - a landscape that is unreachable with current mathematical tools.

Why dimension eight? We chose to work with eight-dimensional varieties for several reasons. It is important to distance ourselves from the surface case (dimension two), where terminality is a trivial condition. A two-dimensional algebraic variety has terminal singularities if and only if it is smooth. On the other hand, we should consider a dimension where we can generate a sufficient amount of data for machine learning (the analogue of our dataset in dimension three, for example, contains only 34 examples [23]) and where we can generate enough data to meaningfully probe the classification. Moreover, we work in Picard rank two because there already exists a fast combinatorial formula to check terminality in rank one [24]; Picard rank two is the next natural case to consider.

Data and code availability The datasets underlying this work and the code used to generate them are available from Zenodo under a CC0 license [11]. Data generation and post-processing was carried out using the computational algebra system Magma V2.27-3 [5]. The machine learning model was built using PyTorch v1.13.1 [36] and scikit-learn v1.1.3 [37]. All code used and trained models are available from BitBucket under an MIT licence [12].

2 Mathematical background

The prototypical example of a Fano variety is projective space P N -1 , which can be thought of as the quotient of C N \ { 0 } by C × acting as follows:

Fano toric varieties of Picard rank two arise similarly. They can be constructed as the quotient of C N \ S , where S is a union of subspaces, by an action of ( C × ) 2 . This action, and the union of subspaces S , is encoded by a weight matrix:

Here we assume that all ( a i , b i ) ∈ Z 2 \ { 0 } lie in a strictly convex cone C ⊂ R 2 . The action is

and S = S + ∪ S -is the union of subspaces S + and S -, where

and a = ∑ N i =1 a i , b = ∑ N i =1 b i : see [6]. The quotient X = ( C N \ S ) / ( C × ) 2 is an algebraic variety of dimension N -2 . We assume in addition that both S + and S -have dimension at least two; this implies that the second Betti number of X is two, that is, X has Picard rank two.

Since we have insisted that all columns ( a i , b i ) lie in a strictly convex cone C , we can always permute columns and apply an SL 2 ( Z ) transformation to the weight matrix to obtain a matrix in standard form:

where all entries are non-negative, the columns are cyclically ordered anticlockwise, and a N < b N . This transformation corresponds to renumbering the co-ordinates of C N and reparametrising the torus ( C × ) 2 that acts, and consequently leaves the quotient variety X that we construct unchanged.

We will consider weight matrices (2.1) that satisfy an additional condition called being well-formed . An r × N weight matrix is called standard if the greatest common divisor of its r × r minors is one, and is well-formed if every submatrix formed by deleting a column is standard [2]. Considering only well-formed weight matrices guarantees that a toric variety determines and is determined by its weight matrix, uniquely up to SL r ( Z ) -transformation.

Testing terminality As mentioned in the introduction, an n -dimensional toric variety X determines a collection Σ( X ) of cones in R n called the fan of X . A toric variety is completely determined by its fan. The process of determining the fan Σ( X ) from the weight matrix (2.1) is explained in the Supplementary Material; this is a challenging combinatorial calculation. In the fan Σ( X ) , the one-dimensional cones are called rays. For a Fano toric variety X , taking the convex hull of the first lattice point on each ray defines a convex polytope P , and X has terminal singularities if and only if the only lattice points in P are the origin and the vertices. Verifying this is a conceptually straightforward but computationally challenging calculation in integer linear programming.

3 Data generation

We generated a balanced, labelled dataset of ten million Q -factorial Fano toric varieties of Picard rank two and dimension eight. These varieties are encoded, as described above, by weight matrices. We generated 2 × 10 integer-valued matrices in standard form, as in (2.3), with entries chosen uniformly at random from the set { 0 , . . . , 7 } . Minor exceptions to this were the values for a 1 and b N , which were both chosen uniformly at random from the set { 1 , . . . , 7 } , and the value for a N , which was chosen uniformly at random from the set { 0 , . . . , b N -1 } . Once a random weight matrix was generated, we retained it only if it satisfied:

None of the columns are the zero vector.

The sum of the columns is not a multiple of any of them.

The subspaces S + and S -in (2.2) are both of dimension at least two.

The matrix is well-formed.

The first condition here was part of our definition of weight matrix; the second condition is equivalent to X being Q -factorial; the third condition guarantees that X has Picard rank two; and the fourth condition was discussed above.

We used rejection sampling to ensure that the dataset contains an equal number of terminal and non-terminal examples. Before generating any weight matrix, a boolean value was set to True (terminal) or False (non-terminal). Once a random weight matrix that satisfied conditions (1)-(4) above was generated, we checked if the corresponding toric variety was terminal using the method discussed in §2. If the terminality check agreed with the chosen boolean, the weight matrix was added to our dataset; otherwise the generation step was repeated until a match was found.

As discussed, different weight matrices can give rise to the same toric variety. Up to isomorphism, however, a toric variety X is determined by the isomorphism class of its fan. We deduplicated our dataset by placing the corresponding fan Σ( X ) , which we had already computed in order to test for terminality, in normal form [19, 29]. In practice, very few duplicates occurred.

4 Building the machine learning model

Webuilt a neural network classifier to determine whether a Q -factorial Fano variety of Picard rank two and dimension eight is terminal. The network was trained on the features given by concatenating the two rows of a weight matrix, [ a 1 , . . . , a 10 , b 1 , . . . , b 10 ] . The features were standardised by translating their mean to zero and scaling to variance one. The network, a multilayer perceptron, is a fully connected feedforward neural network with three hidden layers and leaky ReLu activation function. It was trained on the dataset described in §3 using binary cross-entropy as loss function, stochastic mini-batch gradient descent optimiser and using early-stopping, for a maximum of 150 epochs and with learning rate reduction on plateaux. We tested the model on a balanced subset of 50% of the data (5M); the remainder was used for training (40%; 4M balanced) and validation (10%; 1M).

Hyperparameter tuning was partly carried out using RayTune [31] on a small portion of the training data, via random grid search with Async Successive Halving Algorithm (ASHA) scheduler [30], for 100 experiments. Given the best configuration resulting from the random grid search, we then manually explored nearby configurations and took the best performing one. The final best network configuration is summarised in Table 1.

By trying different train-test splits, and using 20% of the training data for validation throughout, we obtained the learning curve in Figure 2a. This shows that a train-validate-test split of 4M-1M-5M produced an accurate model that did not overfit. Training this model gave the loss learning curve in Figure 2b, and a final accuracy (on the test split of size 5M) of 95% .

5 Theoretical result

The high accuracy of the model in §4 was very surprising. As explained in the introduction, Q -Fano varieties are of fundamental importance in algebraic geometry. However, asking whether a Fano variety has terminal singularities is, in general, an extremely challenging geometric question. In the case of a Fano toric variety one would typically proceed by constructing the fan, and then performing

(a)

(b)

0.96

一

Train

0.6

Train

0.94

Test

Validation

0.5

0.92

0.90

Loss

S

0.4

0.88

0.3

0.86

0.2

0.84

0.1

1.0

1.5

2.0

Training samples

2.5

3.0

3.5

4.0

4.5

5.0

1e6

Fo

20

40

60

Epochs

80

100

120

140

a cone-by-cone analysis of the combinatorics. This is computationally expensive and unsatisfying from a theoretical viewpoint. The success of the model suggested that a more direct characterisation is possible from the weight matrix alone. An analogous characterisation exists in the simpler case of weighted projective spaces [24], which have Picard rank one, however no such result in higher Picard rank was known prior to training this model.

Inspired by this we prove a theoretical result, Proposition 5.3, which leads to a new algorithm for checking terminality directly from the weight matrix, for Q -factorial Fano toric varieties of Picard rank two. Consider a weight matrix as in (2.1) that satisfies conditions (1)-(4) from §3, and the toric variety X that it determines. As discussed in §2, and explained in detail in the Supplementary Material, X determines a convex polytope P in R N -2 , with N vertices given by the first lattice points on the N rays of the fan. Each of the vertices of P is a lattice point (i.e., lies in Z N -2 ⊂ R N -2 ), and X has terminal singularities if and only if the only lattice points in P are the vertices e 1 , . . . , e N and the origin.

Definition 5.1. Let ∆ i denote the simplex in R N -2 with vertices e 1 , . . . , ˆ e i , . . . , e N where e i is omitted. We say that ∆ i is mostly empty if each lattice point in ∆ i is either a vertex or the origin.

Notation 5.2. Let { x } denote the fractional part x -glyph[floorleft] x glyph[floorright] of a rational number x .

Proposition 5.3. Consider a weight matrix

that satisfies conditions 1-4 from §3. Let g i = gcd { a i , b i } , and let A i , B i be integers such that A i a i + B i b i = g i . Set

noting that all these quantities are integers. Then ∆ i is mostly empty if and only if for all k ∈ { 0 , . . . , f i -1 } and l ∈ { 0 , . . . , g i -1 } such that

we have that for all j .

Let s + = { i | a i b -b i a > 0 } , s -= { i | a i b -b i a < 0 } , and let I be either s + or s -. Then ∆ i , i ∈ I , forms a triangulation of P . Thus X has terminal singularities if and only if ∆ i is mostly empty for each i ∈ I . This leads to Algorithm 1.

Comparisons Testing on 100 000 randomly-chosen examples indicates that Algorithm 1 is approximately 15 times faster than the fan-based approach to checking terminality that we used when labelling our dataset (0.020s per weight matrix for Algorithm 1 versus 0.305s for the standard approach implemented in Magma). On single examples, the neural network classifier is approximately 30 times faster than Algorithm 1. The neural network also benefits greatly from batching, whereas the other two algorithms do not: for batches of size 10 000, the neural network is roughly 2000 times faster than Algorithm 1.

6 The terminal toric Fano landscape

Having trained the terminality classifier, we used it to explore the landscape of 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 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 Q -Fano variety X , its regularized quantum period is a power series

where c 0 = 1 , c 1 = 0 , c d = d ! r d , and r d is the number of degreed rational curves in X that satisfy certain geometric conditions. Formally speaking, r d is a degreed , 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 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

for a Q -factorial Fano toric variety X of Picard rank two. Let a = ∑ N i =1 a i and b = ∑ N i =1 b i , and let [ µ : ν ] ∈ P 1 be the unique real root of the homogeneous polynomial

such that a i µ + b i ν ≥ 0 for all i ∈ { 1 , 2 , . . . , N } . Let ( c d ) be the corresponding period sequence. Then non-zero coefficients c d satisfy

(a)

(b)

105

m

104

2

Frequency

1

103

B

102

-2

101

3

100

1.8

1.9

2.0

2.1

2.2

2.3

A

4

3

2

Fano Index

1

101

B

0

-1

-3

100

1.8

1.9

2.0

2.1

2.2

2.3

A

as d →∞ , where

In Figure 3 we picture our dataset of Q -Fano varieties by using the coefficients A and B to project it to 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 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 × 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 §4, only keeping examples that are classified as terminal and storing their probabilities.

Set µ = 1 in (6.1) and solve the univariate real polynomial in the correct domain to obtain the solution (1 , ν ) .

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 Q -factorial toric Fano variety of dimension eight and Picard rank two that the classifier predicts is a 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

UpperBound=6

Upper Bound=7

UpperBound=8

Upper Bound = 9

Upper Bound = 10

LN

4725

344

4862

229

⊥N

4622

443

3798

1144

4709

324

⊥N

4971

37

= 4000

e

e

e

True

e

True

3000

- 2000

142

4789

168

4741

151

4784

2587

2471

4466

501

4875

117

= 1000

NT

Predicted

NT

Predicted

T

NT

Predicted

T

NT

Predicted

NT

Predicted

T

NT

Predicted

T

In our case N = 10 , and the vertical boundary that we see in Figure 3a is the line x = log(10) ∼ 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 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 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 SL 2 ( Z ) × S N -orbit of weight matrices. For higher Picard rank r we need to consider weight matrices up to the action of G = SL r ( Z ) × 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.

Acknowledgments and Disclosure of Funding

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 Abban, 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.

References

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 .

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.

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.

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.

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/jsco.1996.0125. Computational algebra and number theory (London, 1993).

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.

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.

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.

TomCoates, 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.

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.

Tom Coates, Alexander M. Kasprzyk, and Sara Veneziale. A dataset of 8-dimensional Q -factorial Fano toric varieties of Picard rank 2. Zenodo , 2023. doi:10.5281/zenodo.10046893.

Tom Coates, Alexander M. Kasprzyk, and Sara Veneziale. Supporting code. https://bitbucket.org/ fanosearch/ml_terminality , 2023.

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.

Alex Davies, Petar Veliˇ ckovi´ c, Lars Buesing, Sam Blackwell, Daniel Zheng, Nenad Tomašev, Richard Tanburn, Peter Battaglia, Charles Blundell, András Juhász, Marc Lackenby, Geordie 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.

Pasquale Del Pezzo. Sulle superficie dell' n mo ordine immerse nello spazio ad n dimensioni. Rend. del Circolo Mat. di Palermo , 1:241-255, 1887.

Harold Erbin and Riccardo Finotello. Machine learning for complete intersection Calabi-Yau manifolds: a methodological study. Phys. Rev. D , 103(12):Paper No. 126014, 40, 2021. doi:10.1103/physrevd.103.126014.

Nicholas Eriksson, Kristian Ranestad, Bernd Sturmfels, and Seth Sullivant. Phylogenetic algebraic geometry. In Projective varieties with unexpected properties , pages 237-255. Walter de Gruyter, Berlin, 2005.

Brian R. Greene. String theory on Calabi-Yau manifolds. In Fields, strings and duality (Boulder, CO, 1996) , pages 543-726. World Sci. Publ., River Edge, NJ, 1997.

Roland Grinis and Alexander M. Kasprzyk. Normal forms of convex lattice polytopes. arXiv:1301.6641 [math.CO], 2013.

Yang-Hui He. Machine-learning mathematical structures. International Journal of Data Science in the Mathematical Sciences , 1:23-47, 2023.

Yang-Hui He, Kyu-Hwan Lee, Thomas Oliver, and Alexey Pozdnyakov. Murmurations of elliptic curves. arXiv:2204.10140 [math.NT], 2022.

Elana Kalashnikov. Four-dimensional Fano quiver flag zero loci. Proc. Royal Society A. , 475(2225): 20180791, 23, 2019. doi:10.1098/rspa.2018.0791.

Alexander M. Kasprzyk. Toric Fano three-folds with terminal singularities. Tohoku Math. J. (2) , 58(1): 101-121, 2006. doi:10.2748/tmj/1145390208.

Alexander M. Kasprzyk. Classifying terminal weighted projective space. arXiv:1304.3029 [math.AG], 2013.

János Kollár. The structure of algebraic threefolds: an introduction to Mori's program. Bull. Amer. Math. Soc. (N.S.) , 17(2):211-273, 1987. doi:10.1090/S0273-0979-1987-15548-0.

János Kollár and Shigefumi Mori. Birational geometry of algebraic varieties , volume 134 of Cambridge Tracts in Mathematics . Cambridge University Press, Cambridge, 1998. doi:10.1017/CBO9780511662560.

János Kollár, Yoichi Miyaoka, Shigefumi Mori, and Hiromichi Takagi. Boundedness of canonical Q -Fano 3-folds. Proc. Japan Acad. Ser. A Math. Sci. , 76(5):73-77, 2000. doi:10.3792/pjaa.76.73.

Maxim Kontsevich and Yuri Manin. Gromov-Witten classes, quantum cohomology, and enumerative geometry. In Mirror symmetry, II , volume 1 of AMS/IP Stud. Adv. Math. , pages 607-653. Amer. Math. Soc., Providence, RI, 1997. doi:10.1090/amsip/001/23.

Maximilian Kreuzer and Harald Skarke. PALP: a package for analysing lattice polytopes with applications to toric geometry. Comput. Phys. Comm. , 157(1):87-106, 2004. doi:10.1016/S0010-4655(03)00491-0.

Liam Li, Kevin Jamieson, Afshin Rostamizadeh, Ekaterina Gonina, Jonathan Ben-Tzur, Moritz Hardt, Benjamin Recht, and Ameet Talwalkar. A system for massively parallel hyperparameter tuning. Proceedings of Machine Learning and Systems , 2:230-246, 2020.

Richard Liaw, Eric Liang, Robert Nishihara, Philipp Moritz, Joseph E Gonzalez, and Ion Stoica. Tune: A research platform for distributed model selection and training. arXiv:1807.05118 [cs.LG], 2018.

Scott M Lundberg and Su-In Lee. A unified approach to interpreting model predictions. Advances in Neural Information Processing Systems , 30, 2017.

Shigefumi Mori and Shigeru Mukai. Classification of Fano 3 -folds with B 2 ≥ 2 . Manuscripta Math. , 36 (2):147-162, 1981/82. doi:10.1007/BF01170131.

Shigefumi Mori and Shigeru Mukai. Erratum: 'Classification of Fano 3-folds with B 2 ≥ 2 '. Manuscripta Math. , 110(3):407, 2003. doi:10.1007/s00229-002-0336-2.

Harald Niederreiter and Chaoping Xing. Algebraic geometry in coding theory and cryptography . Princeton University Press, Princeton, NJ, 2009.

Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library, 2019.

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. Scikitlearn: Machine learning in Python. Journal of Machine Learning Research , 12:2825-2830, 2011. doi:10.5555/1953048.2078195.

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.

Adam Zsolt Wagner. Constructions in combinatorics via neural networks. arXiv:2104.14516 [math.CO], 2021.

Geordie Williamson. Is deep learning a useful tool for the pure mathematician? arXiv:2304.12602 [math.RT], 2023.

Yue Wu and Jesús 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.

Peer reviews:
comments: SUMMARY:
The authors trained a feedforward neural network to detect $\mathbb{Q}$-Fano varieties in dimension 8, among toric varieties defined by weights in a bounded region. The resulting classifier achieves a high (95%) accuracy. The authors used this classifier to build a large dataset of (probably) $\mathbb{Q}$-Fano and visualize it. The high accuracy achieved also inspired the authors to derive a new (exact) algorithm to detect $\mathbb{Q}$-Fano varieties.

STRENGTHS:
The paper is very well written, it address a problem that is interesting and probably quite important (I am not an expert in algebraic geometry though). It has a very detailed experimental part, as well as a new theoretical result (which I haven't been able to check).

WEAKNESSES:
It's not very clear whether, at the end of the day, the classifier built in this work is actually going to make an impactful contribution in the area. This weakness is outweighted by the strengths, in my opinion.

QUESTIONS:
I have two provocative questions.

1. Was Proposition 5.3 (or its proof) inspired in any way by the neural network? The authors seem to imply it, but that does not seem very likely. To motivate in finding this theoretical result, it seems that the important thing was to strongly believe that a simple classifier exists, not that it actually exists.

2. Regarding the poor performance on out-of-distribution examples (Figure 4): Do you think this might mean that the trained neural network is not, in fact, good enough evidence that there is a simpler algorithm to detect $\mathbb{Q}$-Fano varieties?


I also found one typo:
- Line 293: "that" -> "than"

LIMITATIONS:
The paper does a good job of recognizing the weaknesses in the closing section.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 3
DATE: 2023-06-21

comments: SUMMARY:
The authors study properties of algebraic geometric objects, four complex dimensional Fano toric varieties,
using mathematical data science methods, i.e. statistical analysis of a large database of examples combined
with mathematical domain knowledge.  They find a fairly accurate neural network classifier to identify singular
varieties and inspired by this propose a more efficient algorithmic test.  They also study an invariant called the
quantum period.

STRENGTHS:
Interesting example of mathematical data analysis for an open and actively studied problem in algebraic geometry.
The new algorithm for singularity testing is interesting.

WEAKNESSES:
The paper is very unsystematic statistically.  Since the dataset consists of mathematical objects generated by
a known sampling procedure, one could precisely characterize the ensemble being sampled in section 3 (with the
bounds on weights given there), to help interpret the results and help compare with other (future) work.  Or
(probably better) change the sampling to get a simple to describe ensemble.  This question is not even asked.
It bears on the significance of the results and the reported poor performance on out of sample test data reported in section 7.

QUESTIONS:
Re section 5 and algorithm 1, the motivation is the existence of an NN predictor of singularity from the weight matrix.  
Did anything else from the NN results enter into finding this result?

LIMITATIONS:
yes
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 4
DATE: 2023-06-25

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper applies machine learning methods to predict whether an algebraic variety is Q-Fano. Q-fano varieties are Fano varieties that are Q-factorial and have terminal singularities. Checking terminally is computational challenging. To train a machine learning classifier, the authors build a balanced dataset of 10 million eight-dimensional Q-factorial Fano toric varieties of Picard rank 2. They use an MLP to classify whether a topic variety has terminal singularities (and thus a Q-fano variety) from its weight matrix. The neural network achieves an accuracy of 95%, which leads to the speculation that these exists a simple criterion to check terminal singularities directly from the weight matrix. The authors develops a new algorithm that is 15 times faster than the naive approach but still orders of magnitude slower than the ML classifier. They then conclude that the ML results suggest that a simpler criterion exists. Facilitated by the faster ML model, the authors create and visualize a dataset of 100 million examples, which provides new insights for the patterns in the classification.\n\nSTRENGTHS:\n- This paper provides an excellent example that shows how ML can be used to guide research in mathematics. The authors use neural networks to accelerate the classification of Fano-varieties. The computation speed by neural networks motivates new classification algorithms and suggests room for even faster ones. The trained ML model is then used as a surrogate to generate large amount of data which would be prohibitively expensive using traditional methods, and provide insights that guides theoretical understandings. While ML for science is getting popular in recent years, ML for mathematics is still a new field but has immense potential.\n- The Q-factorial Fano dataset provided in this paper is a valuable assets for both math and ML communities. It will advance the understanding of Q-Fano classification and benefit future development on theorem discovery.\n- The last section provides a number of interesting future directions. By relating the limitations of the current method to fundamental questions in ML (out-of-distribution generalization, data efficiency, geometric deep learning, interpretability), the authors demonstrate the importance of these topics and paves way for a new area in ML research.\n\nWEAKNESSES:\n- The mathematical objects studied in this paper is not very accessible to people without a math background. As a result, the significance of results, such as the analysis of invariant of Fano-varieties section 6, is not as strong as it could be. This is perhaps due to the large amount of prerequisite for algebraic geometry, but the authors could include more introductory materials, for example, in the appendix. \n- While the AI-assisted workflow is novel, the contribution on machine learning is limited. In particular, the neural network uses multilayer perceptron, and no justification is given for the architecture choice. The theoretical result in section 5 may not be interesting to a NeurIPS audience. \n- The claim that “the ML results suggests that a simpler criterion exists” for Q-Fano classification (line 82) is not well supported. The ML model does not have 100% accuracy and does not generalize when weights matrices fall outside of the range used in training. Hence the provided results does not prove that the ML model has found a simpler and correct criterion.\n\nQUESTIONS:\n- Would it be possible for the authors to comment more on the significance of the classification of Q-Fano varieties? \n- Does detecting terminal singularities have other applications beyond a criterion for Q-Fano varieties?\n\nLIMITATIONS:\nThe authors point out limitations in Section 7. There are no potential negative societal impacts of the work.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2023-07-07"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper describes an ML assisted approach to the classification of Q-Fano varieties. Checking whether the singularities of a given Q-Factorial Toric variety is very challenging by mathematically established methods, involving intensive combinatorial computations. This paper applies supervised machine learning to this problem, training a feedforward NN classifier to detect terminal varieties on a balanced dataset of 5 million 8-dimensional Q-Factorial Fano toric varieties of Picard rank 2 (there exists already a fast combinatorial formula for detecting terminality in Picard rank 1). The obtained classifier obtains a 95% test accuracy on a test set of 5 million samples from the same distribution as the training data. This is surprising because the classifier is much more efficient than known combinatorial techniques, and uses only the weight matrix corresponding to the variety. The good test performance can thus be interpreted to indicate new mathematical techniques to discover.\n\nTaking inspiration from this, the second contribution of the paper is to develop an algorithm that detects terminality, directly from the weight matrix, for Q-Factorial Fano toric varieties of Picard rank two. This is the first algorithm that uses only the weight matrix in the case of Picard rank 2, and is measured to be ~15 times faster than existing methods. The new algorithm however, remains slower than the classifier. Additionally, weight information that is used by the new algorithm is unavailable to the NN classifier, having been destroyed by the encoding and regularization. This indicates that more mathematical discovery is possible.\n\nFinally, the trained classifier is used as a tool to generate a dataset of \"probably terminal\" examples, i.e. examples that are predicted to be terminal by the classifier. This generation is much more efficient than rigorously checking terminality. A dataset of 100M probably-Q-Fano toric varieties are then investigated by performing an $\\mathbb{R}^2$ projection based on the regularized quantum period. This leads to some interesting observations about the distribution of such varieties, with the authors particularly remarking on the shape of the support and the stratification by Fano index.\n\nSTRENGTHS:\nThe paper makes a compelling and original case for the utility of machine learning in pure mathematics. It highlights that the performance of a classifier can be an indicator of the existence of undiscovered mathematical structure: the setting here is particularly interested due to the large discrepancy between the prediction and known mathematics. It also highlights the value of an efficient classifier for data generation that may allow for numerical investigations into the underlying structures. The new algorithm for detecting terminality is of possible additional interest.\n\nThe paper also does a good job of highlighting the differences between the classifier and rigorous techniques (including the new algorithm developed here). There is also a clear discussion of the current limitations of ML assisted mathematics in this setting and general directions for future improvement.\n\nWEAKNESSES:\nI do not see any glaring weaknesses. The approach as currently presented has limitations: the data requirements and poor OOD performance being the primary ones, but these are openly addressed and to be expected in early works in the field. The poor OOD performance is in my opinion the biggest obstacle to the claims of the paper, raising the troubling possibility that the better performance of the classifier comes from some 'finite size effect' due to the particular weight bound.\n\nQUESTIONS:\nIs it reasonable to expect that a NN classifier trained and tested on a dataset with larger weight bounds would retain the surprising performance noted in the paper? Numerically probing this may be too onerous, but if the authors could describe some intuition it would help my understanding.\n\nLIMITATIONS:\nYes", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2023-07-15"}