Skip to main navigation Skip to search Skip to main content

Comparisons of Some Evolutionary Computation Algorithms for Prompt Optimization in Large Language Models

  • Jian-Yu LI
  • , Tian-Le JIN
  • , Zhi-Hui ZHAN*
  • , Sam KWONG
  • , Jun ZHANG*
  • *Corresponding author for this work

Research output: Book Chapters | Papers in Conference ProceedingsConference paper (refereed)Referred Conference Paperpeer-review

Abstract

Prompt engineering has become an effective tool for numerous large language models (LLMs)-based tasks. However, it is still a challenge to adaptively optimize the prompt for the target task, where gradients are inaccessible via APIs and the search space is highly complex. Due to the ability to robustly handle complex and multimodal landscapes, and to adaptively explore complex search spaces without explicit gradient information, evolutionary computation (EC) algorithms have garnered significant attention in black-box optimization. However, the performance of different EC algorithms for prompt optimization remains uncertain, which cannot provide guidance for algorithm selection and design in prompt optimization. To alleviate this, a series of investigative experiments are conducted in this paper to evaluate the efficiency of EC algorithms in prompt optimization, which results in three novel findings. First, different EC algorithms, including XNES, CMA-ES, DE, and PSO, are compared on various few-shot learning tasks. The findings indicate that XNES can outperform other algorithms, achieving faster or smoother convergence and higher final accuracy under high-dimensional settings. Second, the role of truncation strategies is also investigated. Results show that moderate bounds effectively help the algorithm balance exploration and exploitation, whereas overly small or large bounds diminish performance. Third, the influence of different k-shot values is examined on the optimization performance for few-shot tasks, which shows that k=32 consistently provides the best trade-off between convergence speed and final model accuracy. In conclusion, these investigations validate the efficacy of the investigated EC algorithms and highlight the advantages of XNES for complex prompt optimization. They further underscore the importance offering valuable guidance for future black-box prompt tuning scenarios. These insights pave the way for future work on more diverse and complex tasks with larger LLMs.
Original languageEnglish
Title of host publication2025 IEEE International Conference on Systems, Man, and Cybernetics (SMC): Proceedings
Subtitle of host publicationNavigating Frontiers: Smart Systems for a Dynamic World, SMC 2025 - Proceedings
PublisherIEEE
Pages4063-4068
Number of pages6
ISBN (Electronic)9798331533588
DOIs
Publication statusPublished - Oct 2025
Event2025 IEEE International Conference on Systems, Man, and Cybernetics - Vienna, Austria
Duration: 5 Oct 20258 Oct 2025

Publication series

NameConference Proceedings - IEEE International Conference on Systems, Man and Cybernetics
ISSN (Print)1062-922X
ISSN (Electronic)2577-1655

Conference

Conference2025 IEEE International Conference on Systems, Man, and Cybernetics
Country/TerritoryAustria
CityVienna
Period5/10/258/10/25

Bibliographical note

Publisher Copyright:
© 2025 IEEE.

Funding

This work was supported in part by the National Key Research and Development Program of China under Grant 2024YFF0509600, in part by the National Natural Science Foundation of China (NSFC) under Grant 62406152, Grant U23B2039, and Grant 62176094, in part by the Tianjin Top Scientist Studio Project under Grant 24JRRCRC00030, in part by the Tianjin Belt and Road Joint Laboratory under Grant 24PTLYHZ00250, in part by the Natural Science Foundation of Tianjin under Grant 24JCQNJC02100, in part by the Fundamental Research Funds for the Central Universities, Nankai University (078-63253247 and 078- 63251088), and in part by the National Research Foundation of Korea (NRF) Grant funded by the Korea government (MSIT) (No. RS-2025- 005

Keywords

  • Black-Box Optimization
  • Prompt Engineering
  • Evolutionary Computation
  • Differential Evolution (DE)
  • Particle Swarm Optimization (PSO)
  • Large Language Models (LLMs)

Fingerprint

Dive into the research topics of 'Comparisons of Some Evolutionary Computation Algorithms for Prompt Optimization in Large Language Models'. Together they form a unique fingerprint.

Cite this