Google's AlphaEvolve paper made headlines in May 2025 for using LLMs to discover new mathematical results. The framing was that this required massive infrastructure and deep expertise.
We built the same pattern in a day, ran it overnight, and beat 10 listed records on Packomania, the public reference for circle packing solutions. Total model spend: $27.72.
This post is about what worked, what did not, and what $28 of compute actually buys in applied mathematics.
The problem
Packomania maintains the best known solutions for packing N circles of variable radius into a unit square, maximizing the sum of radii. These are hard optimization problems with no known closed-form solutions. The listed records represent decades of work by researchers running specialized numerical solvers.
We targeted the "csqv" variant: variable-radius circles in a unit square. The N=100+ range is where listed solutions tend to be softer because fewer researchers have pushed there.
The loop
The system has three parts:
- A seed solver that produces a valid (but mediocre) packing using penalty-method optimization
- An LLM that reads the current champion solver, a scoreboard of our results vs. listed records, and the history of ideas already tried and writes a complete replacement solver
- A zero-tolerance verifier that checks every circle placement in float64 (wall slack, pairwise distances, positive radii) and scores the result
Each iteration: the model proposes an algorithmic improvement, produces a new solver, we run it on all target N values in parallel with hard timeouts, verify independently, keep the solver if it improves the total. Fire and forget.
The model sees its own history. It knows which ideas worked and which failed. Early iterations tend to find large improvements. Later iterations try increasingly creative strategies that are less likely to work.
iter000: seed total=59.39 $0.00
iter001: champion total=59.49 (+0.10) $1.19
iter002: champion total=59.66 (+0.17) $1.05
iter004: champion total=59.90 (+0.24) $1.00
iter005: champion total=59.96 (+0.06) $1.72
iter007: champion total=59.97 (+0.01) $2.02
...
iter012: champion total=59.98 (+0.01) $3.80
The pattern is clear: early iterations are cheap and productive, later iterations are expensive and marginal.
What the model actually changed
The winning improvements across iterations:
- Hex lattice initialization instead of random placement (iter001). Massive immediate gain.
- Basin hopping with repolish instead of cold restarts (iter002). The model realized that perturbing a good solution and re-optimizing beats starting fresh.
- Active-set SLSQP polish on the contact graph after the penalty phase (iter004). Switching optimization method for the final refinement.
- Adaptive step sizing in the perturbation phase (iter005). Smaller perturbations as the solution quality increases.
None of these are novel ideas in optimization. What is novel is that an LLM selected and implemented the right combination for this specific problem, verified by a checker it cannot influence.
The results
Across 12 target N values, we beat listed Packomania records for 10 of them (N=101 through N=114, minus N=104, N=110, N=112, N=113 which were not in our target set). Margins ranged from 2.5% to 5.4% above prior records.
| N | Our best | Prior record | Improvement |
|---|---|---|---|
| 101 | 5.291 | 5.164 | +2.5% |
| 102 | 5.318 | 5.055 | +5.2% |
| 103 | 5.345 | 5.086 | +5.1% |
| 105 | 5.401 | 5.126 | +5.4% |
| 106 | 5.429 | 5.152 | +5.4% |
| 107 | 5.454 | 5.180 | +5.3% |
| 108 | 5.482 | 5.206 | +5.3% |
| 109 | 5.508 | 5.231 | +5.3% |
| 111 | 5.555 | 5.278 | +5.2% |
| 114 | 5.625 | 5.337 | +5.4% |
All solutions were verified with zero tolerance and submitted to Packomania's maintainer in .pck format through an approval-gated email pipeline. The submission, verification, and email were automated. The approval was human.
Update: Packomania accepted our first submission and updated their live records. A second run with the plateau detector improved results further -- the numbers above reflect our current best across both runs. Total combined spend: ~$35.
What we wasted
The run also attempted MIPLIB (mixed-integer programming benchmark) problems. That was a bust: 20 iterations, $7.32, 15 of 20 returned no usable code. LLMs are not yet reliable at generating working MIP solvers from scratch.
On circle packing itself, the last 5 iterations spent $13.76 for a total improvement of 0.006. That is diminishing returns past the point of value. We have since added plateau detection: the loop now stops itself when the improvement across the last 4 iterations drops below a threshold.
Backtesting the plateau detector on this run: it would have stopped after iteration 9, saved $13.76 (50% of spend), and given up 0.01% of final quality.
What this means
Three things are true at the same time:
1. This is real. The solutions are independently verified. They will be public record if accepted by Packomania. An LLM-driven loop produced original mathematical results that improve on published records.
2. This is not magic. The model is combining known optimization techniques, not inventing new mathematics. The value is in the search over combinations, not in any single insight. A domain expert with a week could probably match these results.
3. The cost curve is the product. The first $14 bought 99.9% of the total improvement. The second $14 bought 0.1%. The system that knows when to stop is more valuable than the system that runs. Automated research is a cost-optimization problem as much as a search problem.
The code is public at discovery-loop.
Running your own
git clone https://github.com/ucsandman/discovery-loop
cd discovery-loop
pip install numpy scipy
python loop.py --problem circle_packing --iters 20 --budget 15
The loop calls claude -p by default (requires Claude Code CLI). Swap --model for other providers. The plateau detector defaults to a window of 4 iterations and a threshold of 0.01.
Add your own problem by writing a problems/<name>/problem.py with targets, a verifier, and a prompt. The loop is problem-agnostic.
