SwarmEvolve: Latent Agent Swarms for Evolutionary Discovery and Optimization

Qile Jiang, George Em KarniadakisarXiv 2026

TL;DR

SwarmEvolve is a high-throughput evolutionary framework that accelerates program search for scientific discovery by moving agent "thinking" from slow text generation to fast latent space reasoning. By having hundreds of agents communicate via KV caches rather than text messages, it reaches state-of-the-art performance in minutes instead of hours, often allowing small 8B models to outperform frontier LLMs.

What Problem Does This Paper Address?

Large Language Model (LLM) guided evolutionary search has recently made waves by discovering new mathematical constructions (like FunSearch) and optimizing complex algorithms (like AlphaEvolve). However, these frameworks are notoriously slow and expensive.

The bottleneck is textual reasoning. In a typical setup, an agent must generate a long "Chain-of-Thought" (CoT) in text for every single mutation or crossover attempt. When you want to maintain a diverse population of hundreds of programs, the cost of decoding all those tokens becomes prohibitive. This limits the scale of exploration, which is exactly what difficult scientific problems require. The authors ask: Can we make evolutionary search faster and better by letting agents reason and talk in vectors instead of words?

Methods

SwarmEvolve introduces a paradigm shift in how agents collaborate during evolution:

  1. Latent Reasoning: Instead of decoding tokens to text, agents reason in continuous embedding space. The model feeds its last hidden state back as the next input embedding. This "latent thinking" is significantly faster than traditional text generation.
  2. Latent Communication via KV Caches: Rather than sending text messages, agents share their KV (Key-Value) caches. A "summarizer" agent receives the concatenated KV caches of an entire swarm, essentially "reading" the collective latent thoughts of dozens of agents to write a final, optimized program in text.
  3. Swarm Architecture: In each round, SwarmEvolve launches 450 agents divided into 10 specialized swarms. These swarms are assigned different roles:
  4. Refine: Improving the current best solutions.
  5. Hybridize: Performing "crossover" by combining ideas from multiple parent programs.
  6. Explore: Searching less-considered directions.
  7. Fresh-start: Starting from scratch to find entirely new approaches.
  8. Novelty Filtering: To ensure diversity, the framework uses a geometric filter. It measures the cosine distance between agents' hidden state vectors and discards the most similar ones, keeping only the most unique ideas for the summarizer to process.
Figure 2: Workflow of SwarmEvolve. In each round, SwarmEvolve launches 10 swarms of 45 latent agents. Each swarm draws parent programs from the archive and gets a focus prompt to refine, hybridize, explore, or start fresh. In each swarm, the agents take 40 latent reasoning steps, a novelty filter removes the 15 most similar agents (hollow circles), and the summarizer reads the KV caches of the rest to write one new program. The new programs are evaluated and added to the archive. A parameter tuning agent tunes the hyperparameters of the best program.

Datasets

The authors evaluated SwarmEvolve on 21 problems across five domains:

  • Mathematical Discovery: 16 problems from the AlphaEvolve benchmark, including circle packing, Heilbronn triangle problems, and complex autocorrelation inequalities.
  • Scientific Computing: 5 new problems designed by the authors involving sparse linear systems, eigenvalues of non-normal matrices, and partial differential equations (PDEs) like the Burgers and Helmholtz equations.

Key Insights and Ideas

  • Throughput is King: By skipping the text-decoding step, SwarmEvolve generates 5 to 13 times more programs per hour than existing state-of-the-art (SOTA) frameworks.
  • Latent Crossover: Crossover (recombining two good programs) happens naturally in latent space. The summarizer agent attends to the KV caches of agents that studied different parent programs, merging their insights into a single new code proposal.
  • Small Models, Big Results: One of the most striking findings is that SwarmEvolve using a Qwen3 8B model (a relatively small, open-weight model) was able to improve upon constructions originally found by AlphaEvolve using frontier Gemini models. This suggests that massive, diverse exploration with smaller models can be more effective than limited exploration with "smarter" models.
  • Geometric Diversity: Using hidden state distances for novelty checks is not only faster than using an LLM "judge" to compare text, but it also provides a more direct mathematical measure of how "differently" the agents are thinking.

Key Results

SwarmEvolve consistently outperformed baselines like OpenEvolve, ShinkaEvolve, and CodeEvolve across the board.

  • Speedup: SwarmEvolve reached the best 60-minute scores of other frameworks in a median of just 3 to 8 minutes.
  • Superior Accuracy: On scientific computing tasks, SwarmEvolve solved all five sparse linear systems to full accuracy—a feat no baseline achieved.
  • Efficiency: As shown in Figure 1, the framework generates significantly more programs while maintaining a higher mean best score across categories like Packing, Geometry, and Analysis.
Figure 1: SwarmEvolve (ours) compared with OpenEvolve, ShinkaEvolve, and CodeEvolve on 21 prob- lems, 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.
Figure 4: Minutes that SwarmEvolve needs to reach the best score that OpenEvolve (left), ShinkaEvolve (middle), and CodeEvolve (right) reach in 60 minutes. All frameworks use Qwen3 8B and run for three seeds. Hollow circles mark problems where SwarmEvolve does not reach the target within 60 minutes. On most problems, SwarmEvolve reaches in a few minutes what the baselines reach in one hour.

Limitations and Future Work

  • Model Compatibility: Currently, all agents and the summarizer must use the same LLM. Because KV caches are architecture-specific, you cannot easily mix a Qwen agent with a Llama summarizer. The authors suggest "learned translations" between caches as a future fix.
  • Memory Constraints: The memory required for KV caches grows linearly with the number of agents and reasoning steps. Scaling to even larger swarms or longer reasoning chains will require more advanced memory management or compressed latent messages.
  • Attention Architectures: The current implementation relies on standard attention. Adapting this to linear-attention or state-space models (like Mamba) would require new ways to merge agent states.

Summary updated

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.
BibTeX
@misc{jiang2026swarmevolve,
  author = {Qile Jiang and George Em Karniadakis},
  title = {{SwarmEvolve: Latent Agent Swarms for Evolutionary Discovery and Optimization}},
  year = {2026},
  eprint = {2611.08483},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.08483},
}
Figure