Research Grants

The Challenges of Space Exploration

Caltech’s math lab is looking for elusive objects in immense spaces. Here, a clever search design is worth a billion tokens.

By Stan Fedotov

These days, much is being said about AI solving mathematical problems. Proving theorems is only one part of the picture. Sometimes, the job is to find an example. And at times, it’s a hell of a job.

A Caltech group led by Sergei Gukov is taking on that kind of search, supported by a Nebius compute grant. In the hardest problems of mathematics, progress can hinge on finding a rare object that refutes a conjecture or points towards a proof, or on discovering new arguments and levels of abstraction. If better search algorithms work, they do not merely speed up computation. They change which questions are even worth asking.

There are various tools for searching in huge and complex spaces — from heuristic-heavy combinatorial search to letting an AI agent find the right search algorithm for you. Gukov’s group is striving to discover new AI architectures and techniques motivated by math applications.

Some of the immediate problems the Caltech Math AI team is tackling today include finding better algorithms for long-horizon sparse-reward tasks and solving out-of-distribution challenges needed for superintelligence. Three recent Caltech papers demonstrate what’s involved in this process.

Task 1. Hadamard conjecture

Paper: New Records for the Hadamard Maximal Determinant Problem https://arxiv.org/abs/2608.22518

This video is provided by the Caltech Math AI team.

Imagine you have a square matrix of size n consisting only of 1 and -1. How large could its determinant be? For n divisible by 4, it’s conjectured that the maximal value is 𝐷(𝑛)=𝑛^(𝑛/2) and it’s achieved on some orthogonal (Hadamard) matrix.

For n=4, it’s 16, and it’s achieved, for example, at

Generally, the maximal determinant value is unknown. Especially mysterious is the case of 𝑛≡3 (mod 4), where Det-maximal matrices are known only for n < 23.

Gukov and his team were able to increase the known maximal determinant for n = 51, 103, 107, 111, 115, 119.

Task 2. Finding the longest possible snake in an n-dimensional hypercube

Paper: New Snake-in-the-Box Records via Snakepit Surgery and Learned Construction https://arxiv.org/abs/2607.15270

This video is provided by the Caltech Math AI team.

A snake is a path along the edges of the hypercube that visits no vertex twice and has no shortcuts: two nonconsecutive vertices of the snake must never be adjacent in the hypercube.

Here is an example of a snake in a 4-dimensional hypercube:

And the following path is not a snake, because vertices 1000 and 1100 can be connected with a shortcut.

For a 4-dimensional cube, the longest snakes have 8 vertices and 7 edges, like the one on the first image. For an 8-dimensional cube, it’s proved that the longest snakes have 99 vertices. For n=9, we don’t know the answer.

For 14 years, the record 190 had stood for n=9; recently, the Caltech Math AI team has managed to lift it to 191. They also obtained longer snakes than previously known for n=10, 11, 12, 13.

Task 3. Andrews-Curtis conjecture

Papers: https://arxiv.org/abs/2408.15332 and https://arxiv.org/abs/2606.21611

This video is provided by the Caltech Math AI team.

A group is a set whose elements we can multiply and invert. For example, permutations on an n-element set are a group: we can combine two permutations by performing one after another, and this will be another permutation. We can also invert a permutation. Isometries (rigid motions) of a plane also form a group.

Now, one of the ways of defining a group is by generators and relations

  • If a group G is generated by x and y, it means that every element of a group is a word in x, y, x⁻¹, y⁻¹. For example, x⁻²y³xyxy⁷.
  • Some of the words may be trivial (equal to the identity of the group) — those are relations. Different sets of relations define different behaviour of group elements. For example, if y² = e is a relation, then y⁻¹ = y. Indeed, y · y = y² = e. But if y³ = e is a relation, then y⁻¹ = y².

Now, let’s ask a very natural question: given generators and relations, can we say whether a group has any elements apart from e?

Let’s take a specific set of relations:

xy = e

xy² = e

It is as if you’re solving a non-commutative system of equations. And for that, we can employ something not completely unlike gaussian transformations for linear systems:

  • Invert an equation. For example, (xy)⁻¹ = e follows from the first one.
  • Multiply two equations. We can multiply (xy)⁻¹ = e on xy² = e, obtaining y = e. (Now from xy = e it follows that x = e).
  • Cyclically shift the left parts of equations. For example, xy² = e, is essentially xyy = e, and it gives us yxy = e. This comes through conjugation: xy² = e means y·(xy²)·y⁻¹ = yy⁻¹=e. And y·(xyy)·y⁻¹ is exactly yxy.

These transformations are known as Andrews-Curtis moves (AC moves).

With linear systems, we can always find a solution using Gaussian elimination. What about the non-commutative case? Imagine we know for certain that the group is trivial, so x = y = e is the solution. Can we solve the system with Andrews-Curtis moves and establish this trivial solution?

In general, the answer is negative. Moreover, it’s known, from the theorem by Adian and Rabin, that there’s no algorithmic way of deciding whether a group is trivial or not. But the Andrews-Curtis conjecture states that, if the number of generators is the same as the number of relations (as many equations as there are variables), the trivial solution can be established with Andrews-Curtis moves. The conjecture doesn’t suggest any algorithmic way of finding this AC move sequence, though.

One of the approaches to the conjecture is probing potential counterexamples, such as Akbulut-Kirby groups 𝐴𝐾(𝑛) given by relations

𝑥ⁿ = 𝑦ⁿ⁺¹, 𝑥𝑦𝑥 = 𝑦𝑥𝑦

It’s known these groups are trivial, so the task here is to find the sequence of AC moves establishing x = e, y = e.

Such a sequence is only known for n = 2. While some progress is being made, all the known methods seem to hit more or less the same wall and fail for even n = 3. Maybe the ongoing challenge launched by Sergei Gukov, Terence Tao, and Lucas Fagan (SAIR Foundation and Caltech) will bring additional insights.

Why are those problems difficult?

It’s because search spaces are really huge and grow staggeringly with n.

For the Hadamard problem, the naive search space is around 10²⁹ at n = 103, growing a factor of about 16 per step of 4 in n.

A straightforward proof that there are no snakes of length 100 in a 8-dimensional hypercube would require checking all length-100 paths up to symmetries and other useful heuristics. Such a computation was estimated at roughly 45 CPU core-years, which is doable (and accomplished) even if tedious. Now, if you want to just go through each and every path of length 191 in a 9-dimensional hypercube in search of a snake, it might require something like 10³⁰ core-years.

In the Andrews-Curtis problem, AC move trajectories may span hundreds or even thousands of moves in the huge spaces of words in x, y, x⁻¹, y⁻¹. What’s worse, we don’t even know if the paths we seek exist, and if they do, they may behave quite badly. Relations in the AK (3) group have a total length of 13, but the path for it, if it exists, might climb to very high lengths before eventually going down to x, y. This is one of the problems where you don’t know if you’re failing because your tools are poor or because the question didn’t have the answer in the first place.

To approach such challenging problems, you need clever search space design, not just cool ML models.

Search procedures we’ll be discussing are iterative: you start with some initial object (a snake, a matrix, a system of noncommutative equations), and on every turn you can change this object somehow — for example, add an edge to a snake, change some signs in a matrix, or perform an AC move. Your hope is to move efficiently towards the optimal object.

This video is provided by the Caltech Math AI team.

Before you even start choosing a search algorithm (agent), you need to fix an environment, which is a particular formalization of the problem, including:

  • Which objects we consider and how we represent them (state)
  • What is a single search move (action)
  • How we decide whether a new state is better than the previous one or not (reward)

The agent is a mechanism that chooses the next action for a given state and, potentially, some previous history. It might be a machine learning model, but not necessarily.

And selecting each of them might be tricky. Quite often, the default environment will make for a very tough search problem, so what enables successful search would not be a very sophisticated algorithm, but the right choice of environment.

Gukov underscores that, in each of the three tasks, they needed a great deal of experiments with different environments and agents to find the right one. Also, deep knowledge of the underlying mathematics is often used — and it was especially important in the Hadamard problem.

Let’s see how different elements of the environment are chosen in these three tasks.

State

In the Hadamard problem, we could work with the ±1 matrices, which are perfectly convenient objects to work with. But you’d have to thoroughly simplify the search space to make the search problem solvable, often restricting to particular convenient families.

For the Hadamard problem, a popular choice is block matrices with circulant blocks, e.g.:

Here, j is a vector of 1s, and A, B are circulant matrices, that is the rows of each of them are cyclic shifts of the first row.

By restricting to this particular family, we reduce the size or a parameter space from N² of ±1s (the whole matrix) to just (N-1) of ±1s, which is the first rows of A and B.

(This block shape isn’t random: there are theoretical reasons to search for larger, if suboptimal, determinants among such matrices.)

In the snake-in-the-box problem, Gukov’s group did something opposite — they expanded the search space, considering not only snakes, but, more generally, snakepits — sets of disjoint snakes with no cube edge between different snakes.

The problem they moved on to solving then was finding the longest snakepit.

Rewards

Even before speaking of how we head towards the goal (actions), let’s discuss how we understand if we’re getting better — rewards. You can’t find anything unless something — like rising heat — points you towards the object you seek. So, designing the right reward is the crucial thing.

In the Snake-in-the-box paper, Gukov’s group used the following reward (for which they used the term energy; you’ll see why later):

Here, F is a snakepit, c (F) is the number of components (individual snakes), and v (F) is the number of vertices occupied by the snakepit. It would be almost the number of edges in all the snakes, if not for the coefficient β, which is the cost of introducing a new snake. They experimented with β; sometimes, it might even be varied along the trajectory.

But this is an easy example. In the Hadamard problem, Gukov’s team had to use a really complicated reward function at one stage. (The math that motivated it is a bit too tough for this paper.

And sometimes, you may be short of good reward options. Andrews-Curtis is one such example.

Indeed, while solving a non-commutative system of equations, how could you understand if you’re approaching the x = e, y = e solution? A seemingly plausible option is the overall length of the equations. In our first example, we had

(xy, xy²) → (y⁻¹x⁻¹, xy²) → (y⁻¹x⁻¹, y⁻¹x⁻¹xy²) = (y⁻¹x⁻¹, y) → (yy⁻¹x⁻¹, y) = (x⁻¹, y) → (x, y)

So, the lengths progress as 5 → 5 →  3 → 2 → 2.

If only it were always like that! Alas, real trajectories have spikes and long periods of length, dragging back and forth until the trajectory finally finds the right bottleneck.

To the best of our knowledge, there’s no magic reward for Andrews-Curtis, so it’s still something to ponder.

Actions

Search algorithms are iterative procedures, and it’s important to choose what kind of iterations to make.

Take the snake-in-the-box example:

  • You can try growing a snake from scratch vertex by vertex (action is adding the next edge to the path). But even if you can somehow predict which direction will eventually give a snake of length 190, it’s not guaranteed to extend to 191. So, steering gradual growth is a precarious task.
  • You can also try to increase length by mutating given snakes (an action is a mutation of the whole snake). But long ones are usually quite rigid in the middle: almost any mutation will create an illegal path.

These two problems plague many of the large-space search problems, and every victory in such tasks is sometimes an engineering masterpiece.

To obtain the length-191 snake examples, the Caltech Math AI team successfully used many different kinds of actions to choose from, including:

  • Splitting a snake into several ones — a snakepit
  • Discard the tail of one of the snakes in a snakepit and regrow it back randomly.
  • Surgery: clearing part of a snakepit inside a subcube and populating it anew (this action is capable of connecting several snakes in a snakepit into one snake, but doesn’t necessary do it)

Here’s an example of a surgery:

In the Andrews-Curtis, one of the problems is that solution trajectories can be really long (hundreds or even thousands of AC moves). And as saw above, even the best AC move possible can locally look like a leap of faith, increasing the length of the overall presentation.

One of the ideas Gukov’s team shared in the original paper “What makes math problems hard for reinforcement learning: a case study” was using super moves: sequences of original moves that are used as one move.

In their second paper dedicated to Andrews-Curtis, the Caltech Math AI team decided to work with specific super-moves instead of the original AC moves.

Their motivation comes from the observation that the most powerful move sequences are the ones that cancel something in the equations. An example is (y⁻¹x⁻¹, xy²) → (y⁻¹x⁻¹, y⁻¹x⁻¹xy²) = (y⁻¹x⁻¹, y). But sometimes, we’d need to “insert” one equation inside another. For example,

(x⁻⁶y⁻⁵, xy²x³yx⁵y⁶x⁴yxyxyx) → (x⁻⁶y⁻⁵, xy²x³y · x⁻⁶y⁻⁵ · x⁵y⁶x⁴yxyxyx) = (x⁻⁶y⁻⁵, xy²x³yx⁴yxyxyx)

This cancellation can also be achieved as:

(x⁻⁶y⁻⁵, xy²x³yx⁵y⁶x⁴yxyxyx) → [several cyclic shifts of the second relation] → (x⁻⁶y⁻⁵, x⁵y⁶x⁴yxyxyxxy²x³y) → [multiplication] → (x⁻⁶y⁻⁵, x⁻⁶y⁻⁵ · x⁵y⁶x⁴yxyxyxxy²x³y) = (x⁻⁶y⁻⁵, x⁴yxyxyxxy²x³y)

So, the super moves Gukov and his team use are:

  • Cyclically shift the first relation.
  • Cyclically shift the second relation.
  • Multiply one of them on another.

They are more complicated than the original ones, and there are many more of them, but they typically allow to reach the solution x = e, y = e quicker.

Another idea, which is, for now, theoretical is to allow super moves to be learnt by an agent during its training. And at this point, let’s turn to agents.

Agent

An agent is the mechanism of choosing the next action.

If you have a relatively small number of available actions, you can just choose the next action based on the next state’s reward. (If only this worked all the time!)

In more difficult situations, you can use a trainable agent — an ML model trained to predict the next action from the current state or some state history. There are several training strategies, including:

  • Imitation learning: train the model on “golden” search trajectories. Means you must have a way of getting “golden” trajectories — but can you really have it if you’re searching for something untold before?
  • For example, in Andrews-Curtis, you can choose relations which still give x = e and y = e, but are simpler than AK (3), and train a model on their solution trajectories. But models trained with existing data seem to hit the same wall. It seems to imply that to crack AK (3), an agent needs to learn to step out of the box.
  • Reinforcement learning: allow the model to learn by trial-and-error, maximizing the reward along the runs. This way, theoretically, a model can learn some new tricks.

Gukov and his team experiment much with Reinforcement Learning. It’s still difficult though.

RL is notoriously hard to train, even after you’ve chosen the right environment (which is an ordeal itself). Also, there’s a problem of a learning curve. Since the model will have to learn how to solve your tasks through trial and error, you can’t just leave it alone with the hardest problems — it just won’t solve it, will get no reward and will learn nothing. So, you need to start with simpler tasks.

But some of the tasks we consider, including Andrews-Curtis, exhibit a problem which Gukov and his team refer to as the two-hump problem. There are simple examples, where it’s not that hard to get a solution, and hard examples, for which we have no idea how to get a solution — and very little in between. And however much you train the model on simple tasks, it likely won’t invent a decisive trick for the hard ones.

Sometimes, you need special architecture to accommodate your problem.

Andrews-Curtis is a good example. As we discussed above, cyclic shifts of relations don’t change the group: xy²x = e, x²y² = e, and y²x² = e are equivalent equations in a group. In their second paper, the Caltech Math AI team decided to leverage it and suggested a shift-invariant transformer architecture.

Long-horizon challenges

Exploration is quite an issue with long-horizon search — how does a model invent a solution trajectory which is hundreds or thousands of steps long, if the reward isn’t much of a help along the way?

Interestingly, it mirrors the development of RL for Atari games.

In a particularly notorious AI game Montezuma Revenge, a player needs to perform around 100 actions to complete the first rewardable action. With 18 available actions, a random policy never makes it. And without positive reward, there’s no training. Only the emergence of advanced exploration techniques such as Go-Explore or RND allowed researchers to crack this game.

Sometimes, hybrid learning helps too: pre-train on some good trajectories first, to give the agent the taste of it, and then allow RL to do the thing. Calling on the Atari analogy, supervised pretraining on screencasts of human players of Montezuma Revenge also allowed the model to get an initial understanding of the game and start getting some reward and learning.

For an interesting example of how exploration works, let’s look at the Snake-in-the-box problem.

Given a snakepit, the algorithm randomly chooses a modification (adding or removing a vertex, performing local surgery, rebuilding the end of a snake). The action is accepted or rejected with probability min{1, exp (−𝛥𝐸/𝑇)}, where 𝛥𝐸 is the change in energy (reward) and T is the temperature parameter.

Higher temperatures produce more lenient accepts; lower temperatures more conservatively choose the optimal moves. During the search, temperature is changed according to the schedule below. Epochs of high temperature, where snakes split and chaos reigns, are followed by periods of steady optimization. And at some point, the length-191 example manifests.

Takeaways

After the Navier-Stokes moment, we all have a temptation to just throw uncounted tokens at a problem and hope that AI will find the way. In some situations, it will. But Sergei Gukov and his team operate with problems where AI fails on its own.

These problems show how much depends on decisions made before the algorithm starts working. Which objects should it consider? Which moves should it be allowed to make? What counts as progress when a promising route may initially look like a step backwards? Answering those questions takes mathematical insight, and the answers can matter as much as the choice of an ML model.

For example, it’s known that OpenAI approached the Hadamard Problem and didn’t obtain the results achieved by the Caltech Math AI team. Even today, human ingenuity can still crush LLMs using carefully tailored environments.

Sign in to save this post