用蒙特卡洛树搜索优化大模型的提示序列,提升复杂任务求解质量。
Optimizing Prompt Sequences using Monte Carlo Tree Search for LLM-Based Optimization
- 将提示选择建模为多步决策,用MCTS搜索最优提示序列。
- 在网路优化任务中,成功率提升2~4倍,方差降低3倍。
- 适合需要高可靠代码生成的复杂优化场景。
大型语言模型(LLMs)在代码生成和结构化推理方面表现出色,但在需要持续多步规划的复杂任务中性能常下降。现有结合蒙特卡洛树搜索(MCTS)的方法多聚焦于生成启发式代码或简单任务。本文提出MCTS-OPS,一种新型神经符号框架,将提示选择建模为由MCTS引导的序列决策过程。该方法探索并优化多步提示序列,以提升代码生成质量与大模型在通用优化任务中的求解能力。在网络优化实验中,相较于基线方法,生成代码的执行成功率显著提升,优化结果在指定目标与约束下奖励值提高2~4倍,标准差降低3倍;在难题中获得最优解的概率提升约10%。结果表明,符号规划与大模型结合在复杂领域具有生成高可靠性代码的巨大潜力。
原文摘要 · Abstract (English)
Large language models (LLMs) have demonstrated remarkable capabilities in code generation and structured reasoning; however, their performance often degrades on complex tasks that require consistent multi-step planning. Recent work has explored combining LLMs with Monte Carlo Tree Search (MCTS), yet existing approaches primarily focus on generating heuristic-based code for optimization or target simpler tasks where correctness alone is sufficient. In this work, we propose MCTS-OPS, a novel neural-symbolic framework that formulates prompt selection as a sequential decision process guided by MCTS. Our method explores and refines multi-step prompt sequences for the goal of improving code generation quality and enhancing the problem-solving capabilities of LLMs in general optimization. Experiments on network optimization show significant improvement over the baselines, both in the success rate of executing the generated code and in the optimization results with the specified objective and constraints (2$\sim$4$\times$ higher reward and 3$\times$ lower standard deviation). Moreover, it improves the chance of attaining the optimal solution by about 10\% of cases, compared to baseline methods in hard problems. These results highlight the promise of combining symbolic planning with LLMs for robust, high-quality code generation in complex domains.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。