SwarmEvolve: Latent Agent Swarms for Evolutionary Discovery and Optimization

LLM Latent Reasoning Agent Multi-agent Collaboration ML EA
2026年11月05日
大语言模型(LLM)引导的进化搜索利用人工智能代理,通过迭代优化解法并融合高分策略,来提升数学与计算问题相关程序的性能。然而,该过程通常较为缓慢:一方面,LLM在每一轮中均需生成冗长的文本形式思维链;另一方面,为维持种群多样性,又不得不反复执行此类文本生成,导致开销巨大。为此,我们提出SwarmEvolve框架:在每一轮中,数百个轻量级代理以“蜂群”(swarm)方式协同工作;它们直接在隐空间(latent space)内进行推理,无需解码为自然语言文本;并通过传递键值(KV)缓存实现信息共享。每个蜂群从不同视角分析同一问题。新颖性过滤器(novelty filter)则通过直接度量各代理隐藏状态向量之间的距离,保留最具差异性的思想。思想的交叉融合(crossover)在隐空间中自然发生——一名汇总代理(summarizer agent)接收并整合整个蜂群所有成员的KV缓存,从而完成知识融合。在涵盖数学发现与科学计算领域的21个基准问题上,SwarmEvolve取得了最高的平均得分;且仅需中位数3至8分钟,即可达到其他当前最优框架耗时60分钟才能获得的最佳性能。在若干问题上,采用Qwen3-8B模型的SwarmEvolve甚至进一步改进了AlphaEvolve此前借助前沿大语言模型所发现的解法。本研究表明,以隐空间为通信媒介的代理蜂群,为面向科学问题的程序搜索提供了一种高效、低成本的新范式。
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.