Generative Modeling for Mathematical Discovery

Abstract

We present a new implementation of the LLM-driven genetic algorithm {\it funsearch}, whose aim is to generate examples of interest to mathematicians and which has already had some success in problems in extremal combinatorics. Our implementation is designed to be useful in practice for working mathematicians; it does not require expertise in machine learning or access to high-performance computing resources. Applying {\it funsearch} to a new problem involves modifying a small segment of Python code and selecting a large language model (LLM) from one of many third-party providers. We benchmarked our implementation on three different problems, obtaining metrics that may inform applications of {\it funsearch} to new problems. Our results demonstrate that {\it funsearch} successfully learns in a variety of combinatorial and number-theoretic settings, and in some contexts learns principles that generalize beyond the problem originally trained on.

Publication
Preprint

In this paper, we provide an implementation of the LLM-driven genetic algorithm funsearch, designed to genetically evolve python functions by sampling from third party LLMs to construct examples of interest to mathematicians. The code is designed to be useful for working mathematicians. It does not require machine learning expertise or high-performance computing resources. We benchmark the implementation on various LLMs for three problems in combinatorics and number theory. We also explore in depth how the model can be used to potentially learn principles that generalize beyond the training distribution through the example of finding large isosceles-free subsets of an integer lattice.

You can find relevant code here.

Karan Srivastava
Karan Srivastava
PhD Student, Mathematics

My research interests include machine learning, reinforcement learning, combinatorics, and algebraic geometry

Related