A Framework for Integrating Large Language Models into Memetic Algorithms
Abstract
1. Introduction
2. Memetic Algorithms
3. Related Works
4. Problem Formulation
5. The Proposed General Framework for LLM-Enhanced Memetic Algorithms
5.1. State Representation and Prompt Construction
5.2. Novelty Assessment and Meme Library Management
5.3. General Framework
| Algorithm 1. Fourth-Generation Memetic Algorithm Framework with LLM-driven Meme Generation |
| Input: objective function , bounds , population size , max iterations , trigger interval , stagnation threshold , library capacity , meme steps , meme stagnation limit , similarity threshold , library exploration parameter |
| Output: best solution , meme library |
| , |
| , , |
| for do |
| Update , , |
| Compute state vector |
| // Meme Generation Trigger |
| if or and and then |
| if is syntactically valid and executes without runtime error then |
| if s.t. or |
| , |
| else |
| // rejected due to similarity |
| end if |
| else |
| // rejected due to invalid or erroneous code |
| end if |
| end if |
| // Meme Selection |
| if |
| if |
| Select according to: |
| where to ensure |
| else |
| Select uniformly from |
| end if |
| // Meme Application to Top 15% |
| for each do |
| , |
| for do |
| if |
| , |
| else |
| end if |
| if break end if |
| end for |
| if then |
| Replace in with |
| Update , if improved |
| end if |
| end for |
| end if |
| // reset for next iteration |
| end for |
| return , |
6. Experimental Study
6.1. Experimental Setup
6.2. Statistical Analysis of the Results
6.3. Meme Similarity Analysis
6.4. Meme Efficiency Analysis
7. Discussions
7.1. State Vector Design and Its Influence on Meme Quality
7.2. The Role of the LLM and Prompt Sensitivity
7.3. Meme Library Dynamics and Selection Policy
7.4. Generalization, Transferability, and the Scope of the Meme Library
7.5. Limitations and Open Questions
8. Conclusions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Danilchenko, V.I.; Danilchenko, Y.V.; Kureichik, V.M. Bio-inspired approach to microwave circuit design. In Proceedings of the 2020 IEEE East-West Design & Test Symposium (EWDTS), Varna, Bulgaria, 4–7 September 2020; pp. 362–366. [Google Scholar]
- Lu, X.; Sun, T.; Tang, K. Evolutionary optimization with hierarchical surrogates. Swarm Evol. Comput. 2019, 47, 21–32. [Google Scholar] [CrossRef]
- Sakharov, M.; Koledina, K.; Gubaydullin, I. Optimal Control of Hydrocarbons’ Hydrogenation with Catalysts. Mathematics 2024, 12, 3570. [Google Scholar] [CrossRef]
- Škvorc, U.; Eftimov, T.; Korošec, P. Understanding the problem space in single-objective numerical optimization using exploratory landscape analysis. Appl. Soft Comput. 2020, 90, 106138. [Google Scholar] [CrossRef]
- Höschel, K.; Vasudevan, L. Genetic algorithms for lens design: A review. J. Opt. 2019, 48, 134–144. [Google Scholar] [CrossRef]
- Sakharov, M.; Houllier, T.; Lépine, T. Optimal Design of Conventional and Freeform Optical Systems with Memetic Mind Evolutionary Computation Algorithm. In Proceedings of the Sixth International Scientific Conference “Intelligent Information Technologies for Industry”; Lecture Notes in Networks and Systems; Springer: Cham, Switzerland, 2023; Volume 566. [Google Scholar] [CrossRef]
- Karpenko, A.; Agasiev, T.; Sakharov, M. Intellectualization Methods of Population Algorithms of Global Optimization. In Cyber-Physical Systems: Advances in Design & Modelling; Kravets, A., Bolshakov, A., Shcherbakov, M., Eds.; Studies in Systems, Decision and Control; Springer: Cham, Switzerland, 2020; Volume 259, pp. 137–151. [Google Scholar] [CrossRef]
- Xia, X.; Gui, L.; He, G.; Xie, C.; Wei, B.; Xing, Y.; Wu, R.; Tang, Y. A hybrid optimizer based on firefly algorithm and particle swarm optimization algorithm. J. Comput. Sci. 2018, 26, 488–500. [Google Scholar] [CrossRef]
- Narinder, S.; Kaur, J. Hybridizing sine–cosine algorithm with harmony search strategy for optimization design problems. Soft Comput. 2021, 25, 11053–11075. [Google Scholar] [CrossRef]
- Al-Betar, M.A.; Awadallah, M.A.; Zitar, R.A.; Assaleh, K. Economic load dispatch using memetic sine cosine algorithm. J. Ambient. Intell. Humaniz. Comput. 2023, 14, 11685–11713. [Google Scholar] [CrossRef]
- Altay ELİ, F.; Altay, O.; Özçevik, Y. A comparative study of metaheuristic optimization algorithms for solving real-world engineering design problems. CMES-Comput. Model. Eng. Sci. 2024, 139, 1039-1094. [Google Scholar] [CrossRef]
- Moscato, P.; Cotta, C. A modern introduction to memetic algorithms. In Handbook of Metaheuristics; Gendreau, M., Potvin, J.-Y., Eds.; Springer: Berlin/Heidelberg, Germany, 2010; pp. 141–183. [Google Scholar] [CrossRef]
- Dawkins, R. The Selfish Gene; Oxford University Press: Oxford, UK, 1976. [Google Scholar]
- Zhang, W.; Lan, Y.; Lin, A.; Xiao, M. An adaptive clustering routing protocol for wireless sensor networks based on a novel memetic algorithm. IEEE Sens. J. 2025, 25, 8929–8941. [Google Scholar] [CrossRef]
- Sakharov, M.; Koledina, K.; Gubaydullin, I.; Karpenko, A. Parallel memetic algorithm for optimal control of multi-stage catalytic reactions. Optim. Lett. 2023, 17, 981–1003. [Google Scholar] [CrossRef]
- Chang, X.; Jia, X.; Ren, J. A reinforcement learning enhanced memetic algorithm for multi-objective flexible job shop scheduling toward Industry 5.0. Int. J. Prod. Res. 2025, 63, 119–147. [Google Scholar] [CrossRef]
- Neri, F.; Cotta, C.; Moscato, P. Handbook of Memetic Algorithms; Springer: Berlin/Heidelberg, Germany, 2011; p. 368. [Google Scholar] [CrossRef]
- Sakharov, M. Introducing the Fourth Generation of Memetic Algorithms. In Proceedings of the Eighth International Scientific Conference “Intelligent Information Technologies for Industry” (IITI’24), Volume 2, IITI 2024; Lecture Notes in Networks and Systems; Springer: Cham, Switzerland, 2024; Volume 1210. [Google Scholar] [CrossRef]
- Kennedy, J.; Eberhart, R. Particle swarm optimization. In Proceedings of the IEEE International Conference on Neural Networks (ICNN ‘95), Perth, WA, Australia, 27 November–1 December 1995; Volume 4, pp. 1942–1948. [Google Scholar]
- Mirjalili, S.; Lewis, A. The whale optimization algorithm. Adv. Eng. Softw. 2016, 95, 51–67. [Google Scholar] [CrossRef]
- Mirjalili, S. Moth-flame optimization algorithm: A novel nature-inspired heuristic paradigm. Knowl.-Based Syst. 2015, 89, 228–249. [Google Scholar] [CrossRef]
- Carlos, C.; Mathieson, L.; Moscato, P. Memetic algorithms. In Handbook of Heuristics; Springer Nature: Cham, Switzerland, 2025; pp. 809–850. [Google Scholar]
- Ong, Y.S.; Lim, M.H.; Meuth, R. A proposition on memes and meta-memes in computing for higher-order learning. Memetic Comput. 2009, 1, 85–100. [Google Scholar]
- Klimenko, A.; Elmekeev, M. Lamarckian Evolution Based Algorithm for Multi-Robot Path Planning Problem. In International Conference on Interactive Collaborative Robotics; Springer Nature: Cham, Switzerland, 2025. [Google Scholar]
- Liu, F.; Yao, Y.; Guo, P.; Yang, Z.; Lin, X.; Zhao, Z.; Tong, X.; Mao, K.; Lu, Z.; Wang, Z.; et al. A Systematic Survey on Large Language Models for Algorithm Design. ACM Comput. Surv. 2026, 58, 218. [Google Scholar] [CrossRef]
- Yepes, A.J.; Barnard, P. Evolutionary thoughts: Integration of large language models and evolutionary algorithms. arXiv 2025, arXiv:2505.05756. [Google Scholar] [CrossRef]
- Qi, F.; Wang, T.; Zheng, R.; Li, M. A Memetic and Reflective Evolution Framework for Automatic Heuristic Design Using Large Language Models. Appl. Sci. 2025, 15, 8735. [Google Scholar] [CrossRef]
- Li, R.; Wang, L.; Sang, H.; Yao, L.; Pan, L. LLM-Assisted Automatic Memetic Algorithm for Lot-Streaming Hybrid Job Shop Scheduling with Variable Sublots. IEEE Trans. Evol. Comput. 2026, 58, 1–32. [Google Scholar] [CrossRef]
- Liu, S.; Chen, C.; Qu, X.; Tang, K.; Ong, Y.S. Large Language Models as Evolutionary Optimizers. In Proceedings of the 2024 IEEE Congress on Evolutionary Computation (CEC), Yokohama, Japan, 30 June–5 July 2024; pp. 1–8. [Google Scholar] [CrossRef]
- Tian, H.; Han, X.; Wu, G.; Guo, A.; Zhou, Y.; Zhang, J.; Li, S.; Wei, J.; Zhang, T. An LLM-Empowered Adaptive Evolutionary Algorithm for Multi-Component Deep Learning Systems. Proc. AAAI Conf. Artif. Intell. 2025, 39, 20894–20902. [Google Scholar] [CrossRef]
- Van Stein, N.; Bäck, T. Llamea: A Large Language Model Evolutionary Algorithm for Automatically Generating Metaheuristics. IEEE Trans. Evol. Comput. 2024, 29, 331–345. [Google Scholar] [CrossRef]
- Pluhacek, M.; Kovac, J.; Viktorin, A.; Janku, P.; Kadavy, T.; Senkerik, R. Using LLM for Automatic Evolvement of Metaheuristics from Swarm Algorithm SOMA. In Proceedings of the Genetic and Evolutionary Computation Conference Companion (GECCO ‘24 Companion); Association for Computing Machinery: New York, NY, USA, 2024; pp. 2018–2022. [Google Scholar] [CrossRef]
- Wang, C.; Zhao, J.; Jiao, L.; Li, L.; Liu, F.; Yang, S. When Large Language Models Meet Evolutionary Algorithms: Potential Enhancements and Challenges. Research 2025, 8, 0646. [Google Scholar] [CrossRef] [PubMed]
- Yu, H.; Liu, J. Deep insights into automated optimization with large language models and evolutionary algorithms. arXiv 2024, arXiv:2410.20848. [Google Scholar] [CrossRef]
- Chinnasamy, S.; Ramachandran, M.; Amudha, M.; Ramu, K. A review on hill climbing optimization methodology. Recent Trends Manag. Commer. 2022, 3, 1–7. [Google Scholar]
- Sakharov, M. A New Assessment Framework for LLM-Generated Optimization Methods. In Proceedings of the Ninth International Scientific Conference “Intelligent Information Technologies for Industry”, Volume 2; IITI 2025; Lecture Notes in Networks and Systems; Springer: Cham, Switzerland, 2026; Volume 1763. [Google Scholar] [CrossRef]
- Guo, D.; Ren, S.; Lu, S.; Feng, Z.; Tang, D.; Liu, S.; Zhou, L.; Duan, N.; Svyatkovskiy, A.; Fu, S.; et al. Graphcodebert: Pre-training code representations with data flow. arXiv 2020, arXiv:2009.08366. [Google Scholar]
- Bag, S.; Kumar, S.K.; Tiwari, M.K. An efficient recommendation generation using relevant Jaccard similarity. Inf. Sci. 2019, 483, 53–64. [Google Scholar] [CrossRef]
- Wu, G.; Mallipeddi, R.; Suganthan, P.N. Problem Definitions and Evaluation Criteria for the CEC 2017 Competition on Constrained Real-Parameter Optimization; Technical Report; National University of Defense Technology: Changsha, China; Kyungpook National University: Daegu, Republic of Korea; Nanyang Technological University: Singapore, 2017. [Google Scholar]
- Nelder, J.A.; Mead, R. A simplex method for function minimization. Comput. J. 1965, 7, 308–313. [Google Scholar] [CrossRef]
- Nassef, A.M.; Abdelkareem, M.A.; Maghrabie, H.M.; Baroutaji, A. The role of random walk-based techniques in enhancing metaheuristic optimization algorithms—A systematic and comprehensive review. IEEE Access 2024, 12, 139573–139608. [Google Scholar] [CrossRef]
- Piotrowski, A.P.; Napiorkowski, J.J.; Piotrowska, A.E. Choice of benchmark optimization problems does matter. Swarm Evol. Comput. 2023, 83, 101378. [Google Scholar] [CrossRef]




| Benchmark Function | PSO | WOA | PSO-NM | WOA-NM | MMPSO | MMWOA | AIM-PSO | AIM-WOA |
|---|---|---|---|---|---|---|---|---|
| Rank |
| Top 5 Generated Memes | Composite Score | Last 5 Generated Memes | Composite Score |
|---|---|---|---|
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Sakharov, M. A Framework for Integrating Large Language Models into Memetic Algorithms. Biomimetics 2026, 11, 383. https://doi.org/10.3390/biomimetics11060383
Sakharov M. A Framework for Integrating Large Language Models into Memetic Algorithms. Biomimetics. 2026; 11(6):383. https://doi.org/10.3390/biomimetics11060383
Chicago/Turabian StyleSakharov, Maxim. 2026. "A Framework for Integrating Large Language Models into Memetic Algorithms" Biomimetics 11, no. 6: 383. https://doi.org/10.3390/biomimetics11060383
APA StyleSakharov, M. (2026). A Framework for Integrating Large Language Models into Memetic Algorithms. Biomimetics, 11(6), 383. https://doi.org/10.3390/biomimetics11060383

