Research
SwarmEvolve: Latent Agent Swarms for Evolutionary Discovery and Optimization
Overview Research area: AI-driven program search for mathematics and scientific computing, combining LLM-guided evolutionary algorithms with latent-space reasoning and multi-agent communication. Techn
- arXiv
- 2611.08483
- Published
- 2026-11-05
- Authors
- Qile Jiang, George Em Karniadakis
AI summary
Overview
Research area: AI-driven program search for mathematics and scientific computing, combining LLM-guided evolutionary algorithms with latent-space reasoning and multi-agent communication.
Technical level: Intermediate. The core ideas can be understood without deep math, but the paper assumes familiarity with transformer LLMs, KV caches, and evolutionary search.
Scope: The paper introduces SwarmEvolve, a framework that runs hundreds of low-cost latent agents per evolutionary round and communicates through KV caches, and benchmarks it against three existing LLM-guided evolutionary frameworks on 21 problems.
What This Paper Is About
LLM-guided evolutionary search improves programs by having an AI model repeatedly write new candidate solutions, but it is slow and expensive because every agent must decode long chains of thought as text and the context keeps growing. The authors ask whether swarms of many cheap agents that reason silently in latent space, rather than writing text, can make this kind of search both faster and better. Their goal is to show that a small open-weight model driving such a swarm can reach or beat the results that frontier-model frameworks obtain in a full hour.
Key Contributions
-
A latent swarm search framework. SwarmEvolve launches 10 swarms of 45 latent agents (450 per round); each agent takes 40 latent reasoning steps without decoding text, and agents share information by passing KV caches to a summarizer that writes one new program.
-
A latent-space novelty filter. Instead of using an external embedding model or an LLM judge to reject near-duplicates, SwarmEvolve represents each agent by the mean of its 40 hidden states and greedily keeps the 30 agents per swarm that are farthest apart in cosine distance, discarding the 15 most similar.
-
Built-in crossover in latent space. A summarizer agent receives the concatenated KV caches of agents that read different parent programs, so ideas from different parents are recombined inside one generated program rather than through text-level prompting.
-
A 21-problem benchmark against three state-of-the-art frameworks. The authors compare against OpenEvolve, ShinkaEvolve, and CodeEvolve on 16 problems taken from AlphaEvolve's Appendix B plus five new scientific computing problems, using Qwen3 8B, 14B, and 32B-FP8 on a single GPU for 60 minutes per run.
Main Findings
-
Highest average score with every model. Average scores were 0.804 for SwarmEvolve versus 0.693 (OpenEvolve), 0.642 (ShinkaEvolve), and 0.700 (CodeEvolve) with Qwen3 8B; 0.837 versus 0.771, 0.686, and 0.739 with Qwen3 14B; and 0.869 versus 0.774, 0.733, and 0.731 with Qwen3 32B-FP8.
-
A small model beats larger-model baselines. SwarmEvolve with Qwen3 8B (average 0.804) outscores all three baselines running Qwen3 32B-FP8 (0.774, 0.733, 0.731).
-
Much higher throughput. SwarmEvolve evaluates 5 to 13 times more programs per hour than the baselines; in the Qwen3 8B time breakdown it evaluates 734 programs in 60 minutes versus 158 for OpenEvolve, 99 for ShinkaEvolve, and 81 for CodeEvolve. The baselines spend 20 to 35 seconds per program on text reasoning, whereas the 450 latent agents of a round take only a few seconds in total.
-
Much faster to the same score. The median time for SwarmEvolve to reach the baselines' 60-minute scores is 4 to 8 minutes with Qwen3 8B and 3 to 6 minutes with the larger models; the abstract states a median of 3 to 8 minutes overall.
-
Improvements over AlphaEvolve with a frozen 8B model. With Qwen3 8B, SwarmEvolve surpasses AlphaEvolve's published constructions on three problems, versus one for each baseline. Its packing of 26 circles in a square reaches the best known sum of radii, 2.635983, and its step functions improve AlphaEvolve's bounds for the second and third autocorrelation inequalities.
-
Full accuracy on sparse linear systems. With Qwen3 32B-FP8, SwarmEvolve solves all five sparse linear system problems to full accuracy, which no baseline run achieves.
-
Latent reasoning beats text reasoning in an ablation. Replacing the 40 latent steps with text reasoning of up to 40 tokens gives 0.796 average and up to 256 tokens gives 0.767, against 0.804 for latent, while evaluating 663 and 402 programs respectively instead of 734. The authors suggest the 256-token drop may come from longer messages overwhelming the summarizer's 32,768-token context window.
-
Larger swarms help early, then converge. Varying swarm size over 0, 15, 45 (default), and 75 agents with Qwen3 8B, larger swarms raise the mean best score most over the first 150 evaluated programs; after about 150 programs the gains fall within bootstrap intervals, and all settings end the hour at similar scores. Scaling to a larger LLM, by contrast, raises the final score consistently.
-
Not uniformly best on every problem. SwarmEvolve trails on some individual cases with Qwen3 8B, for example circles in a rectangle (0.888 versus 0.969 for OpenEvolve and 0.987 for CodeEvolve), kissing number d=11 (0.309 versus 0.508 for ShinkaEvolve), and eigenvalues (0.700 versus 0.723 for all three baselines).
-
Latent space is structured and measurable. A PCA projection of the mean hidden states for a circle packing problem shows swarms occupying distinct regions by role (refinement through exploration and fresh start), and within a swarm, clusters by parent program, with the novelty filter keeping agents from every cluster.
Methodology in Plain English
The framework keeps an archive of candidate programs with their scores and evaluation feedback. Each round begins by forming 10 swarms of 45 agents: four refinement swarms work on the two best programs, three hybridization swarms mix five programs drawn from the ten best, two exploration swarms mix four programs drawn at random from the whole archive (with nine agents seeing only the problem statement), and one fresh-start swarm sees only the initial baseline program. Every agent gets a distinct prompt built from a shared focus plus one of nine "ways of thinking," and each reads exactly one parent program.
Agents then think for 40 steps inside the model's continuous embedding space: the last hidden state is mapped back into the input embedding space through an alignment matrix and fed in as the next input, so no text is ever generated. In each swarm, the mean hidden state of each agent is centered, normalized, and used to greedily pick the 30 most spread-out agents in cosine distance. The summarizer then attends to the concatenated KV caches of those 30 agents (plus the problem statement, parent programs, and its own instruction), with cached keys rotated so each block sits at the right position, and decodes one complete program in text. A parameter tuning agent proposes up to 8 single-number edits per round. New programs are deduplicated, syntax-checked, given missing imports, and scored by a deterministic evaluator on CPU cores in parallel, then added to the archive. The process repeats until the time budget runs out, and the best archived program is returned.
The benchmark gives every framework 60 minutes on one GPU with 8 CPU cores evaluating 8 programs in parallel, three seeds per problem, using Qwen3 8B on an L40S, Qwen3 14B on an RTX PRO 6000, and Qwen3 32B-FP8 on an H100. For the 16 AlphaEvolve-derived problems, the score is the objective value divided by AlphaEvolve's published construction value, so above 1 means beating AlphaEvolve. For the five scientific computing problems the score is the number of correct digits relative to a high-fidelity ground truth, averaged over challenging test cases.
Why This Matters
The paper suggests that large-scale search for new mathematical constructions, algorithms, and numerical methods does not necessarily require frontier models or large compute budgets; swarms of small latent agents on a single GPU can be competitive. It also reframes agent communication itself as a cost: eliminating text decoding between agents shifts most GPU time from reasoning to actually writing programs.
Real-world applications:
- Writing more accurate or faster PDE solvers and numerical methods in scientific computing and engineering simulation.
- Symbolic regression and formula discovery from data.
- Optimizing algorithmic constants and constructions in mathematics, such as packing, extremal geometry, and combinatorics problems.
- Improving real programs where a clear evaluator exists, such as speed or accuracy of a routine.
Industry relevance: The approach lowers the hardware and model-size barrier for automated program optimization, since it runs on a single GPU with open-weight Qwen3 models and can reuse an existing serving stack (vLLM, paged attention, speculative sampling), making it practical for teams that cannot pay for repeated frontier-model calls.
Future Directions
- Mixed-model swarms. All agents and summarizers currently share one LLM because a summarizer can read KV caches only from the same model; learned translations between KV caches of different models are proposed as a way to mix models.
- Beyond standard attention. The method assumes standard attention, so extending it to linear-attention, state-space, and hybrid architectures would require a way to merge the compressed states of several agents.
- Memory scaling. KV cache memory grows linearly with the number of agents, latent reasoning steps, and layers, so the largest tested model needs a large GPU; compressed latent messages and rounds spread over several GPUs are suggested remedies.
- Deeper scaling questions. The paper leaves open why swarm-size gains saturate after roughly 150 evaluated programs while larger LLMs keep raising final scores, and how far the approach extends to problems with much more expensive evaluators.
Target Audience
Researchers and practitioners in AI-for-science, automated algorithm and program discovery, and evolutionary computation, along with engineers who build LLM agent systems and care about inference cost and throughput. It is also useful for mathematically minded readers interested in how small open-weight models can be pushed toward open problems. Readers need some familiarity with transformer LLMs and KV caches to follow the mechanics, but the framing is accessible.
Authors’ 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.