Generative Agent Swarm: Bacterial Foraging with K LLM-Mediated Pheromone Communication

Authors

  • Daniel A. Ferreira * School of Electrical and Computer Engineering, University of Campinas, Campinas, Brazil.

https://doi.org/10.48313/maa.vi.80

Abstract

Expensive black-box optimization spends its budget fast. Simulation-driven engineering design and hyperparameter tuning admit only a few hundred true function evaluations, so every observation collected during the search becomes a priced asset. This paper deploys GAS-Bacterial Foraging Optimization (BFO), a surrogate-assisted optimizer in which a swarm of thirty large-language-model-mediated bacterial agents runs chemotaxis over a shared collective memory. Agents post structured textual observations of their local landscape throughout the run, and every ten iterations a language model condenses this memory into a natural-language pheromone, a small set of weighted region summaries that defines an explicit chemoattractant field biasing every agent's movement; a hallucination guard cross-checks each directional cue against the surrogate gradient and falls back to a classical tumble on disagreement. The evaluation rebuilds the budget ledger from the ground up: Twelve problems, ten mathematical benchmarks and two simulated engineering cases, three budget tiers of 150, 400, and 900 true evaluations, thirty runs per cell, and fourteen methods, nine established references plus four language-model optimizers newly admitted to the race, OPRO, FunSearch, EoH, and ReEvo, raced under token-matched accounting. Survival analysis on tier-relative time-to-target carries the inference: GAS-BFO holds the best mean gap on 22 of 36 problem-tier cells, reaches the target gap with the highest probability at every tier, and is significantly faster than all thirteen rivals at the 400- and 900-evaluation tiers under Holm-corrected log-rank tests, with hazard ratios pricing the separation, while conceding specific cells, the mixed-space tuning task to Tree-structured Parzen Estimation (TPE) among them, that the ledger records openly. Ablations attribute the gain to generative condensation and collective memory; the token tables state the price, one to three dollars per run at deployment tiers; and under bursty message dropout and controlled distributional shift the swarm amortizes knowledge where single-model and single-history rivals concentrate it, retaining 79.4% of lossless quality at a 60% loss rate against 41.2% for Bayesian Optimization with Expected Improvement (BO-EI). 

Keywords:

Generative agents, Bacterial foraging optimization, Large language models, Surrogate-assisted optimization, Stigmergy, Expensive black-box optimization

References

  1. [1] Sacks, J., Welch, W. J., Mitchell, T. J., & Wynn, H. P. (1989). Design and analysis of computer experiments. Statistical Science, 4(4), 409–423. https://doi.org/10.1214/ss/1177012413

  2. [2] Jones, D. R., Schonlau, M., & Welch, W. J. (1998). Efficient global optimization of expensive black-box functions. Journal of Global Optimization, 13(4), 455–492. https://doi.org/10.1023/A:1008306431147

  3. [3] Snoek, J., Larochelle, H., & Adams, R. (2012). Practical bayesian optimization of machine learning algorithms. Advances in Neural Information Processing Systems, 25. https://proceedings.neurips.cc/paper_files/paper/2012/hash/05311655a15b75fab86956663e1819cd-Abstract.html

  4. [4] Mockus, J. (1989). Bayesian approach to global optimization: Theory and applications. Kluwer Academic Publishers. https://doi.org/10.1007/978-94-009-0909-0

  5. [5] Shahriari, B., Swersky, K., Wang, Z., Adams, R. P., & De Freitas, N. (2015). Taking the human out of the loop: A review of Bayesian optimization. Proceedings of the IEEE, 104(1), 148–175. https://doi.org/10.1109/JPROC.2015.2494218

  6. [6] Holland, J. H. (1975). Adaptation in natural and artificial systems: An introductory analysis with applications to biology, control, and artificial intelligence. University of Michigan Press. https://doi.org/10.7551/mitpress/1090.001.0001

  7. [7] Kennedy, J., & Eberhart, R. (1995). Particle swarm optimization. Proceedings of ICNN'95-international conference on neural networks (Vol. 4, pp. 1942-1948). IEEE. https://doi.org/10.1109/ICNN.1995.488968

  8. [8] Passino, K. M. (2002). Biomimicry of bacterial foraging for distributed optimization and control. IEEE Control Systems Magazine, 22(3), 52–67. https://doi.org/10.1109/MCS.2002.1004010

  9. [9] Hansen, N., & Ostermeier, A. (2001). Completely derandomized self-adaptation in evolution strategies. Evolutionary Computation, 9(2), 159–195. https://doi.org/10.1162/106365601750190398

  10. [10] Grassé, P. P. (1959). La reconstruction du nid et les coordinations interindividuelles chez Bellicositermes natalensis et Cubitermes sp. la théorie de la stigmergie: Essai d'interprétation du comportement des termites constructeurs. Insectes Sociaux, 6(1), 41-80. (In French). https://doi.org/10.1007/BF02223791

  11. [11] Dorigo, M., Maniezzo, V., & Colorni, A. (1996). Ant system: Optimization by a colony of cooperating agents. IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), 26(1), 29–41. https://doi.org/10.1109/3477.484436

  12. [12] Bonabeau, E., Dorigo, M., & Theraulaz, G. (1999). Swarm intelligence: From natural to artificial systems. New York: Oxford University Press. https://dl.acm.org/doi/10.5555/328320

  13. [13] Theraulaz, G., & Bonabeau, E. (1999). A brief history of stigmergy. Artificial Life, 5(2), 97-116. https://doi.org/10.1162/106454699568700

  14. [14] Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., ... & Amodei, D. (2020). Language models are few-shot learners. Advances in Neural Information Processing Systems, 33, 1877-1901. https://proceedings.neurips.cc/paper_files/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html

  15. [15] Achiam, J., Adler, S., Agarwal, S., Ahmad, L., Akkaya, I., Aleman, F. L., ... & McGrew, B. (2023). Gpt-4 technical report. https://doi.org/10.48550/arXiv.2303.08774

  16. [16] Ouyang, L., Wu, J., Jiang, X., Almeida, D., Wainwright, C., Mishkin, P., ... & Lowe, R. (2022). Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35, 27730-27744. https://proceedings.neurips.cc/paper_files/paper/2022/hash/b1efde53be364a73914f58805a001731-Abstract.html

  17. [17] Park, J. S., O’Brien, J., Cai, C. J., Morris, M. R., Liang, P., & Bernstein, M. S. (2023). Generative agents: Interactive simulacra of human behavior. Proceedings of the 36th annual ACM symposium on user interface software and technology (pp. 1–22). Association for Computing Machinery. https://doi.org/10.1145/3586183.3606763

  18. [18] Yang, C., Wang, X., Lu, Y., Liu, H., Le, Q. V., Zhou, D., & Chen, X. (2024). Large language models as optimizers. International conference on learning representations (Vol. 2024, pp. 12028-12068). ICLR. https://proceedings.iclr.cc/paper_files/paper/2024/hash/3339f19c5fcee3ad74502947a32be9e6-Abstract-Conference.html

  19. [19] Cliff, N. (1993). Dominance statistics: Ordinal analyses to answer ordinal questions. Psychological Bulletin, 114(3), 494. https://psycnet.apa.org/doi/10.1037/0033-2909.114.3.494

  20. [20] Liu, Y., & Passino, K. M. (2002). Biomimicry of social foraging bacteria for distributed optimization: Models, principles, and emergent behaviors. Journal of Optimization Theory and Applications, 115(3), 603–628. https://doi.org/10.1023/A:1021207331209

  21. [21] Das, S., Biswas, A., Dasgupta, S., & Abraham, A. (2009). Bacterial foraging optimization algorithm: Theoretical foundations, analysis, and applications. In Foundations of computational intelligence volume 3: Global optimization (pp. 23–55). Springer. https://doi.org/10.1007/978-3-642-01085-9_2

  22. [22] Wolpert, D. H., & Macready, W. G. (1997). No free lunch theorems for optimization. IEEE Transactions on Evolutionary Computation, 1(1), 67–82. https://doi.org/10.1109/4235.585893

  23. [23] Liu, S., Chen, C., Qu, X., Tang, K., & Ong, Y. S. (2024). Large language models as evolutionary optimizers. 2024 IEEE congress on evolutionary computation (CEC) (pp. 1-8). IEEE. https://doi.org/10.1109/CEC60901.2024.10611913

  24. [24] Van Stein, N., & Bäck, T. (2024). Llamea: A large language model evolutionary algorithm for automatically generating metaheuristics. IEEE Transactions on Evolutionary Computation, 29(2), 331–345. https://doi.org/10.1109/TEVC.2024.3497793

  25. [25] Romera-Paredes, B., Barekatain, M., Novikov, A., Balog, M., Kumar, M. P., Dupont, E., ... & Fawzi, A. (2024). Mathematical discoveries from program search with large language models. Nature, 625(7995), 468-475. https://doi.org/10.1038/s41586-023-06924-6

  26. [26] Liu, F., Tong, X., Yuan, M., Lin, X., Luo, F., Wang, Z., … & Zhang, Q. (2024). Evolution of heuristics: Towards efficient automatic algorithm design using large language model. Proceedings of the 41st international conference on machine learning (Vol. 235, pp. 32201–32223). PMLR. https://dl.acm.org/doi/abs/10.5555/3692070.3693374

  27. [27] Wei, J., Wang, X., Schuurmans, D., Bosma, M., Xia, F., Chi, E., ... & Zhou, D. (2022). Chain-of-thought prompting elicits reasoning in large language models. Advances in Neural Information Processing Systems, 35, 24824-24837. https://proceedings.neurips.cc/paper_files/paper/2022/hash/9d5609613524ecf4f15af0f7b31abca4-Abstract.html

  28. [28] Wang, X., Wei, J., Schuurmans, D., Le, Q., Chi, E., Narang, S., ... & Zhou, D. (2022). Self-consistency improves chain of thought reasoning in language models. https://doi.org/10.48550/arXiv.2203.11171

  29. [29] Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K., & Cao, Y. (2022). React: Synergizing reasoning and acting in language models. https://doi.org/10.48550/arXiv.2210.03629

  30. [30] Williams, C. K. I., & Rasmussen, C. E. (2006). Gaussian processes for machine learning. The MIT Press. https://gaussianprocess.org/gpml/chapters/RW.pdf

  31. [31] Gramacy, R. B., & Lee, H. K. H. (2012). Cases for the nugget in modeling computer experiments. Statistics and Computing, 22(3), 713–722. https://doi.org/10.1007/s11222-010-9224-x

  32. [32] Srinivas, N., Krause, A., Kakade, S. M., & Seeger, M. (2009). Gaussian process optimization in the bandit setting: No regret and experimental design. https://doi.org/10.1109/TIT.2011.2182033

  33. [33] Bergstra, J., Bardenet, R., Bengio, Y., & Kégl, B. (2011). Algorithms for hyper-parameter optimization. Advances in Neural Information Processing Systems, 24. https://proceedings.neurips.cc/paper_files/paper/2011/hash/86e8f7ab32cfd12577bc2619bc635690-Abstract.html

  34. [34] Hutter, F., Hoos, H. H., & Leyton-Brown, K. (2011). Sequential model-based optimization for general algorithm configuration. International conference on learning and intelligent optimization (pp. 507-523). Berlin, Heidelberg: Springer Berlin Heidelberg. https://doi.org/10.1007/978-3-642-25566-3_40

  35. [35] Forrester, A., Sobester, A., & Keane, A. (2008). Engineering design via surrogate modelling: A practical guide. John Wiley & Sons. https://doi.org/10.1002/9780470770801

  36. [36] Wilson, E. O. (1975). Sociobiology: The new synthesis. Belknap Press of Harvard University Press. https://books.google.com/books?id=PiQvj1Fc-jkC

  37. [37] Beni, G., & Wang, J. (1993). Swarm intelligence in cellular robotic systems. In Robots and biological systems: Towards a new bionics? (pp. 703–712). Springer. https://doi.org/10.1007/978-3-642-58069-7_38

  38. [38] Colorni, A., Dorigo, M., & Maniezzo, V. (1992). Distributed optimization by ant colonies. Towards a practice of autonomous systems: Proceedings of the first European conference on artificial life (ECAL 91) (pp. 134–142). MIT Press. https://faculty.washington.edu/paymana/swarm/colorni92-ecal.pdf

  39. [39] Karaboga, D., & others. (2005). An idea based on honey bee swarm for numerical optimization. https://abc.erciyes.edu.tr/pub/tr06_2005.pdf

  40. [40] Wu, Q., Bansal, G., Zhang, J., Wu, Y., Li, B., Zhu, E., ... & Wang, C. (2023). Autogen: Enabling next-gen llm applications via multi-agent conversation. https://doi.org/10.48550/arXiv.2308.08155

  41. [41] Wooldridge, M. (2009). An introduction to multiagent systems. John Wiley & Sons. https://www.wiley.com/en-us/shop/general-introductory-computer-science/an-introduction-to-multiagent-systems-2nd-edition-p-9780470519462

  42. [42] Cover, T. M., & Thomas, J. A. (2006). Elements of information theory. Wiley-Interscience. https://doi.org/10.1002/047174882X

  43. [43] Huang, L., Yu, W., Ma, W., Zhong, W., Feng, Z., Wang, H., ... & Liu, T. (2025). A survey on hallucination in large language models: Principles, taxonomy, challenges, and open questions. ACM Transactions on Information Systems, 43(2), 1-55. https://doi.org/10.1145/3703155

  44. [44] Jamil, M., & Yang, X. S. (2013). A literature survey of benchmark functions for global optimisation problems. International Journal of Mathematical Modelling and Numerical Optimisation, 4(2), 150–194. https://doi.org/10.1504/IJMMNO.2013.055204

  45. [45] Chen, T., & Guestrin, C. (2016). Xgboost: A scalable tree boosting system. Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining (pp. 785-794). Association for Computing Machinery (ACM). https://dl.acm.org/doi/proceedings/10.1145/2939672

  46. [46] Cook, P. H., McDonald, M. A., & Firmin, M. C. P. (1979). Aerofoil RAE 2822 pressure distributions and boundary layer measurements. https://ntrs.nasa.gov/api/citations/20160005970/downloads/20160005970.pdf

  47. [47] Lindauer, M., Eggensperger, K., Feurer, M., Biedenkapp, A., Deng, D., Benjamins, C., ... & Hutter, F. (2022). SMAC3: A versatile Bayesian optimization package for hyperparameter optimization. Journal of Machine Learning Research, 23(54), 1-9. https://www.jmlr.org/papers/v23/21-0888.html

  48. [48] Bergstra, J., & Bengio, Y. (2012). Random search for hyper-parameter optimization. Journal of Machine Learning Research, 13(2), 282–305. https://www.jmlr.org/papers/volume13/bergstra12a/bergstra12a.pdf

  49. [49] Ye, H., Wang, J., Cao, Z., Berto, F., Hua, C., Kim, H., ... & Song, G. (2024). Reevo: Large language models as hyper-heuristics with reflective evolution. Advances in Neural Information Processing Systems, 37, 43571-43608. https://proceedings.neurips.cc/paper_files/paper/2024/hash/4ced59d480e07d290b6f29fc8798f195-Abstract-Conference.html

  50. [50] Holm, S. (1979). A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics, 6(2), 65–70. https://www.jstor.org/stable/4615733

  51. [51] Wobbrock, J. O., Findlater, L., Gergle, D., & Higgins, J. J. (2011). The aligned rank transform for nonparametric factorial analyses using only anova procedures. Proceedings of the SIGCHI conference on human factors in computing systems (pp. 143-146). Association for Computing Machinery (ACM). https://doi.org/10.1145/1978942.1978963

  52. [52] García, S., Molina, D., Lozano, M., & Herrera, F. (2009). A study on the use of non-parametric tests for analyzing the evolutionary algorithms’ behaviour: A case study on the CEC’2005 special session on real parameter optimization. Journal of Heuristics, 15(6), 617-644. https://doi.org/10.1007/s10732-008-9080-4

  53. [53] Derrac, J., García, S., Molina, D., & Herrera, F. (2011). A practical tutorial on the use of nonparametric statistical tests as a methodology for comparing evolutionary and swarm intelligence algorithms. Swarm and Evolutionary Computation, 1(1), 3-18. https://doi.org/10.1016/j.swevo.2011.02.002

  54. [54] Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., … & Duchesnay, É. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12, 2825–2830. https://www.jmlr.org/papers/v12/pedregosa11a.html

  55. [55] Brambilla, M., Ferrante, E., Birattari, M., & Dorigo, M. (2013). Swarm robotics: A review from the swarm engineering perspective. Swarm Intelligence, 7(1), 1–41. https://doi.org/10.1007/s11721-012-0075-2

  56. [56] Olfati-Saber, R., Fax, J. A., & Murray, R. M. (2007). Consensus and cooperation in networked multi-agent systems. Proceedings of the IEEE, 95(1), 215–233. https://doi.org/10.1109/JPROC.2006.887293

  57. [57] Quiñonero-Candela, J., Sugiyama, M., Schwaighofer, A., & Lawrence, N. D. (2008). Dataset shift in machine learning. Mit Press. https://mitpress.mit.edu/9780262170055/dataset-shift-in-machine-learning/

Published

2026-06-05

How to Cite

Ferreira, D. A. . (2026). Generative Agent Swarm: Bacterial Foraging with K LLM-Mediated Pheromone Communication. Metaheuristic Algorithms With Applications, 3(2), 246-271. https://doi.org/10.48313/maa.vi.80

Similar Articles

1-10 of 66

You may also start an advanced similarity search for this article.