文章背景与核心概要
在大语言模型(LLM)被广泛部署为智能体(Agents)的背景下,它们往往难以满足严格的操作要求(如正确的工具调用、简洁的求解路径、以及严格的安全或格式合规性),特别是在缺乏特定领域训练数据的情况下。为了解决这一痛点,本文作者引入了 CAPO(Constraint-Aware Prompt Optimization,约束感知提示词优化),这是一种结合了基于池的重写(pool-based rewrites)与自适应约束权重的原始-对偶(primal-dual)方法,用于优化系统提示词。
在此基础上,作者进一步提出了 DCAPO(Dynamically Trained CAPO),该方法利用基于池的 GRPO(Group Relative Policy Optimization)来训练一个受反馈和对偶条件约束的重写器,同时保持任务智能体冻结。实验表明,DCAPO 能够在各种领域中成功生成可行的提示词,同时在任务准确率上达到或超过了现有基线。这项研究为受约束的大模型智能体提示词优化提供了全新的高效解决方案。
CAPO: Constraint-Aware Prompt Optimization for LLM Agents
Summary
Large language models (LLMs) deployed as agents often struggle to meet strict operational requirements—such as correct tool usage, concise solution paths, and strict safety or formatting compliance—especially when domain-specific training data is unavailable. To solve this, the authors introduce CAPO (Constraint-Aware Prompt Optimization), a primal-dual method combining pool-based rewrites with adaptive constraint weighting to optimize system prompts. Building upon this, they also propose DCAPO (Dynamically Trained CAPO), which trains a feedback- and dual-conditioned rewriter using pool-based GRPO while keeping the task agent frozen. DCAPO successfully generates feasible prompts across diverse domains while matching or improving task accuracy compared to existing baselines.
Metadata
- arXiv ID: arXiv:2608.16068 [cs.CL]
- Subjects: Computation and Language (
cs.CL); Artificial Intelligence (cs.AI) - Submitted on: 17 August 2026
- Authors: Victor Ye Dong, Reid Pryzant, Yi Liu, Jian Jiao
Abstract
大语言模型(LLM)越来越多地被部署为依赖系统提示词来使用工具和完成任务的智能体。此类部署提出了独特的运营要求,包括适当的工具使用、简洁的提示词和求解路径,以及对安全和格式策略的合规性。然而,对于许多从业者来说,收集特定领域的监督数据来对模型进行后训练以满足这些要求是不可行的。
Large language models (LLMs) are increasingly deployed as agents that rely on system prompts to use tools and complete tasks. Such deployments impose distinct operational requirements, including appropriate tool use, concise prompts and solution paths, and compliance with safety and formatting policies. For many practitioners, however, assembling domain-specific supervised data to post-train models to meet these requirements is infeasible.
我们引入了 CAPO(Constraint-Aware Prompt Optimization,约束感知提示词优化),这是一种原始-对偶方法,它将基于池的重写与自适应约束权重相结合,在显式操作约束下优化系统提示词。在各项智能体基准测试中,CAPO 能够更可靠地达到经验上可行的操作点,同时提升任务性能。CAPO 还超越了智能体场景的限制,在具有输出格式以及安全/隐私约束的助手风格评估中取得了优异的结果。
We introduce CAPO (Constraint-Aware Prompt Optimization), a primal-dual method that combines pool-based rewrites with adaptive constraint weighting to optimize system prompts under explicit operational constraints. Across agentic benchmarks, CAPO more reliably reaches empirically feasible operating points while improving task performance. CAPO also generalizes beyond agentic settings, achieving strong results on assistant-style evaluations with output-format and safety/privacy constraints.
我们进一步推出了 DCAPO(Dynamically Trained CAPO),它使用基于池的 GRPO 训练一个受反馈和对偶条件约束的重写器,同时保持任务智能体处于冻结状态。在不同规模的任务智能体上,DCAPO 在每个评估领域中都能生成可行的提示词,并且其任务准确率匹配或超越了所评估的基线。代理分析(Surrogate analysis)表征了有限池误差和离散重写误差如何影响不精确的原始-对偶过程。
We further introduce DCAPO (Dynamically Trained CAPO), which trains a feedback- and dual-conditioned rewriter with pool-based GRPO while keeping the task agent frozen. Across task agents of different sizes, DCAPO produces a feasible prompt in every evaluated domain and matches or improves the task accuracy achieved by the evaluated baselines. A surrogate analysis characterizes how finite-pool and discrete-rewrite errors enter the inexact primal-dual procedure.
Links & Resources
- Full-Text Access:
- View PDF
- HTML Version (Experimental)
- TeX Source
- License: Creative Commons Attribution 4.0
