Particle Swarm Optimization for Automating Prompt Optimization in Large Language Models on Text Classification and Generation Tasks

Large Language Models (LLMs) have demonstrated remarkable abilities in responding to natural language instructions, but their performance depends on prompts, with high-quality prompts requiring human expertise and effort. Current prompt optimization techniques include continuous prompt-based and discrete prompt-based methods. The former requires access to LLMs' parameters which is time-consuming and the latter might lead to suboptimal results due to confined search space. To address the above limitations, we propose PSOPrompt, which retains exploratin capabilities of continuous prompts without altering LLMs' parameters. Noting the continuous nature of embeddings and the success of PSO for continuous optimization problems, it is used as the optimization method, with each embedding treated as an individual. To integrate continuous prompts with discrete prompts, embedding inversion is employed and a new encoding strategy is conceived. In the evolution process, it is discovered that incorporating expert knowledge into the initialization contributes to better outcomes. Experimental results demonstrate that PSOPrompt matches or outperforms existing approaches.

Authors

Institutions

Publication Details

Journal
Proceedings of the Genetic and Evolutionary Computation Conference Companion
Published
2025-07-14
DOI
https://doi.org/10.1145/3712255.3726598
Primary Topic
Topic Modeling
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Particle Swarm Optimization for Automating Prompt Optimization in Large Language Models on Text Classification and Generation Tasks

Bin Wang, Bing Xue, Mengjie Zhang, Linsen Li
Proceedings of the Genetic and Evolutionary Computation Conference Companion
Topic Modeling
article

Particle Swarm Optimization for Automating Prompt Optimization in Large Language Models on Text Classification and Generation Tasks

Bin Wang, Bing Xue, Mengjie Zhang, Linsen Li
article en

Abstract

Large Language Models (LLMs) have demonstrated remarkable abilities in responding to natural language instructions, but their performance depends on prompts, with high-quality prompts requiring human expertise and effort. Current prompt optimization techniques include continuous prompt-based and discrete prompt-based methods. The former requires access to LLMs' parameters which is time-consuming and the latter might lead to suboptimal results due to confined search space. To address the above limitations, we propose PSOPrompt, which retains exploratin capabilities of continuous prompts without altering LLMs' parameters. Noting the continuous nature of embeddings and the success of PSO for continuous optimization problems, it is used as the optimization method, with each embedding treated as an individual. To integrate continuous prompts with discrete prompts, embedding inversion is employed and a new encoding strategy is conceived. In the evolution process, it is discovered that incorporating expert knowledge into the initialization contributes to better outcomes. Experimental results demonstrate that PSOPrompt matches or outperforms existing approaches.

Proceedings of the Genetic and Evolutionary Computation Conference Companion
Victoria University of Wellington (NZ), Hebei University (CN)
Quality Education
Openalex Percentile: Top 61%
Topic Modeling
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.