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:
- 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.
- 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.
- Swarm Architecture: In each round, SwarmEvolve launches 450 agents divided into 10 specialized swarms. These swarms are assigned different roles:
- Refine: Improving the current best solutions.
- Hybridize: Performing "crossover" by combining ideas from multiple parent programs.
- Explore: Searching less-considered directions.
- Fresh-start: Starting from scratch to find entirely new approaches.
- 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.
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.
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