🤖 AI Summary
This work addresses the limitations of current large language models, whose reasoning performance is constrained by handcrafted static prompts and sensitivity to decoding configurations and task distributions, leading to insufficient generalization and stability. Existing automatic prompt optimization approaches predominantly rely on single-agent local search, making it difficult to jointly optimize prompts and hyperparameters. To overcome this, the paper proposes Agent-GWO, a novel framework that introduces swarm intelligence—specifically, the Grey Wolf Optimizer (GWO)—to this domain for the first time. By leveraging the collaborative guidance of α, β, and δ leader agents in GWO, the method unifies prompt templates and decoding hyperparameters into an evolvable agent configuration, enabling dynamic, global joint optimization within a single framework. Experiments demonstrate consistent and significant improvements in accuracy and robustness across multiple mathematical and mixed-reasoning benchmarks, outperforming existing prompt optimization techniques across diverse large language model backbones.
📝 Abstract
Large Language Models (LLMs) have demonstrated strong capabilities in complex reasoning tasks, while recent prompting strategies such as Chain-of-Thought (CoT) have further elevated their performance in handling complex logical problems. Despite these advances, high-quality reasoning remains heavily reliant on manual static prompts and is sensitive to decoding configurations and task distributions, leading to performance fluctuations and limited transferability. Existing automatic prompt optimization methods typically adopt single-agent local search, failing to simultaneously optimize prompts and decoding hyperparameters within a unified framework to achieve stable global improvements. To address this limitation, we propose Agent-GWO, a dynamic prompt optimization framework for complex reasoning. Specifically, we unify prompt templates and decoding hyperparameters as inheritable agent configurations. By leveraging the leader-follower mechanism of the Grey Wolf Optimizer (GWO), we automatically select three leader agents ($α$, $β$, and $δ$) to guide the collaborative updates of the remaining agents, enabling iterative convergence toward robust optimal reasoning configurations that can be seamlessly integrated for inference. Extensive experiments on multiple mathematical and hybrid reasoning benchmarks across diverse LLM backbones show that Agent-GWO consistently improves accuracy and stability over existing prompt optimization methods. The code will be released publicly.