How FunSearch Found a New Route Through a Math Problem
Google DeepMind’s FunSearch paired a code-focused large language model with systems that checked and ranked its suggestions. After millions of attempts, it produced a correct, previously unknown solution to the cap set problem, and also found a faster approach to bin packing.
A large language model can produce a lot of code that goes nowhere. Google DeepMind’s FunSearch is built around that limitation: it generates suggestions, checks them, and feeds the strongest candidates back into the process. The method helped researchers find a previously unknown solution to the cap set problem and a faster way to approach bin packing.
“FunSearch is a research system that uses code suggestions and filtering to find mathematical solutions, with no clear lean toward harm or human deskilling.”Why it scores Neutral
A search process built around filtering
FunSearch uses Codey, a version of Google’s PaLM 2 fine-tuned on computer code. Researchers begin by writing a partial program in Python that describes the problem, while leaving out the part that specifies how to solve it.
Codey fills in that gap by proposing code. Another algorithm checks and scores the proposals. The system saves the strongest suggestions, including some that are not yet correct, and gives them back to Codey to guide later attempts.
The process relies on selection rather than treating every output as useful. Many suggestions are nonsensical, but the researchers’ approach is to identify the few promising ones and repeat the search from there. FunSearch made a couple of million suggestions over a few dozen rounds, a process that took a few days.
What the cap set problem asks
The researchers used FunSearch on the cap set problem, which asks for the largest possible size of a particular kind of set. One way to picture it is to place dots on graph paper while avoiding any three dots that form a straight line.
The problem is highly specialized, and mathematicians do not agree on how to solve it, let alone on what the solution is. FunSearch produced code that generated a correct solution that had not previously been known.
The result matters in part because the cap set problem is connected to matrix multiplication, the computation that AlphaTensor found a way to speed up. Terence Tao, a mathematician at the University of California, Los Angeles, described the cap set problem as “perhaps my favorite open question” in a 2007 blog post.
Why code changes the approach
Earlier DeepMind systems AlphaTensor and AlphaDev treated mathematical and computing problems more like games such as Go or chess. That approach delivered results in particular areas, but it could be limited in scope: AlphaTensor, researcher Bernardino Romera-Paredes said, is strong at matrix multiplication and little else.
FunSearch instead searches for a program that generates a solution. In principle, researchers can change the code task to tackle different problems. And because the answer is a recipe, it can be easier to inspect than an unusual mathematical object produced by the search.
That distinction offers a way to use a general language model while relying on other systems to check its work. The model proposes possibilities; scoring and filtering help researchers focus on candidates that may be worth pursuing. The approach does not make every output reliable, but it creates a process for finding and testing useful ones.
A second test in bin packing
To see whether the method could stretch beyond the cap set problem, the researchers applied FunSearch to bin packing. The task is to fit items into as few bins as possible, a problem with applications ranging from data center management to e-commerce.
FunSearch found an approach that was faster than methods devised by humans. That result suggests the system can contribute beyond one mathematical question, although the source describes only these two applications.
Terence Tao called the approach a promising way to use large language models. Researchers are still working out how to incorporate such models into research while using their strengths and limiting their drawbacks. FunSearch offers one possible path: use a model to generate code, then use checks and repeated selection to find outputs that stand up to scrutiny.
Read next