WorksComputer Science
Agentic Computational Algebra
Abstract
We explore the use of AI agents for solving computational problems in algebra. For the problems we consider, the main challenge is not correctness but time: general-purpose algorithms are guaranteed to provide correct solutions but can be prohibitively slow, while reformulations that exploit special structure often allow solving a problem much faster. We propose to use this setting to evaluate how effectively agents discover and exploit structure within and across tasks to reduce computational costs. More broadly, computational algebra supplies infinitely many problems with independently verifiable answers and systematically controllable structure and difficulty. To illustrate these possibilities, we use benchmark families of systems with controlled shared structure and evaluate agents in three settings: solving independent instances, solving online streams of related instances using persistent memory, and compiling a fast reusable solver for a known problem family. Our experiments show that (i) agents can extend the range of systems solvable within a fixed budget, although reasoning overhead can sometimes outweigh computational savings; (ii) memory can reduce the cost of repeated solving but may preserve suboptimal strategies; (iii) compilation produces faster reusable solvers but at substantial upfront cost. Overall, computational algebra offers concrete, measurable targets for improving how agents discover and reuse structure.
Introduction
Many questions in the sciences come down to systems of polynomial equations and inequalities: in robotics, configuring a robot arm to reach a given point [Wampler and Sommese, 2011]; in data analysis, recovering a low-rank tensor from linear measurements [3]; in economics, computing mixed-strategy Nash equilibria of finite games [15]. Tools from computational algebra—including Gröbner bases, resultants, real quantifier elimination, and certified homotopy continuation—provide exact or certified methods for solving such systems [5] (Sturmfels 2002). In practice, however, these approaches are computationally very expensive, and solving even moderately sized systems can be prohibitively costly. Moreover, the same algebraic problem can admit many valid reformulations and solving strategies, whose execution costs can differ by orders of magnitude. Expert judgment is therefore often needed to choose an effective representation and method.
In this paper, we explore whether AI agents can help with these choices by recognizing hidden structure, reformulating problems, and reusing computations across related instances. For the problems we consider, general-purpose algorithms provide a guaranteed route to a correct solution, but an agent can sometimes discover a faster specialized approach. In such cases, the time saved by a faster solution method must outweigh the agent’s cost of discovering it; however, savings can accumulate if the method is reused across related instances. To explore these tradeoffs, we evaluate independent instances, online streams with persistent memory, and compilation of reusable solvers.
More broadly, computational algebra offers a rich domain for studying how agents can exploit structure within and across tasks to reduce costs, a core aspect of general ‘agentic learning.’ Algebraic constructions allow us to generate problem families with known opportunities for simplification or reusable computation, vary their difficulty, and change how structure is presented to a solver. Our experiments illustrate these properties in the three settings above, and provide initial evidence that agents can find approaches that lead to speedups compared to direct solver baselines. However, they also show that reasoning and memory overhead can prevent solver improvements from translating into end-to-end gains, and that agents often remain substantially slower than baselines that exploit known structure.
Related work. Language models have been used to search for mathematical constructions [16] and to solve olympiad geometry problems with a symbolic engine in the loop [Trinh et al., 2024]. Automated research systems such as AlphaEvolve [13] and autoresearch [9] use evaluator feedback to iteratively improve programs, an approach similar to our compilation regime. The compilation setup also connects to the problem of generating fast specialized polynomial solvers, developed extensively for minimal problems in computer vision [10]. Machine learning has also been applied to algebraic tasks such as selecting monomial orderings [4] and selecting S-pairs [14] in Gröbner basis computation. Persistent agent memory has been studied through self-reflection and reusable skill libraries [Shinn et al., 2023, Wang et al., 2024]. Our emphasis on computational cost is related to recent work on agents as universal solvers [1] and to the evaluation of Las Vegas algorithms [12, 8].
Setup
Problems and solvers. A problem consists of an input and an “output contract,” specified operationally by an independent verification procedure. A solver takes an input and attempts to produce a candidate answer that passes the verification. While this setting is general, in this work we focus on solving zero-dimensional systems of polynomial equations, i.e., systems that admit finitely many complex solutions. Unless stated otherwise, we ask for all solutions over the complex numbers in exact form via rational univariate representations (RURs [17]); see Appendix § 5.
General-purpose solvers. Zero-dimensional polynomial systems with rational coefficients can always be solved exactly and systematically. A standard class of approaches relies on computing a Gröbner basis: a set of polynomials with the same solution set as the original equations that enables convenient computations using linear algebra, including the construction of an RUR of the solutions. Such a basis can be computed by iteratively applying algebraic reductions, but this is often computationally very expensive. Solvers such as msolve implement this pipeline [2]. Gröbner-basis computations are also available in computer algebra systems such as Singular [6], Macaulay2 [7], and SageMath [The Sage Developers, 2026].
Agentic solvers. An agentic solver uses a language model to organize computation with tools, optionally with a persistent memory for retaining useful strategies or computations across problem instances. In our setting, the agent can inspect the input equations, propose and test reformulations, invoke general-purpose solvers, and assemble an answer that satisfies the output contract. This is illustrated in Figure 1.

Figure 1. Hidden-monomial example: the agent reduces degree-171 equations to three cubics and returns all 27 solutions, while direct msolve times out. Agent output is paraphrased.
Problem families. A problem family is a collection of problems defined by a shared parameterized construction. For polynomial systems, the parameters can control features such as size, degree, and coefficients, allowing systematic variation of difficulty and shared structure. Our benchmarks use families with known opportunities for efficient solving and reusable computation. The concrete constructions are described in Appendix § 6.
Evaluation regimes. We compare agentic solvers and general-purpose solvers in terms of the computational cost (time) to produce a valid answer. For agents, this includes model reasoning, tool execution, and any memory maintenance, while independent evaluation of the output is excluded. We consider three settings:
Independent instances: the agent solves each problem in a fresh context, without retaining state between instances.
Online stream: the agent receives problems one at a time from a problem family. The agent answers each problem and may retain a state (memory) between them.
Compilation: the agent receives a specification of the family and must produce a reusable solver that is frozen before evaluation.
In the first two regimes, the agent produces answers to individual systems; in compilation, it produces a reusable solver artifact whose execution is evaluated on held-out problem instances. In this case, we distinguish the upfront cost of constructing the solver from its subsequent execution cost.
Experiments and results
We evaluate Claude Code agents using Claude Opus 5 in the three regimes described above. In the independent-instance and online-stream settings, they have access to msolve [2], SageMath [The Sage Developers, 2026], Singular [6], and Macaulay2 [7].
Independent instances. We first ask whether an agent can recognize special structure in individual systems and use it for faster computation (Figure 1). To this end, we consider three families with known efficient reformulations, described in Appendix § 6.§ 1. The agent receives the equations without structural hints and solves each instance in a fresh context, without retaining any memory across instances. Table 1 compares direct msolve, a structural oracle using the known reformulation, and the agentic solver, across three size settings per family with 12 fresh systems per setting. Within the 600-second budget, the agent solves 103 of 108 systems, compared with 60 for direct msolve and 108 for the oracle. The agent solves every system completed by direct msolve, plus 43 additional systems on which the direct solver times out. However, among the 60 systems completed by both methods, the agent is faster on only 12, and its wall time remains much larger than the oracle’s. These results show that agents can extend the range of problems solvable within a fixed time budget, but reasoning overhead can outweigh computational savings on easier instances. Additional diagnostics are given in Appendix § 8.§ 1.
| Family | Size | Direct msolve solved | Direct msolve s | Oracle solved | Oracle s | Agent solved | Agent s |
| Hidden monomial | 12/12 | 2.2 | 12/12 | 0.046 | 12/12 | 229 | |
| 12/12 | 228 | 12/12 | 0.046 | 12/12 | 261 | ||
| 0/12 | 12/12 | 0.046 | 12/12 | 230 | |||
| Hidden triangular | 12/12 | 9.3 | 12/12 | 0.035 | 12/12 | 127 | |
| 0/12 | 12/12 | 0.049 | 9/12 | 297 | |||
| 0/12 | 12/12 | 0.052 | 10/12 | 286 | |||
| Polynomial eigenvalue | 12/12 | 9.0 | 12/12 | 0.063 | 12/12 | 145 | |
| 12/12 | 152 | 12/12 | 0.071 | 12/12 | 139 | ||
| 0/12 | 12/12 | 0.081 | 12/12 | 121 |
Table 1. Independent-instance setting: solved counts and median wall time per attempt (s) over 12 systems per configuration with a 600 s budget. For eigenvalue systems, is the matrix size and the polynomial degree. Direct: msolve on the input equations. Oracle: structural solver using the supplied hidden structure. Agent: Claude Opus 5 without structural hints. Times include unsuccessful attempts and exclude independent verification. All attempts timed out.
Online stream. We next investigate whether memory can reduce the cumulative cost of solving related systems. In our experiments, we use system families constructed by requiring a quintic with polynomially parameterized coefficients to have prescribed root multiplicities. Within each stream, the multiplicity pattern and coefficient-map degree are fixed, while the coefficient maps vary between instances (Appendix § 6.§ 2). Figure 2 shows two streams of 20 systems: pattern (4, 1) with coefficient-map degree 6 (left), and pattern (3, 1, 1) with coefficient-map degree 12 (right). Each solve has a 600 s wall-time budget, with up to 180 s per memory update. Cumulative costs include the time spent on unsuccessful attempts. For each pattern, a fixed “multiple-root locus” ideal describes the allowed coefficient vectors; substituting the coefficient maps yields a system with fewer unknowns, after which the eliminated coordinates can be recovered. Our Oracle baseline uses this approach with msolve. In addition to evaluating learned memory starting from an empty state, we also consider a “planted memory” that is initialized with the ideal for the family and recovery guidance, and which remains writable throughout the stream.
Figure 2. Online streams of 20 quintic systems: with coefficient-map degree 6 (left), and with degree 12 (right). Agent curves show mean cumulative solve-plus-update time over three repetitions on identical inputs and order; shading is sample standard deviation. Costs include unsuccessful attempts but exclude independent verification. Completion counts are in Table 3.
Without memory, the agent incurs greater cumulative cost than direct msolve. Learned memory reduces cumulative cost relative to both the no-memory agent and direct msolve, but remains substantially slower than Oracle. Inspection of the saved memories and submitted reformulations shows that learned memory discovers a partial reduction within the first few systems and then repeatedly reuses it, without adopting the full multiple-root locus ideal. Planted memory uses the full reduction for , whereas both memory conditions retain partial reductions for (Appendix § 8.§ 2). For learned memory, per-instance cost falls rapidly at the start of both streams and subsequently levels off. The notes increasingly emphasize replaying the established pipeline, suggesting that memory can preserve a successful but suboptimal strategy.
Compilation. We next ask whether an agent can implement a fast reusable solver for a known problem family. We use an autoresearch loop as implemented by AutoHelix [Trager et al., 2026], a meta-harness that repeatedly asks an agent to modify a solver, evaluates candidate artifacts on a fixed development set, and retains verified improvements. The resulting solver is frozen before evaluation on held-out systems. We perform three compilation runs for the repeated root problem family with multiplicity pattern (4, 1), using 20 development systems with coefficient-map degrees 3–6. We evaluate the resulting solvers on 60 held-out systems from the same family, with ten at each degree 1–6.
All three final solvers complete all 60 held-out systems, averaging 3.6 s per system versus Oracle’s 19.5 s (5.4× faster). Two solvers recover the full coefficient-locus reformulation used by Oracle in the stream setting; the third retains a partial reduction. All three use msolve over finite fields together with their own code to recover exact RURs with rational coefficients. This speedup takes 11.4 hours of compilation on average, with a projected break-even at 2,600 systems. Earlier stopping trades speed for a lower upfront cost: after two iterations, the solvers average 9.3 s per system with 5.6 hours of compilation, breaking even at about 2,000 systems. Both projections assume the same degree mixture as the held-out set (Figure 3).
Figure 3. Compilation on the (4, 1) family. (a) Mean (bold) and individual (light) execution times across three runs, against cumulative compilation time; numbers denote accepted iterations. (b) Projected compilation-plus-execution time after two or five iterations, using mean compilation costs and execution times across runs.
Discussion
We have proposed agentic computational algebra as a domain for studying how agents discover, memorize, and compile reusable computational structure. The setting supplies infinitely many verifiable problems with large differences in cost between naive and structure-aware solution approaches. We described three evaluation regimes—independent instances, online streams, and known-family compilation—that expose different forms of agent experience.
On independent instances, agents extend the range of systems solvable within a fixed budget, but reasoning overhead often outweighs computational savings on already tractable problems. In the two quintic streams, memory reduces cumulative cost by preserving reusable reformulations. With learned memory, however, the agents settle on partial reductions and repeatedly replay them, remaining substantially slower than the structural oracle. These trajectories suggest that retaining a successful strategy does not necessarily lead to continued improvement. Compilation removes per-instance agent inference and produces solvers that outperform a baseline already supplied with the family’s full reformulation. This gain requires substantial upfront computation, whose value depends on how many problems the solver handles and how much time it saves on each.
Future work could study when agents should continue exploring reformulations, refine their memory, or invest in a reusable solver, depending on the volume and diversity of subsequent problems. More broadly, evaluations could extend beyond zero-dimensional systems to semialgebraic problems or tasks requiring formalization from prose.
Output contract and verification
We require solutions to be returned via a rational univariate representation (RUR) [17, 2]. This is a standard exact representation of a finite solution set and is the format returned by msolve. For convenience, we recall the basic definition here.
Rational univariate representations. The first step is to choose a linear form
For a solution , let . We call separating if whenever . Thus can be seen as a scalar label for the entire point . Since there are only finitely many solutions, a generic choice of the coefficients is separating.
We collect these labels as the roots of a univariate polynomial
Thus, choosing a root of selects one solution. Now to recover the coordinates of the roots we define
Since , the solution with label is given by
The polynomials , , and all have rational coefficients, since algebraic conjugation permutes the solutions and leaves the defining sum unchanged. Also at every root, because labels are distinct. The polynomials , form an RUR of the solution set, with the solutions determined via (1).
Verification. The representation can be checked by manipulating only univariate polynomials with exact arithmetic. Consider the ring
Since is squarefree, is invertible in . A submitted RUR therefore defines elements
For an input system , the verifier checks
where equality in means that the corresponding univariate polynomial has zero remainder modulo . This ensures that every point represented by (1) satisfies the input equations.
To certify completeness (i.e., all solutions of the system are represented by the provided RUR), we use an upper bound on the number of solutions, derived from the family construction. We also check , ensuring that distinct roots of represent distinct solutions. For a zero-dimensional input system, the answer is complete when .
The identities above define an exact output contract. In our experiments, for efficiency, we verify these identities modulo four randomly chosen 60-bit primes for which the representation remains well defined. This avoids expanding the identities over and provides high-confidence probabilistic verification.
Lifted RURs. When an agent solves a reformulated system with msolve, the returned RUR describes the solutions in the new variables. Converting it to an RUR in the original variables can be expensive and require manipulating large coefficients. We therefore also accept a representation that augments the reformulated-system RUR with expressions for recovering the original variables.
For example, suppose the agent solves a system using variables , with rational formulas recovering the original coordinates. If the reduced RUR uses the parameter , then expresses this parameter in the original coordinates. Writing for the coordinates represented by the reduced RUR, the verifier checks
and requires all denominators to be invertible in . The first identity verifies the original equations while the second ensures that distinct parameter values recover distinct original solutions. The verifier also checks that every recovered solution is nonsingular and that the answer is complete ( as above).
Benchmark families
To evaluate agents, we construct polynomial systems with known structure and opportunities for more efficient solving. For independent instances, we obscure a simpler problem through substitutions or an expanded presentation, so that the agent must identify a useful reformulation. For online streams and compilation, we construct related systems for which part of the algebraic computation can be reused across instances.
Independent-instance families
In the independent-instance setting, the agent receives equations without any description of the underlying structure. The Oracle solver implements a known simplification for each family. The families used in our experiments are described below (Table 2 lists the exact configurations).
| Family | Setting | Public | Degree | Reduced | Solutions |
| Hidden monomial | 3/3 | 51 | 3/3 | 27 | |
| 3/3 | 102 | 3/3 | 27 | ||
| 3/3 | 171 | 3/3 | 27 | ||
| Hidden graph | 12/12 | 9 | 1/1 | 9 | |
| 16/16 | 9 | 1/1 | 9 | ||
| 20/20 | 9 | 1/1 | 9 | ||
| Polynomial eigenvalue | 9/9 | 7 | 1/1 | 54 | |
| 10/10 | 7 | 1/1 | 60 | ||
| 11/11 | 7 | 1/1 | 66 |
Table 2. Independent-instance configurations, with 12 fresh systems each. Degree is the maximum total degree of a public equation; gives variables/equations, and Reduced refers to the supplied structural reformulation used by Oracle. Counts are the generic solution counts used in qualification.
Hidden monomial composition. We start with three cubic equations, replace their variables by monomials, and expand. The resulting equations have high degree, but recognizing the recurring monomials restores the cubic system. For each instance, sample three dense cubics , whose coefficients are drawn from . Generically, they have 27 solutions, all with nonzero coordinates. The monomial coordinates are given by
The public equations fully expand . Since , the inverse matrix has integer entries and gives explicit recovery formulas . These products may involve negative powers, so the substitution is invertible where all coordinates are nonzero. For the evaluated values , all entries of are positive. If any were zero, all three would be zero, contradicting the nonzero constant terms of the cubics. Thus no public solutions are lost by using the inverse map. Increasing raises the degree of the expanded system while preserving the three-cubic reduced system and its generic solution count.
Hidden triangular graph. We construct a triangular chain of equations:
with and . Solving this system is straightforward, since each of the nine roots of the first equation determines all remaining coordinates through the recurrence.
We then substitute , where is an integer matrix with determinant , and expand. The agent receives the resulting equations in the coordinates without being given . Recovering the hidden coordinates allows the system to be solved by the recurrence, followed by . Increasing the number of variables enlarges the system while keeping the number of solutions fixed at nine.
Polynomial eigenvalue system. We start with a polynomial matrix
and seek to solve
in the variables . In expanded form, this gives polynomial equations in variables. However, recognizing the matrix structure allows solving through the univariate equation , which generically has distinct roots, and each admits a unique vector with this normalization.
Families with shared structure
For the online stream and compilation experiments, we consider families whose structure can be reused across instances. One way to do this is by fixing polynomial equations and varying the polynomial maps substituted into those equations.
Concretely, fix equations , where contains auxiliary variables and contains parameters. Each instance substitutes , giving
Here is the degree of the polynomial map, and specifies its coefficients. The resulting system has unknowns and .
Eliminating from gives constraints involving only , which can be computed once for the family. Substituting each instance’s polynomial map then gives a system in alone. Solving this smaller system can be much cheaper than the original system, since there are fewer unknowns. However, we must still then recover the auxiliary variables and check the original equations, since elimination can introduce extra candidates.
In our experiments, we use this construction to constrain coefficients of a univariate polynomial to have prescribed root multiplicities. For all patterns below, the coefficient maps have degree at most , with coefficients independently sampled from on all monomials of total degree at most .
Quintics with pattern . For pattern , we require a quintic to have a root of multiplicity four and one remaining root:
The unknowns are and the two factor coefficients ; the variable is used only to express the factorization. Equating coefficients gives the five-variable public system
Here and below, abbreviates . Only these maps change between instances at a fixed degree. The set of coefficient vectors admitting this factorization has degree 8 [11]. A generic degree- coefficient map in three variables therefore gives solutions (1,728 at ).
To obtain the shared reformulation, first treat the quintic coefficients as independent variables and eliminate . The resulting multiple-root locus ideal is
This ideal depends only on the multiplicity pattern. Substituting gives the three-variable system solved by Oracle. On the generic locus, the factor coefficients are recovered by
The verifier checks that the recovery denominator is invertible on the submitted solution set. A simpler partial reduction substitutes into the remaining four equations and retains , leaving four variables rather than three.
General multiplicity patterns. More generally, let be a partition of the univariate degree . The multiple-root locus consists of coefficient vectors admitting a factorization
Its generic points have distinct roots with multiplicities ; the locus also includes cases where roots coincide [11].
We group roots with the same multiplicity into a single factor, so their ordering does not matter. If parts of equal , introduce a monic polynomial of degree and write
The coefficients of these factors are the auxiliary variables . Equating coefficients and replacing by , in variables, gives equations in unknowns. Eliminating the factor coefficients gives the reusable ideal for the chosen multiplicity pattern.
The degree of the coefficient locus is [11]
For generic degree- coefficient maps, the number of isolated solutions is . This also bounds the number of distinct isolated solutions for special coefficient maps: each isolated zero of the square system persists with positive local multiplicity under a sufficiently small generic perturbation, whose total solution count is . The benchmark uses this uniform bound in its completeness check.
Quintics with pattern . Here we require a triple root and two remaining roots. Grouping the latter in a quadratic factor gives
Equating coefficients gives five equations in :
The generic count is , or at . A partial reduction recovers and , leaving three equations in . An equivalent formulation imposes for the quintic . Oracle eliminates all three factor coefficients and solves the multiple-root locus ideal in . To keep the recovery expressions compact, it adds to the reduced RUR and supplies short polynomial lifts for . The submitted reduced RUR therefore has three variables, although the system solved by Oracle has only two.
Supplemental sextics with pattern . The additional stream requires a sextic to be the square of a cubic, giving three double roots generically:
At map degree , the generic count is again . The Oracle eliminates the three cubic coefficients and recovers them polynomially using , , and .
Experimental protocols
Common conventions
Agents use Claude Opus 5. In the independent-instance and stream experiments, they have shell and filesystem access inside isolated containers with msolve, SageMath, Singular, and Macaulay2 installed. Network access is limited to the model endpoint, and agents cannot access the private generation, Oracle, or verification code. Instructions describe the answer format and encourage exact reformulations, compact recovery maps, and early submission for host verification. The task prompts are reproduced in Appendix § 7.5.
Measured solve time includes processing the input, performing algebraic computations, and preparing the submission; agent time also includes model inference. Container startup and independent host verification are excluded. Unsuccessful attempts, including timeouts, contribute their recorded elapsed times. Independent-instance and stream experiments allocate eight CPU cores and 32 GiB per solve. Main compilation evaluations allocate four cores and 12 GB on a separate host. Timing comparisons are made within each experiment.
Independent instances
There are 108 inputs: 12 fresh systems at each of the nine configurations in Table 2. Each input receives one agent attempt in a fresh context with no persistent state. All methods use the same inputs, a 600-second solve budget, and the LiftedRUR contract. Direct runs msolve on the original equations with eight threads. Oracle solves the known monomial or determinant reformulation with msolve; for the graph family, it constructs the RUR by exact back-substitution without calling msolve.
Before running the agents, we checked that each input was well formed and that Oracle returned a complete answer. Solver runtime was not used to select inputs. The five unsuccessful agent attempts were two graph timeouts and three graph submissions rejected for exceeding the 100,000-digit coefficient limit. All remain in the reported counts and medians.
Online stream
Each stream contains 20 fixed systems at a single coefficient-map degree: (4, 1) at degree 6 and (3, 1, 1) at degree 12 in the main figure, and (2, 2, 2) at degree 6 in the supplemental results. We repeat each agent condition three times, using the same inputs in the same order within each family. Direct and Oracle are evaluated once per family. All methods use the LiftedRUR contract. Direct invokes eight-thread msolve on the public equations. Oracle uses the full coefficient-locus ideal. Its time includes per-instance extraction, substitution, solving, and coordinate recovery, but excludes construction of the shared ideal.
The no-memory condition resets context and files for each system. Learned memory starts with an empty text file; planted memory starts with the coefficient-locus ideal and recovery guidance. In both memory conditions, the file remains writable, and each repetition starts from its initial state. Only the text file carries over between systems; conversation state and executable files are reset. Each solve has a 600-second cap, and each memory update has a separate 180-second cap. After each attempt, the agent receives the host’s verification verdict and is asked to update its memory, including after unsuccessful attempts. There is no update after the final system. Reported costs include solve and update time. All conditions receive instructions stating that the stream comes from a fixed family with changing coefficients; no pattern or ideal is explicitly supplied to the no-memory or learned-memory conditions. The public factor-variable names are retained, including their multiplicity labels.
Before running any agents, we replaced one (3, 1, 1) input because Oracle did not certify completeness. We used the first candidate in a fixed replacement list for which Oracle returned a complete answer, keeping the other 19 inputs and their order. Selection depended only on completeness.
Known-family compilation
The main experiment consists of three AutoHelix [Trager et al., 2026] compilation runs for the (4, 1) family. Each starts from the default empty solver stub and receives the family specification, answer contract, and the same 20 development systems with degrees 3–6. The coefficient-locus ideal is not supplied. Solvers may use installed algebra backends and contain multiple files. Hardcoding instance identifiers, coefficients, or precomputed answers is prohibited. The loop evaluates candidates on the development set and retains verified improvements, with a 600 s solve budget per development system. Each run has a limit of five iterations or seven days; all three complete five accepted iterations within this time. Compilation cost is the total elapsed time, including development evaluation and verification.
Frozen solvers are evaluated on the same 60 held-out systems, ten at each degree 1–6, drawn independently of the development pool, with a 1,600 s solve budget per system. All 15 accepted checkpoints solve all 60 systems; held-out results do not influence which candidates the loop accepts. Independent held-out verification is excluded from execution times. All methods use the full RUR contract in the original variables. The environment uses AutoHelix 0.1.1 and msolve 0.10.1.
Runs 2 and 3 use an updated training image with benchmark fixes and larger output limits; the msolve binary and python-flint version are unchanged. Held-out checkpoints and Oracle are timed one at a time, with the host otherwise idle. The projected payback uses the final mean execution times and assumes that future inputs are equally distributed across degrees 1–6, as in the held-out set. It extrapolates beyond the 60-system test.
Oracle output and recovery. The (4, 1) stream and main compilation Oracles solve the same coefficient-locus relations. The stream Oracle returns a lifted RUR with symbolic recovery formulas, while main compilation requires a full RUR expressing every original coordinate directly in the univariate parameter. The compilation Oracle solves the three-variable system with msolve, then constructs the original-coordinate polynomials using serial modular reconstruction and checks the original equations internally. This work is included in its execution time. This additional recovery work, along with differences in inputs, hardware, and core allocations, limits comparisons between the two Oracle timings.
Task prompts
The following task instructions are reproduced from the frozen run files, with line breaks added for readability. The referenced public guide supplies the LiftedRUR format and a small example.
Independent-instance solve prompt. All 108 independent instances use the same task instructions:
Solve the polynomial system in problem.ms exactly. You have at most 600 seconds of
wall-clock time. Minimize time to a complete, correct submission in submission.json.
Use only the shell and installed algebra tools. Before committing to a costly general
solve, look for exploitable algebraic structure or a simpler formulation. You may
solve directly or reformulate. Read /opt/benchmark/LIFTED_RUR.md for the public answer
format and a small format example. Once you have a mathematically justified
submission, finish promptly; the host verifies it, so avoid prolonged independent
audits. Do not inspect or reveal credentials. Write large solver outputs to files and
print only short summaries.
Stream solve prompt. This prompt is used for both memory conditions. The no-memory condition omits the final instructions beginning “Read /work/MEMORY.md.”
Solve the polynomial system in problem.ms exactly. You have at most 600 seconds of
wall-clock time. Minimize time to a complete, correct submission in submission.json.
All problems in this stream come from one fixed generative family with changing
coefficients. Before committing to a costly general solve, look for reusable algebraic
structure or a simpler formulation. You may solve directly or reformulate. Use only
the shell and installed algebra tools. Read /opt/benchmark/LIFTED_RUR.md for the
public answer format and a small example. The container has 8 allocated CPU cores and
32 GiB of memory. For exact RUR output use ‘msolve -P 2 -t 8 -f input.ms -o
output.rur‘. Msolve, SageMath, Macaulay2, Singular, and Python with python-flint are
available. Use ‘sage script.sage‘ or ‘sage script.py‘; plain Python does not have
SymPy. Once you have a mathematically justified submission, finish promptly; the host
verifies it, so avoid prolonged independent audits. Do not inspect or reveal
credentials. Write large solver outputs to files and print only short summaries. Read
/work/MEMORY.md before solving and use any relevant reusable methods. Only the text in
that file can persist between problems; notes may include reusable code as text, but
executable files and the model conversation are not carried forward.
Memory-update prompt. The placeholder <verdict> is replaced by the current case’s host feedback.
You have at most 180 seconds of wall-clock time to update /work/MEMORY.md. Read its
existing contents and preserve useful mathematics and implementation lessons from the
current problem. Only this text persists; reusable code may be recorded as text. Write
useful notes promptly. Small symbolic computations are appropriate, but do not launch
another full-instance solve or a prolonged audit. Record only observed outcomes;
distinguish verified results from untested ideas. Do not store instance-specific
answers or credentials. Use only the shell. Do not write a submission. Verified host
feedback: <verdict>
Diagnostic details and additional results
Independent-instance reformulations
The following examples show how agents reformulated the first instance in each of three hard configurations: hidden monomial composition with , polynomial eigenvalue systems with , , and hidden triangular graphs with . The agent returned all solutions in each example, while Direct timed out. In addition to the usual verification, we checked these submissions exactly over .
Hidden monomial. For the example illustrated in Figure 1, the agent recognized that the expanded equations are cubic polynomials in three recurring monomials. It introduced the coordinates
reducing the degree-171 public equations to three dense cubics. The inverse monomial substitution recovers the original coordinates, as described in Appendix § 6.§ 1. The agent returned a degree-27 RUR for the cubic system with parameter , together with the recovery formulas. msolve solved the reduced system in under 0.1 seconds; total agent time was 213.5 seconds.
Polynomial eigenvalue. For the degree-six matrix system, the agent submitted the degree-66 equation and used ratios of matrix cofactors to recover the ten normalized eigenvector coordinates. The ratios share a denominator that is invertible modulo the eliminant. Both the reduced and lifted representations use as the parameter. The attempt took 116.5 seconds in total.
Agent response excerpt. The agent’s final response for the polynomial eigenvalue example includes the following explanation. Bracketed ellipses mark omitted text.
**Structure exploited:** every equation is *linear* in ‘v1..v10‘ with degree-6
coefficients in ‘t‘. Writing the system as ‘A(t)·(v1,...,v10,1)T = 0‘ with ‘A‘ an 11×11
polynomial matrix:
[...]
**Submission:** reduced system is the univariate ‘t‘-equation ‘det A(t) = 0‘;
‘artifact‘ is verbatim ‘msolve -P 2‘ output on it (eliminant proportional to ‘det A‘,
‘q’ = E’‘, empty numerator list, as expected for one variable); ‘parameter_recovery‘
is ‘t‘.
Hidden graph. The agent recovered the triangular coordinates, including , and submitted the 16-variable chain with its variables ordered so that msolve used as the parameter. The eliminant is , and the submitted inverse linear map includes . The agent thus exploited the triangular structure while still submitting a 16-variable system. The attempt took 444.8 seconds in total.
Online-stream behavior
Table 3 gives completion counts and total costs for the two main streams and an additional sextic family. The shaded bands in Figure 2 show the sample standard deviation at each stream position across three repetitions on the same inputs.
| Method | , | , | , |
| Direct | 121.82 (20/20) | 92.58 (20/20) | 115.41 (20/20) |
| Oracle | 5.40 (20/20) | 1.12 (20/20) | 15.10 (20/20) |
| No memory | (49/60) | (58/60) | (51/60) |
| Planted memory | (58/60) | (59/60) | (57/60) |
| Learned memory | (59/60) | (59/60) | (57/60) |
Table 3. Online-stream completion and total cost. Entries are mean minutes one sample standard deviation, followed by complete attempts in parentheses. Agent counts aggregate three 20-system repetitions; baseline counts are from one evaluation. Failed attempts and memory updates are included; independent verification is excluded.
Retained reductions. For , all 59 successful learned-memory submissions eliminate only , using . They retain alongside , , , leaving a four-variable system. This is a partial reduction; the full coefficient-locus ideal eliminates both and , leaving only the three variables , , . All 58 successful planted-memory submissions use this full three-variable reduction. In each learned-memory repetition, the partial reduction is already present in the first successful solve. Later notes mainly add implementation guidance, and costs show no clear sustained decrease after the first few systems, even though the memory continues to change. The final system has no memory update, which partly explains its lower cost.
For , all successful submissions in both memory conditions use three-variable partial reductions that retain . These reformulations use polynomial division or equivalent triple-root derivative conditions and were checked exactly against the original equations. The planted memory includes both the full ideal and the partial reduction; all successful planted-memory submissions use the latter. Oracle solves in two variables before recovering the factor coordinates. Supplying structural knowledge therefore does not ensure that the agent uses the full elimination.
Saved-memory excerpt. After the sixth system in the first learned-memory repetition, the memory recommends replaying the partial reduction and discourages further exploration:
I.e. following these notes verbatim costs ~7 tool calls and ~1/4 of the 600 s
budget; do NOT explore alternatives, there is no payoff.
[...]
For (4,1): substitute ‘u1_1 = Q1 - 4*u4_1‘. => reduced system: 4 vars (z1,z2,z3,u4_1),
4 eqs of degrees 7,8,9,10, ~160 terms each, solution count (deg of RUR) 1728.
Additional sextic stream. The stream follows the same protocol and has the same generic solution count of 1,728 as the stream. Learned memory reduces cost relative to no memory, but remains slower than Direct in all three repetitions; planted memory is faster than Direct in all three. In the first two learned-memory repetitions, every successful submission retains the original six-variable system, even though the notes recognize that the sextic is a square of a cubic. Here, too, memory preserves a workable procedure without using the available elimination.
Compilation trajectory
All three final solvers outperform the structural Oracle. Their mean execution times are 3.06, 2.88, and 4.82 seconds; compilation takes 9.74, 11.59, and 12.88 hours, respectively. At its first accepted checkpoint, the third solver takes 58.26 seconds per system, compared with Oracle’s 19.47 seconds.
Compiled solving pipeline. Two final solvers use the three-variable coefficient-locus reformulation in Equation (4); the third eliminates only the simple-root variable, retaining four variables. In their main solving paths, they first call msolve to compute a parametrization modulo a prime . They then use Newton lifting to refine it modulo higher powers of the same prime: under the required nonsingularity conditions, each step can increase the modulus from to . A coefficient’s value modulo is not enough to determine its rational value. Increasing the modulus provides more information for reconstructing coefficients with large numerators and denominators.
The solvers combine these lifted results from several starting primes using the Chinese remainder theorem, then recover rational coefficients using lattice-based reconstruction with shared denominators. They reconstruct the eliminated factor coordinates in the same way, giving a full RUR in the original variables. The solvers check the original equations modulo additional primes and use fallback methods when needed. The benchmark verifies the returned RUR independently. msolve already uses modular computations and rational reconstruction to produce exact RURs. The compiled solvers use its finite-field mode together with their own Newton lifting, reconstruction, and coordinate recovery; the reported speedups compare these complete pipelines.
Compilation without general algebra backends. In a separate experiment, we ask the agent to implement the algebraic solving steps itself, without calling msolve, Singular, or any other polynomial-system or Gröbner-basis backend. We supply the coefficient-locus ideal and fix the coefficient-map degree at 6, so the task focuses on implementing a fast solver for a known reformulation. GMP/FLINT arithmetic, univariate polynomial operations, and linear algebra are allowed. The resulting solver uses Python and a C kernel with FLINT arithmetic to perform modular Gröbner-basis reductions, quotient-ring linear algebra, and rational reconstruction.
Using four development systems, AutoHelix rejects iterations 1–2 and accepts iterations 3–6. We freeze the iteration-6 solver and evaluate it on 32 fresh degree-six systems with eight cores, 32 GiB, a 180-second solve cap, and the same LiftedRUR contract as Oracle. Both solve all 32 systems. The compiled solver takes 8.28 seconds on average, with a median of 3.06 seconds, compared with Oracle’s mean of 16.07 seconds: a mean speedup. Three cases take approximately 59 seconds each, contributing to the difference between mean and median. After correcting an arithmetic-validation check, the solver again solves all 32 inputs, with a mean time of 8.30 seconds.
Total compilation time is 4.31 hours, including a final rejected iteration that leaves the solver unchanged. Using the measured mean execution times, this cost would be recovered after approximately 2,000 systems, extrapolating beyond the test pool. The supplied information, degree range, resources, and output representation differ from the main compilation study, so the timings are not directly comparable.
Author use of AI tools
AI agents are part of the experimental methodology and are documented in the corresponding experimental sections. Separately, the authors used AI-based coding and writing assistants to help implement and debug experimental infrastructure and to assist with drafting, editing, and polishing this manuscript. The authors reviewed the resulting artifacts and take full responsibility for the correctness, originality, citations, and final content of the work.
References
- [1]Alessandro Achille and Stefano Soatto. AI agents as universal task solvers, 2025. arXiv:2510.12066v2.arxiv.org/abs/2510.12066
- [2]Jérémy Berthomieu, Christian Eder, and Mohab Safey El Din. msolve: A library for solving polynomial systems. In Proceedings of the 46th International Symposium on Symbolic and Algebraic Computation (ISSAC), pages 51–58, 2021.
- [3]Paul Breiding, Fulvio Gesmundo, Mateusz Michałek, and Nick Vannieuwenhoven. Low rank tensor recovery. https://www.JuliaHomotopyContinuation.org/examples/tensor-recovery/, 2021. Accessed: February 5, 2026.
- [4]R. Caleb Bunch, Alperen A. Ergür, Melika Golestani, Jessie Tong, Malia Walewski, and Yunus E. Zeytuncu. Learning fast monomial orders for gröbner basis computations, 2026.arxiv.org/abs/2602.02972
- [5]David A. Cox, John Little, and Donal O’Shea. Ideals, Varieties, and Algorithms. Springer, 4th edition, 2015.
- [6]Wolfram Decker, Gert-Martin Greuel, Gerhard Pfister, and Hans Schönemann. Singular: A computer algebra system for polynomial computations. https://www.singular.uni-kl.de, 2026. Version 4.4.1.
- [7]Daniel R. Grayson and Michael E. Stillman. Macaulay2, a software system for research in algebraic geometry. https://macaulay2.com, 2026. Version 1.26.06.
- [8]Holger H. Hoos and Thomas Stützle. Evaluating Las Vegas algorithms—pitfalls and remedies. In Proceedings of the Fourteenth Conference on Uncertainty in Artificial Intelligence, pages 238–245, 1998. arXiv reprint: 1301.7383.
- [9]Andrej Karpathy. autoresearch. GitHub repository, 2026. URL https://github.com/karpathy/autoresearch. Accessed: October 14, 2026.
- [10]Zuzana Kukelova, Martin Bujnak, and Tomáš Pajdla. Automatic generator of minimal problem solvers. In European Conference on Computer Vision, 2008. URL https://api.semanticscholar.org/CorpusID:7073421.
- [11]Hwangrae Lee and Bernd Sturmfels. Duality of multiple root loci, 2015. URL https://arxiv.org/abs/1508.00202.
- [12]Michael Luby, Alistair Sinclair, and David Zuckerman. Optimal speedup of Las Vegas algorithms. Information Processing Letters, 47(4):173–180, 1993. doi: 10.1016/0020-0190(93)90029-9.DOI
- [13]Alexander Novikov, Ngân Vũ, Marvin Eisenberger, Emilien Dupont, Po-Sen Huang, Adam Zsolt Wagner, Sergey Shirokhov, Borislav Kozlovskii, Francisco J. R. Ruiz, Abbas Mehrabian, M. Pawan Kumar, Abigail See, Swarat Chaudhuri, George Holland, Alex Davies, Sebastian Nowozin, Pushmeet Kohli, and Matej Balog. AlphaEvolve: A coding agent for scientific and algorithmic discovery, 2025.arxiv.org/abs/2506.13131
- [14]Dylan Peifer, Michael Eugene Stillman, and Daniel Halpern-Leistner. Learning selection strategies in buchberger’s algorithm. In International Conference on Machine Learning, 2020. URL https://api.semanticscholar.org/CorpusID:218502501.
- [15]Irem Portakal. Polynomial systems arising from nash equilibria. https://www.JuliaHomotopyContinuation.org/examples/nash/, 2021. Accessed: February 5, 2026.
- [16]Bernardino Romera-Paredes, Mohammadamin Barekatain, Alexander Novikov, Matej Balog, M. Pawan Kumar, Emilien Dupont, Francisco J. R. Ruiz, Jordan S. Ellenberg, Pengming Wang, Omar Fawzi, Pushmeet Kohli, and Alhussein Fawzi. Mathematical discoveries from program search with large language models. Nature, 625:468–475, 2024.
- [17]Fabrice Rouillier. Solving zero-dimensional systems through the rational univariate representation. Applicable Algebra in Engineering, Communication and Computing, 9(5):433–461, 1999.DOI

