Particle Swarm Optimization Meets Large Language Models

Large Language Models (LLMs) have shown remarkable capabilities across many Natural Language Processing (NLP) tasks, but their performance hinges on well-designed prompts. Recent studies have explored discrete prompt optimization using Evolutionary Algorithms (EAs), e.g., the EVOPROMPT framework for black-box automatic prompt tuning. In this paper, we introduce a new approach, Swarm-Prompt, which leverages Particle Swarm Optimization (PSO) for discrete prompt optimization in LLMs. We show how LLMs can be used to perform swarm-based position and velocity updates in discrete prompt space, generating new prompt variants that balance exploration and exploitation without access to model gradients. Swarm-Prompt follows the experimental setup of EVOPROMPT on diverse language understanding, generation, and reasoning tasks. Our experiments on instruction-following models demonstrate that PSO-driven prompt optimization yields competitive or superior results, compared to previous studies. In particular, Swarm-Prompt outperforms human-crafted prompts and prior automatic prompt generation methods, and it significantly improves over Genetic Algorithm (GA) and Differential Evolution (DE) variants on several benchmarks (e.g. 4.2% average gain on challenging reasoning tasks). To the best of our knowledge, this work is the first to connect LLMs with swarm intelligence for prompt optimization, illustrating a novel synergy between LLMs and conventional algorithms.

Authors

Institutions

Publication Details

Published
2025-05-23
DOI
https://doi.org/10.1109/ccai65422.2025.11189827
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 Meets Large Language Models

Xiaoyan Yu
Topic Modeling
article

Particle Swarm Optimization Meets Large Language Models

Xiaoyan Yu
article en

Abstract

Large Language Models (LLMs) have shown remarkable capabilities across many Natural Language Processing (NLP) tasks, but their performance hinges on well-designed prompts. Recent studies have explored discrete prompt optimization using Evolutionary Algorithms (EAs), e.g., the EVOPROMPT framework for black-box automatic prompt tuning. In this paper, we introduce a new approach, Swarm-Prompt, which leverages Particle Swarm Optimization (PSO) for discrete prompt optimization in LLMs. We show how LLMs can be used to perform swarm-based position and velocity updates in discrete prompt space, generating new prompt variants that balance exploration and exploitation without access to model gradients. Swarm-Prompt follows the experimental setup of EVOPROMPT on diverse language understanding, generation, and reasoning tasks. Our experiments on instruction-following models demonstrate that PSO-driven prompt optimization yields competitive or superior results, compared to previous studies. In particular, Swarm-Prompt outperforms human-crafted prompts and prior automatic prompt generation methods, and it significantly improves over Genetic Algorithm (GA) and Differential Evolution (DE) variants on several benchmarks (e.g. 4.2% average gain on challenging reasoning tasks). To the best of our knowledge, this work is the first to connect LLMs with swarm intelligence for prompt optimization, illustrating a novel synergy between LLMs and conventional algorithms.

Beijing Academy of Artificial Intelligence (CN)
Openalex Percentile: Top 85%
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.