Manuscript Offprint

arXiv:2611.08483

SwarmEvolve: Latent Agent Swarms for Evolutionary Discovery and Optimization

Qile Jiang, George Em Karniadakis

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.

github.com/Qile-J/SwarmEvolve

Figure

Figure 1: SwarmEvolve (ours) compared with OpenEvolve, ShinkaEvolve, and CodeEvolve on 21 problems, with Qwen3 8B on one GPU for 60 minutes per run. Left: total number of programs generated. Middle: mean best score at 15 minutes. Right: median minutes to reach OpenEvolve's 60-minute score. SwarmEvolve has a higher throughput and better scores.

1 Introduction

Many problems in mathematics and scientific computing can be framed as a search for a good program. Examples include symbolic regression, optimizing constants in inequalities, and building robust solvers for differential equations. This search can be carried out through evolutionary computation, a method to iteratively improve candidate programs through variation, crossover, and selection [32, 39].

Recently, LLMs have been used as the mutation and crossover operators in such evolutionary processes [43, 49, 73]. These LLM-guided frameworks have made strong progress on many open problems. In particular, FunSearch found new cap set constructions [54], and AlphaEvolve found a more efficient algorithm for multiplying 4×44 \times 4 complex matrices [50]. Later work applied this approach to solve many more problems in mathematics and computer systems [24, 20, 12]. These frameworks differ mainly in how they explore. FunSearch evolves programs on separate islands, and AlphaEvolve and its open-source variants add a MAP-Elites archive to keep diverse programs [59, 1, 37]. To save LLM calls, some methods reject near-duplicate proposals, adaptively allocate the search budget, or evolve the search strategy itself [42, 10, 46]. Others guide exploration with better context, such as how past changes affected the score, related literature, simulated peer review, or a solver split into separate steps [34, 45, 78, 40].

Recent work also scales up the search. Some methods run many parallel trajectories [77] or train the LLM on each problem with reinforcement learning [79, 64, 70]. Others use more agents with different roles, such as an ensemble of frontier LLMs in AlphaEvolve, multi-agent debate, and coding agents that coordinate through shared memory or an orchestrator [35, 52, 69]. When agents build on one another's findings, they have produced new results on open problems [9, 7]. These works suggest that diverse proposals, cross-pollination of ideas, and iterative refinement are key to new discoveries on open scientific problems.

Yet in most of these frameworks, the search is slow and expensive. Each agent writes a long chain of thought in text. The growing solution archive, evaluator feedback, and text messages between agents make the LLM context very long. Scaling to many agents, larger models, or test-time training multiplies this cost. As a result, the search cannot run at the scale that many open problems need. We therefore ask:

References (74)