用群体智能优化大模型推理提示与参数,提升稳定性和准确性
Agent-GWO: Collaborative Agents for Dynamic Prompt Optimization in Large Language Models

- 将提示模板和解码参数统一为可遗传的智能体配置
- 通过灰狼优化机制实现多智能体协同搜索,显著提升推理准确率
- 适用于数学与混合推理任务,适合追求高稳定性的研究者
大型语言模型在复杂推理任务中表现出色,链式思维(CoT)等提示策略进一步提升了其处理逻辑问题的能力。然而,高质量推理仍依赖人工设计的静态提示,对解码配置和任务分布敏感,导致性能波动且迁移性差。现有自动提示优化方法多采用单智能体局部搜索,无法在统一框架内同时优化提示与解码超参数,难以实现全局稳定提升。为此,我们提出 Agent-GWO,一种面向复杂推理的动态提示优化框架。具体地,我们将提示模板与解码超参数统一为可继承的智能体配置,利用灰狼优化器(GWO)的领导者-追随者机制,自动选择三个领导者(α、β、δ)引导其余智能体协同更新,实现迭代收敛至鲁棒的最优推理配置,可无缝集成于推理流程。在多个数学与混合推理基准上,使用不同大模型底座进行的大量实验表明,Agent-GWO 在准确率与稳定性上均持续优于现有方法。代码将公开发布。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。