SwarmEvolve: Latent Agent Swarms for Evolutionary Discovery and Optimization
Organizations: DIVISION OF APPLIED MATHEMATICS, BROWN UNIVERSITY
Abstract
LLM-guided evolutionary search uses AI agents to improve programs for mathematical and computational problems by iteratively refining solutions and combining high-scoring methods. However, the process is often slow because the LLM generates a long textual chain of thought for each round and must repeat this generation many times to maintain population diversity. We present SwarmEvolve, a framework in which hundreds of low-cost agents per round work in swarms, reason in latent space without decoding to text, and share information by passing KV caches. Each swarm studies the problem from a different angle. A novelty filter keeps the most distinct agent ideas by directly measuring the distances between the agents' hidden state vectors. Crossover of ideas happens naturally in latent space, as a summarizer agent receives the combined KV caches of all swarm members. On 21 problems in mathematical discovery and scientific computing, SwarmEvolve gets the highest average score and needs a median of only 3 to 8 minutes to reach the best scores that other state-of-the-art frameworks reach in 60 minutes. On several problems, SwarmEvolve with Qwen3 8B improves on the solutions that AlphaEvolve first found with frontier LLMs. Our work shows that agent swarms that communicate in latent space offer a fast, low-cost approach to program search for scientific problems.
Figures & tables
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Qwen3 8B 45 agents | Text reasoning | |||
| Group | Problem | Latent (40 steps) | 40 tokens | 256 tokens |
| Packing | Circles in a square | 0.998 | 0.997 | 0.996 |
| Circles in a rectangle | 0.888 | 0.868 | 0.887 | |
| Hexagons, | 0.627 | 0.509 | 0.544 | |
| Hexagons, | 0.707 | 0.738 | 0.600 | |
| Geometry | Heilbronn, triangle | 0.558 | 0.796 | 0.596 |
| Stage | Ours | OpenEvolve | ShinkaEvolve | CodeEvolve |
| Reading prompts | 7.1 min (12%) | 1.0 min (2%) | 0.5 min (0.9%) | 0.1 min (0.2%) |
| Text reasoning | – | 52.5 min (87%) | 34.4 min (57%) | 46.8 min (78%) |
| Latent reasoning | 4.1 min (7%) | – | – | – |
| Latent communication | 2.6 min (4%) | – | – | – |
| Writing programs | 39.4 min (66%) | 6.4 min (11%) | 5.7 min (9%) | 4.7 min (8%) |
| Novelty checks | 0.05 min (0.1%) | – | 4.5 min (7%) | – |
| Agent | Temperature | Top- | Top- | Maximum new tokens | |
| Summarizer | Refinement-focused swarm | 0.3 | 0.95 | 20 | 4096 |
| Hybridization-focused swarm | 0.5 | 0.95 | 20 | 4096 | |
| Exploration-focused swarm | 0.8 | 0.95 | 20 | 4096 | |
| Fresh-start swarm | 0.8 | 0.95 | 20 | 4096 | |
| Parameter tuning agent | 1.0 | 0.95 | 20 | 24 | |
| Hyperparameter | Value | ||||
| Aspects (refinement and hybridization) | Perspectives (exploration and fresh start) |
| The starting point of the solution | The standard textbook method |
| The optimization or solution algorithm | A fundamentally different algorithm |
| Global exploration, restarts, and annealing | A known construction from the literature |
| Symmetries and structure of good solutions | A physics-inspired method |
| Feasibility, tolerances, and a final repair step | A parametrization that satisfies the constraints |
| The use of the time limit | Many cheap starts of one fast local optimizer |