potentialpaper

CAPO: Constraint-Aware Prompt Optimization for LLM Agents

Victor Ye Dong, Reid Pryzant, Yi Liu, Jian Jiao

NeurIPS 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. We propose CAPO (Constraint-Aware Prompt Optimization), a primal–dual algorithm that optimizes system prompts for agentic tasks under explicit operational constraints.

Abstract. 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. 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, safety, and privacy requirements. We further introduce DCAPO (Dynamically Trained CAPO), which trains a feedback-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 highest feasible accuracy among the evaluated baselines. A surrogate analysis characterizes how finite-pool and discrete-rewrite errors enter the inexact primal–dual procedure.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
5 May 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]—[1]
Missing a version?

NeurIPS 2026

Accept (poster) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:48 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (poster)
Read decision
Meta-review

The paper presents an approach, Constraint-aware prompt optimization (CAPO) to make the prompt-optimization algorithm threshold constrained, that is, to comply with safety and formatting policies, keep constraints on prompts, etc. Previous methods have focused on prompt optimization without constraints or on explicit constraint decoding techniques applied to output tokens, but not as part of the prompt optimization strategy. The method uses Lagrangian relaxation as part of its optimization strategy. The work has been evaluated within three different agentic domains, as well as non-agentic use cases.

The work presents an interesting problem setting in which prompts are optimized under constraints. Parts of the paper are easily accessible, whereas some parts would benefit from a running example to understand. The approach seems novel, extending on the classic idea of prompt optimization. The benchmark is on the smaller end, but the actual experimental setup is relevant, with relevant applications. The evaluation is also compared with several relevant prompt optimization techniques.

However, it seems not fair to compare with all other prompt optimization techniques, which do not support constrained optimization. It is not very surprising that CAPO is the only one that reaches AllSat since the other methods do not support constraints.

The convergence theory relies on the text gradient. The theory itself is sound and is supported by CMDP theory. However, whether the text gradient can actually function as an optimizer still requires validation.

Final justification

The initial questions raised by other reviewers and me are largely clarified. It is recommended addressing these critical questions raised by reviewers at the main body of the paper in the revision to make the points clearer.

Overall, it is a good paper with clear and solid contributions. I have no problem to give it a clear recommendation.

Area Chair YJaC · Meta-reviewOpenReview ↗
Read meta-review
Meta-review

The paper presents an approach, Constraint-aware prompt optimization (CAPO) to make the prompt-optimization algorithm threshold constrained, that is, to comply with safety and formatting policies, keep constraints on prompts, etc. Previous methods have focused on prompt optimization without constraints or on explicit constraint decoding techniques applied to output tokens, but not as part of the prompt optimization strategy. The method uses Lagrangian relaxation as part of its optimization strategy. The work has been evaluated within three different agentic domains, as well as non-agentic use cases.

The work presents an interesting problem setting in which prompts are optimized under constraints. Parts of the paper are easily accessible, whereas some parts would benefit from a running example to understand. The approach seems novel, extending on the classic idea of prompt optimization. The benchmark is on the smaller end, but the actual experimental setup is relevant, with relevant applications. The evaluation is also compared with several relevant prompt optimization techniques.

However, it seems not fair to compare with all other prompt optimization techniques, which do not support constrained optimization. It is not very surprising that CAPO is the only one that reaches AllSat since the other methods do not support constraints.

The convergence theory relies on the text gradient. The theory itself is sound and is supported by CMDP theory. However, whether the text gradient can actually function as an optimizer still requires validation.

Final justification

The initial questions raised by other reviewers and me are largely clarified. It is recommended addressing these critical questions raised by reviewers at the main body of the paper in the revision to make the points clearer.

Overall, it is a good paper with clear and solid contributions. I have no problem to give it a clear recommendation.

1 comment
Authors · CommentOpenReview ↗

We thank the AC for the thoughtful meta-review and for recognizing CAPO’s novelty, its sound theoretical basis, and the practical importance of prompt optimization under explicit constraints.

To clarify the baseline-comparison setup, we provide every baseline with the same objective and constraint measurements used by CAPO, as detailed in Appendix B.3. Multi-task APO and GEPA use fixed Lagrangian weights, while MOPO uses Pareto-based ranking over the same measurements. CAPO instead adapts a separate dual weight for each constraint during search. The comparison therefore evaluates adaptive threshold control against fixed scalarization and Pareto search under the same constraint information. Competing methods also satisfy all constraints in some evaluated settings, so feasibility is not unique to CAPO. We will move these protocol details into the main text and clarify the rationale for the baseline comparisons.

To address whether the text-gradient mechanism functions as an optimizer in practice, we evaluate its optimizer-like behavior at two complementary levels. At the system level, the submitted experiments show that CAPO/DCAPO’s rewrite-evaluate-select loop reaches feasible solutions and improves constrained performance across multiple models in both agentic and non-agentic settings. At the optimization-step level, our new analysis directly tests the alignment condition underlying the convergence theory: both rewrite-induced representation changes and parameter updates align positively, on average, with their estimated ascent directions, while selected child prompts yield positive mean improvement in the Lagrangian objective. Together, these system-level outcomes and the step-level analysis provide empirical evidence that the mechanism functions as an optimizer in the evaluated settings.

We addressed the feedback from all three reviewers in detail. Following our rebuttal, Reviewers hhmX and zC5P stated that our responses addressed their main concerns. We will incorporate the resulting methodological clarifications and presentation improvements into the revised manuscript, including a concise running example of a complete CAPO update and a clearer presentation of the evaluation’s scope and scale.

Reviewer zC5POpenReview ↗
Rating
4/6
Confidence
3/5
Quality
3/4
Clarity
3/4
Significance
2/4
Originality
1/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper proposes CAPO, a method for optimizing system prompts under operational constraints. It applies the Lagrangian relaxation used in CMDPs to prompt optimization, and shows performance gains across a variety of datasets.

Strengths and weaknesses

Strengths:

  • The setting of directly using the constraint threshold as an optimization target via the Lagrangian is sound and well motivated.
  • It is interesting that λ\lambda actually varies across different datasets.

Weaknesses:

  • The convergence theory relies on the text gradient. The theory itself is sound and is supported by CMDP theory. However, whether the text gradient can actually function as an optimizer still requires validation.
  • The mechanism by which the continuous dual variable λ\lambda is translated into constraint-enforcement force is weak. τ\tau is a quantitative value and λ\lambda is also a quantitative value, but the only way they influence the prompt is through the LLM rewriter's "emphasis." This emphasis is stepwise (coarse-grained) and is only weakly tied to the continuous λ\lambda. There is not even an ablation showing the actual effect of a fixed λ\lambda (i.e., merely whether a violation occurred or not) versus a variable λ\lambda.
  • There is no comparison against the RL-based optimization line. RLPrompt is mentioned, but subsequent works such as StablePrompt [1] are a core line of this direction—e.g., showing that Mistral 7B can write prompts better than GPT-3.5. It should be verified whether these methods can naturally handle constraints via RL.

[1] Kwon, Minchan, et al. "StablePrompt: Automatic prompt tuning using reinforcement learning for large language model." Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing. 2024.

Questions

Questions:

  • Is there an ablation on the variation of the λ\lambda value? Various analyses seem necessary, such as a setting with λ\lambda fixed and a setting where the scalar mean is varied.
Limitations

yes

Final justification

The authors have addressed my concerns. Accordingly, I will raise my score.

Formatting concerns

no

3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

We thank Reviewer zC5P for recognizing that using explicit constraint thresholds as Lagrangian optimization targets is sound and well motivated, that the convergence analysis is theoretically sound, and that the observed variation of the multipliers across datasets is informative.

"Whether the text gradient can actually function as an optimizer still requires validation."

We validate optimizer-like behavior at two complementary levels.

At the system level, the submitted results already show that CAPO/DCAPO's rewrite-evaluate-select loop reaches feasible operating points across models and settings: Table 1, Figure 2, and Table 2 cover evaluations across different models and benchmarks. Appendix Table 22 further shows that the learned rewriter from DCAPO matches online CAPO's accuracy while improving its constrained trade-off, and Figure 12 shows its constrained training score rising to a stable plateau.

At the optimization-step level, Assumption B1 (Appendix A2) formalizes the optimizer-like role of the text-gradient mechanism by requiring the induced rewrite displacement dtd_t to align in expectation with the surrogate ascent direction, up to approximation error: E[⟨∇zJ(zt,λt),dt⟩∣Ft]≥κ∥∇zJ(zt,λt)∥22−ϵt\mathbb E[\langle\nabla_zJ(z_t,\lambda_t),d_t\rangle\mid\mathcal F_t]\geq\kappa\lVert\nabla_zJ(z_t,\lambda_t)\rVert_2^2-\epsilon_t. When the gradient signal dominates the approximation error, its optimizer-like signature is positive alignment. We test the corresponding empirical signature, E[⟨g^z,zchild−zparent⟩]>0\mathbb E[\langle \hat g_z,z_{\mathrm{child}}-z_{\mathrm{parent}}\rangle] > 0, on the trained DCAPO rewriter, instantiating zz as the editor's last-token hidden state. To estimate the ascent gradients ∇ztE[J]\nabla_{z_t}\mathbb E[J] and ∇θtE[J]\nabla_{\theta_t}\mathbb E[J] through the discrete sampled rewrites, we use the REINFORCE score-function estimator. Specifically, we construct LRF=∑eJelog⁡πθt(pe+∣zt,ctxe)\mathcal L_{RF}=\sum_e J_e\log\pi_{\theta_t}(p_e^+\mid z_t,ctx_e), where JeJ_e is the realized Lagrangian score, pe+p_e^+ denotes the child prompt sampled for parent-to-child rewrite edge ee, ctxectx_e denotes the auxiliary context supplied to the rewriter for sample ee, including the sampled parent trajectories. Differentiating the same surrogate with respect to ztz_t or θt\theta_t yields g^z\hat g_z or g^θ\hat g_\theta, respectively:

  • Hidden space: compute g^z=∇ztLRF\hat g_z=\nabla_{z_t}\mathcal L_{\mathrm{RF}} and compare it with the parent-to-child displacement dt=zt+−ztd_t=z_t^+-z_t.
  • Parameter space: compute g^θ=∇θtLRF\hat g_\theta=\nabla_{\theta_t}\mathcal L_{\mathrm{RF}} and compare it with the realized LoRA update Δθ=θt+1−θt\Delta\theta=\theta_{t+1}-\theta_t.
  • Realized ΔJ\Delta J: evaluate each child and its sampled parent under the same live multiplier vector and report the average ΔJ\Delta J under DCAPO's selection operator.
Diagnostic Mean
Hidden space ⟨g^z,dt⟩\langle\hat g_z,d_t\rangle 0.0460.046
Parameter space ⟨g^θ,Δθ⟩\langle\hat g_\theta,\Delta\theta\rangle 5.195.19
Realized J(pchild)−J(pparent)J(p_{child}) - J(p_{parent}) 0.400.40

Therefore we could conclude from both system and per-step optimization level that there is directional evidence of optimizer-like ascent in hidden space, parameter space, and the realized selection operator.

"The mechanism by which the continuous dual variable λ\lambda is translated into constraint-enforcement force is weak. ... This emphasis is stepwise (coarse-grained) and is only weakly tied to the continuous λ\lambda. There is not even an ablation showing the actual effect of a fixed λ\lambda ... versus a variable λ\lambda."

To clarify the mechanism of lagrangian multiplers and the existing evidence.

1. How the continuous multiplier exerts constraint-enforcement pressure. It acts through two distinct channels. First, in every round, the current multiplier enters the Lagrangian score, Jt(p)=r(p)−∑iλt,i(ci−τi)J_t(p)=r(p)-\sum_i\lambda_{t,i}(c_{i}-\tau_{i})

Thus, increasing λt,i\lambda_{t,i} proportionally increases the penalty for constraint ii. The resulting score directly determines candidate ranking, beam retention, and parent-sampling probabilities qj∝exp⁡(γJt(pj))q_j\propto\exp(\gamma J_t(p_j)). This channel uses the numerical value of λ\lambda directly and does not pass through a coarse text label.

Second, the same multiplier vector conditions the feedback supplied to the rewriter, increasing the relative emphasis placed on constraints with larger multipliers. The textual rendering is therefore an additional control channel, not the sole mechanism by which λ\lambda affects optimization.

2. Evidence from fixed weighting and controlled ablations. The submitted paper already includes both non-adaptive comparisons and a controlled update-rule ablation; we will cross-reference them more explicitly.

  • Fixed, non-adaptive constraint weighting: Multi-task APO, GEPA, and EvoPrompt-GA use similar fixed Lagrangian-style objectives, J(p)=r(p)−∑iλi(ci−τi)J(p)=r(p)-\sum_i \lambda_{i} (c_{i} - \tau_{i}), with method-specific fixed penalty definitions and native proposal and selection rules. They therefore instantiate the fixed-weight alternative raised by the reviewer.

  • Controlled occurrence-only ablation: Appendix Table 20 provides a strict module-level comparison in which the initial prompt, rewriter, evaluator, candidate generation, Lagrangian scoring, and selection pipeline are identical; only the dual update rule changes. CAPO uses the magnitude-aware residual update. It replaces CAPO's magnitude-aware residual update, λt+1,i=Π(λt,i+β(ρt,i−τi))\lambda_{t+1,i}=\Pi(\lambda_{t,i}+\beta(\rho_{t,i}-\tau_i)) with λt+1,i=Π[0,λmax⁡](λt,i+βI(ρt,i>τi))\lambda_{t+1,i} = \Pi_{[0,\lambda_{\max}]}(\lambda_{t,i}+\beta I(\rho_{t,i} > \tau_i))

Here, I(⋅)I(\cdot) is the indicator function. This ablation directly instantiates the reviewer's stepwise alternative: every violated constraint receives the same increment, regardless of violation magnitude. All metric values below are percentages.

Domain Method Acc ↑\uparrow HAR ↓\downarrow ToolEx ↓\downarrow PLen ↓\downarrow AllSat under standard thresholds
Telecom Count-based 22.522.5 37.537.5 208.6208.6 5.95.9 Yes
Telecom CAPO 50.050.0 62.562.5 34.034.0 7.27.2 Yes
Retail Count-based 42.542.5 15.015.0 46.246.2 −14.4-14.4 Yes
Retail CAPO 55.055.0 12.512.5 44.144.1 17.517.5 Yes

The fixed-weight comparisons test the removal of online adaptation, while the pipeline-matched count-based ablation isolates the value of using violation magnitude rather than only violation occurrence. CAPO achieves substantially higher feasible accuracy in both domains. Together, these results show that λ\lambda provides continuous enforcement through scoring and selection, and that adaptive, magnitude-aware updates materially improve the resulting objective-constraint trade-off.

"There is no comparison against the RL-based optimization line ... StablePrompt."

StablePrompt [1] is a directly relevant RL prompt-learning baseline. We therefore compare DCAPO with both StablePrompt and Agent-GRPO, with all methods starting from the same Qwen3-8B task-agent checkpoint.

DCAPO is fundamentally different in both what RL updates and how constrained search is performed. StablePrompt trains a policy to generate prompts from a fixed scalar reward, whereas Agent-GRPO keeps the system prompt fixed and trains the task agent. DCAPO instead freezes the task agent and trains the prompt rewriter within an evolving candidate pool. It samples parents from the pool, generates sibling rewrites conditioned on trajectories and λ\lambda, computes group-relative advantages from constraint-aware Lagrangian scores, updates the rewriter, and admits strong children back into the pool. Its online per-constraint dual updates adapt both candidate scoring and the rewrite context. Thus, DCAPO couples RL-based rewriter learning with evolutionary prompt search and adaptive constraint enforcement rather than optimizing against a stationary scalarization.

Both StablePrompt and Agent-GRPO use a stationary scalarization with fixed weights λi=1\lambda_{i}=1,

J=r−∑iλˉi[ci−τi],J=r-\sum_i \bar{\lambda}_i\big[c_i-\tau_i\big],

neither updates constraint prices online.

Domain Method Acc ↑\uparrow ToolEx ↓\downarrow HAR ↓\downarrow PLenEx ↓\downarrow AllSat
Airline threshold τ\tau --- 200.0200.0 30.030.0 25.025.0 ---
Airline StablePrompt 15.015.0 436.4436.4 5.05.0 −84.2-84.2 No
Airline Agent-GRPO 30.0\mathbf{30.0} −19.7\mathbf{-19.7} 20.0\mathbf{20.0} −92.4\mathbf{-92.4} Yes
Airline DCAPO 30.0\mathbf{30.0} −78.7\mathbf{-78.7} 0.0\mathbf{0.0} −8.0\mathbf{-8.0} Yes
Telecom threshold τ\tau --- 40.040.0 60.060.0 25.025.0 ---
Telecom StablePrompt 0.00.0 81.981.9 2.52.5 −82.3-82.3 No
Telecom Agent-GRPO 0.00.0 71.071.0 5.05.0 −92.4-92.4 No
Telecom DCAPO 12.5\mathbf{12.5} 9.9\mathbf{9.9} 12.5\mathbf{12.5} 17.8\mathbf{17.8} Yes
Retail threshold τ\tau --- 60.060.0 30.030.0 25.025.0 ---
Retail StablePrompt 22.5\mathbf{22.5} 31.3\mathbf{31.3} 5.0\mathbf{5.0} −85.7\mathbf{-85.7} Yes
Retail Agent-GRPO 25.025.0 109.1109.1 20.020.0 −92.4-92.4 No
Retail DCAPO 22.5\mathbf{22.5} 5.9\mathbf{5.9} 5.0\mathbf{5.0} −27.1\mathbf{-27.1} Yes

From results above, DCAPO reaches AllSat in all three domains: it matches the highest feasible accuracy on Airline and Retail and is the only feasible method on Telecom. This consistent cross-domain feasibility supports the effectiveness of combining learned prompt rewrites with adaptive, constraint-specific dual updates.

[1] Minchan Kwon, Gaeun Kim, Jongsuk Kim, Haeil Lee, and Junmo Kim. "StablePrompt: Automatic Prompt Tuning using Reinforcement Learning for Large Language Model." EMNLP 2024, pp. 9868--9884. https://aclanthology.org/2024.emnlp-main.551/.

Reviewer zC5P · CommentOpenReview ↗

Thank you to the authors for the detailed response. My concerns have been addressed, and I am raising my score accordingly.

Authors · CommentOpenReview ↗

Thank you again for your thorough and valuable review. We are glad that our response addressed your concerns, and we will incorporate the corresponding clarifications and present the supporting evidence more clearly in the revised manuscript.

Reviewer hhmXOpenReview ↗
Rating
4/6
Confidence
3/5
Quality
2/4
Clarity
3/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The authors of this paper present an approach called Constiant-aware prompt optimization (CAPO). The key part is to make the prompt-optimization algorithm threshold constrained, that is, to comply with safety and formatting policies, keep constraints on prompts, etc. Previous methods have focused on prompt optimization without constraints or on explicit constraint decoding techniques applied to output tokens, but not as part of the prompt optimization strategy. The method uses Lagrangian relaxation as part of its optimization strategy. The work has been evaluated within three different agentic domains, as well as non-agentic use cases.

Strengths and weaknesses

=== Strengths ===

The work presents a very interesting problem setting in which prompts are optimized under constraints.

Parts of the paper are quite easily accessible, whereas some parts would benefit from a running example. In particular, the paper would be much stronger with a running simple example that demonstrates the algorithm in section 4.5, and the dual variable updating approach of section 4.4 using a concrete example.

The approach seems quite novel, extending on the classic idea of prompt optimization. The benchmark is on the smaller end, but the actual experimental setup is relevant, with relevant applications. The evaluation is also compared with several relevant prompt optimization techniques.

=== Weaknesses ===

However, it is not clear how a fair comparison is made compared with all other prompt optimization techniques, which do not support constrained optimization. As stated on line 213, it is not very surprising that CAPO is the only one that reaches AllSat. Table 1 highlights in bold the methods that perform best only if they have feasible solutions, which is questionable if that is fair, since the other methods do not support constraints. Please see the question below.

Some experimental setups are not justified. For instance, why is the SWE-BENCH evaluation (lines 250-253 and Table 5) only compared with MOPO? See also the question about fairness when comparing with other prompt optimization techniques.

== Other minor comments ===

The order in which CAPO is introduced in the introduction can be improved. For instance, lines 25-27 talk about what CAPO cannot do. But, CAPO is not introduced until lines 28-32. I would suggst that you reorder and rewrite parts of this text.

On line 98, it is described how natural language feedback is used in the optimization loop. It would be valuable to include a specific natural-language example that demonstrates the idea and how it is implemented in practice.

Is there an error in Table 4, regarding bold for the best result? Isn't lower better both for HAR and ToolEx? Why is DECAPO bold for HAR, and not CAPO, which has a value of 5 according to the table?

Questions

Please explain how you make a fair evaluation and comparison with other prompt optimization techniques when they do not support optimization with constraints.

Limitations

Some discussion of limitations is provided by the authors (lines 793-798), but a separate paragraph on limitations at the end of the paper would be better. Also, a clearer description of the evaluation's limitations is expected.

Final justification

Thank you for the input and interesting research. Given the other reviews and the author response, I keep my positive score.

Formatting concerns

No formatting issues.

3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

We thank Reviewer hhmX for recognizing the importance of optimizing prompts under explicit constraints, the novelty of extending prompt optimization to this setting, and the relevance of the evaluated applications and comparison methods.

"It is not clear how a fair comparison is made ... when [the baselines] do not support optimization with constraints."

To clarify, the baselines were not run without constraint information. As stated in Appendix B.3, each candidate was evaluated on the merged objective and constraint workloads, with the objective and constraint metrics computed separately, and none of these baselines used CAPO's adaptive, constraint-specific dual updates. Section 6.3 similarly states that EvoPrompt-GA uses tournament+crossover under a fixed Lagrangian multipliter setting. Given task reward r(p)r(p), constraint costs ci(p)c_i(p), and thresholds τi\tau_i,we clarify each baseline and how they optimize the constrained objective as follows:

  • Multi-task APO and GEPA both used fixed equal multipliers,

    $ J(p)=r(p)-\sum_i \lambda_{i}(c_i(p)-\tau_{i}),\lambda_i=1$

  • MOPO retained its native NSGA-II ranking on

    (r(p),−c1(p),…,−cm(p)),\big(r(p),-c_1(p),\ldots,-c_m(p)\big),

Thus, all three baselines received explicit constraint signals; CAPO's distinction is its adaptive, per-constraint pressure rather than exclusive access to constraint information. Because this is an explicitly constrained optimization problem, feasibility defines the admissible solution set: the primary comparison is therefore task accuracy among prompts satisfying all thresholds. This evaluation convention is standard in constrained optimization, where reward is maximized subject to explicit constraint satisfaction, as in Tessler et al. [1] and Achiam et al. [2]. Feasibility is not structurally exclusive to CAPO: GEPA reaches AllSat on GPT-5-mini Airline, and APO reaches AllSat on GPT-5-mini Telecom. To make both views directly visible, we will underline the best raw accuracy regardless of feasibility and bold the best feasible accuracy. We will also revise Appendix B.3 to state each baseline's objective or selection rule, fixed coefficients, use of thresholds, and absence of adaptive dual updates.

"Why is the SWE-BENCH evaluation ... only compared with MOPO?"

We selected MOPO as the representative SWE-bench comparator because it natively handles multiple objectives through Pareto selection and was competitive in our main agent experiments. Since each SWE-bench optimization and evaluation requires costly API-based agent rollouts, we scoped this study as an external-validity experiment.

Add a running example, introduce CAPO earlier, provide a concrete feedback trace, correct Table 4 bolding, and consolidate the limitations.

We thank the reviewer for the opportunity to improve the paper's presentation. We will make the following revisions:

  1. Introduce CAPO and its operational purpose before presenting finite-sample and theory-scope qualifications.
  2. Add one end-to-end trace from an evaluated parent through signed residuals, the multiplier update, weighted feedback, the resulting child edit, and its evaluation.
  3. Clarify Table 4: CAPO and feedback-aware DCAPO tie for the highest feasible accuracy, with CAPO achieving lower HAR and DCAPO lower ToolEx. We will bold both accuracy entries, correct the metric-wise emphasis, and define HAR and ToolEx as lower-is-better in the caption.
  4. Add a focused limitations paragraph covering the theory’s scope, the finite-workload interpretation of feasibility, and the current focus on flat constraints, fixed optimization schedules, and the evaluated agent architectures.

[1] Tessler, C., Mankowitz, D. J., and Mannor, S. "Reward Constrained Policy Optimization." ICLR, 2019.

[2] Achiam, J., Held, D., Tamar, A., and Abbeel, P. "Constrained Policy Optimization." ICML, 2017.

Reviewer hhmX · CommentOpenReview ↗

Thank you for the clarifications and explanations, which covered most of my main concerns. Especially, it is now clearer how you compare with other methods with constraint information. Although this is discussed in the appendix to some extent, it is very important that this is clarified in the main text, both how they receive the constraint signal and the rationale for why it is reasonable. Also, the rationale for MAPO needs to be clarified in the main text. Good also that you plan to add an end-to-end trace with explanations in the main text. Given this, I have raised my score.

Authors · CommentOpenReview ↗

Thank you again for your valuable review and helpful suggestions, and for reconsidering your assessment. We will incorporate the methodological clarifications and presentation improvements outlined in our response and ensure that our comparison methodology and evaluation rationale are clearly explained in the revised main text.

Reviewer YKAzOpenReview ↗
Rating
5/6
Confidence
3/5
Quality
4/4
Clarity
4/4
Significance
4/4
Originality
4/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The paper introduces CAPO (Constraint-Aware Prompt Optimization), a framework that applies Lagrangian relaxation to automated prompt optimization. Instead of scalarizing multiple competing objectives (like length limits, safety policies, and task accuracy) into a single reward function, CAPO maintains explicit, per-constraint thresholds. It uses a primal-dual approach: dual variables (Lagrange multipliers) scale up when empirical constraint violations increase, which in turn weights the natural-language feedback provided to an LLM "rewriter" (the primal step). The authors also provide a theoretical bridge treating discrete text rewrites as inexact gradient ascent in a surrogate continuous space. Furthermore, they introduce DCAPO, which amortizes the search cost by training the rewrite policy via pool-based GRPO.

Strengths and weaknesses

Strengths

  • Theoretical Grounding (High): Bridging continuous primal-dual analysis with discrete LLM text rewrites by modeling them as inexact ascent steps in a surrogate space is a clever approach to formalizing prompt engineering.
  • Empirical Rigor (High): Benchmarking on TAU2-BENCH, SWE-BENCH, and complex chatbot constraints demonstrates that the method performs effectively in messy, agentic deployments. CAPO is consistently achieves "AllSat" (satisfying all constraints simultaneously) on the most challenging benchmarks.
  • DCAPO Extension (High): The inclusion of the DCAPO extension backs up that this framework is not just an expensive inference-time search algorithm. It demonstrates that the rewrite policy can be successfully amortized into a trained model using GRPO.

Weaknesses

  • Strong, Unverified Theoretical Assumptions (Impacts Quality): The theoretical foundation relies heavily on Assumption B1—that the LLM rewrite direction is "gradient-related in expectation." The authors explicitly acknowledge that this is a modeling assumption rather than an empirically verified property of the rewriter, which slightly weakens the theoretical claims.
  • Evaluation Overhead (Impacts Quality): While CAPO improves efficiency in its critique step to O(k⋅C)\mathcal{O}(k \cdot C) compared to APO, the rollout evaluation cost remains O(n⋅E)\mathcal{O}(n \cdot E) across multiple independent constraint workloads. In real-world scenarios, running full agentic rollouts solely to score candidates per round is prohibitively expensive.
  • Phantom Models (Impacts Reproducibility): The primary experiments rely on "GPT-5-mini" and "GPT-5.1". Unless these are anonymized pseudonyms for existing models like o1-mini or gpt-4o, using unreleased or proprietary internal models fundamentally breaks the reproducibility of the paper's main results.
Questions

Questions for the Authors

  • Validating Assumption B1: You note that Assumption B1 (the LLM rewrite acting as an inexact ascent step) is a theoretical modeling assumption. Is there an empirical proxy or measurement you can provide to show how closely the LLM's edits actually align with a true gradient step in your surrogate space?
  • DCAPO Generalization: For DCAPO, the rewriter policy is trained via GRPO on the Airline suite. Does this learned rewrite policy overfit specifically to Airline constraints, or can the DCAPO model be dropped into the Telecom or Retail suites and still successfully optimize prompts zero-shot?
Limitations

The authors clearly state that their continuous surrogate analysis relies on strong modeling assumptions that are not empirically verified. They also adequately stress-test the robustness of their method against constraint-evaluator noise and threshold tightening.

Formatting concerns

NA

1 comment
Authors · RebuttalOpenReview ↗
Rebuttal

We thank Reviewer YKAz for recognizing CAPO's theoretical grounding, empirical rigor across agentic and chatbot settings, and the value of DCAPO in amortizing prompt-rewrite search.

"Assumption B1 ... is a modeling assumption rather than an empirically verified property."

We thank the reviewer for this suggestion. B1 posits that the parent-to-child rewrite displacement aligns in expectation with a surrogate ascent direction, up to approximation error; its optimizer-like empirical signature is positive expected alignment. To test this signature for the trained DCAPO rewriter, we instantiate the surrogate state ztz_t as the editor's last-token hidden state. Because the sampled rewrites are discrete, we estimate ∇ztE[J]\nabla_{z_t}\mathbb E[J] and, as a complementary parameter-space diagnostic, ∇θtE[J]\nabla_{\theta_t}\mathbb E[J] using the REINFORCE score-function estimator. Specifically, we construct LRF=∑eJelog⁡πθt(pe+∣zt,ctxe)\mathcal L_{RF}=\sum_e J_e\log\pi_{\theta_t}(p_e^+\mid z_t,ctx_e), where JeJ_e is the realized Lagrangian score, pe+p_e^+ denotes the child prompt sampled for parent-to-child rewrite edge ee, ctxectx_e denotes the auxiliary context supplied to the rewriter for sample ee, including the sampled parent trajectories. Differentiating the same surrogate with respect to ztz_t or θt\theta_t yields g^z\hat g_z or g^θ\hat g_\theta, respectively:

  • Hidden space: compute g^z=∇ztLRF\hat g_z=\nabla_{z_t}\mathcal L_{\mathrm{RF}} and compare it with the parent-to-child displacement dt=zt+−ztd_t=z_t^+-z_t.
  • Parameter space: compute g^θ=∇θtLRF\hat g_\theta=\nabla_{\theta_t}\mathcal L_{\mathrm{RF}} and compare it with the realized LoRA update Δθ=θt+1−θt\Delta\theta=\theta_{t+1}-\theta_t.
  • Realized ΔJ\Delta J: evaluate each child and its sampled parent under the same multiplier vector and report the average ΔJ\Delta J under DCAPO's selection operator.
Metric Value
Hidden space ⟨g^z,dt⟩\langle\hat g_z,d_t\rangle 0.0460.046
Parameter space ⟨g^θ,Δθ⟩\langle\hat g_\theta,\Delta\theta\rangle 5.195.19
Realized ΔJ\Delta J 0.400.40

The consistently positive mean values provide convergent evidence of optimizer-like ascent at three complementary levels: hidden-state alignment, parameter-space alignment, and realized improvement under DCAPO's selection operator. Together, these results empirically confirm the optimizer-like ascent behavior predicted by B1 in a concrete surrogate instantiation of the rewrite mechanism underlying both CAPO and DCAPO.

"The rollout evaluation cost remains O(nE)\mathcal{O}(nE) across multiple independent constraint workloads."

In our complexity notation, EE denotes the aggregate per-round number of evaluation instances requiring independent model rollouts, summed across the objective workload and any constraint-specific workloads. More explicitly, let E0E_0 denote the objective-workload size and let Sind\mathcal S_{\mathrm{ind}} contain constraints that cannot be estimated from the objective trajectories. Then

Etotal=E0+∑i∈SindEi,Ceval=O(nEtotal).E_{\mathrm{total}} = E_0+\sum_{i\in\mathcal S_{\mathrm{ind}}}E_i, \qquad C_{\mathrm{eval}} = \mathcal{O}(nE_{\mathrm{total}}).

The number of constraints is not itself a multiplicative factor, because multiple constraint metrics may be estimated from the same trajectory batch. In our agent experiments, task success, tool use, and human escalation are computed from shared trajectories, while prompt length is computed locally. An additional EiE_i term arises only when a constraint requires an independent workload or evaluator. Consequently, the rollout cost reduces to O(nE0)\mathcal{O}(nE_0) when all rollout-derived constraints share the objective trajectories; CAPO’s multiplier update requires no additional model rollout. We will make this definition explicit in Appendix B.4 and the cost-table caption.

"Unless these are anonymized pseudonyms ... using unreleased or proprietary internal models fundamentally breaks reproducibility."

We clarify that these are not unreleased internal models, but publicly documented OpenAI models available through the OpenAI API [1][2], enabling independent API-based reproduction. We will add the exact model and deployment details to the appendix.

"Can the DCAPO model be dropped into Telecom or Retail ... zero-shot?"

We thank the reviewer for suggesting a cross-domain evaluation. As a complementary test of whether DCAPO's learned rewrite policy is specific to its training suite, we freeze a Telecom-trained rewriter and apply it to Retail and Airline, using Qwen3-8B as the frozen task agent and Ministral-3-8B-Instruct as the frozen user simulator. For each target, the rewriter receives the target-domain seed prompt and sampled trajectories, generates one prompt candidate in a single inference-only round, and evaluates the parent and selected rewrite on the held-out test split. We perform no gradient updates or iterative pool search. This evaluates zero-shot parameter transfer with inference-time trajectory feedback, as shown in the following table:

Domain Prompt Acc ↑\uparrow ToolEx ↓\downarrow HAR ↓\downarrow PLenEx ↓\downarrow AllSat
Retail threshold --- 60.060.0 30.030.0 25.025.0 ---
Retail Initial 27.527.5 84.084.0 12.512.5 −92.0-92.0 No
Retail Frozen Telecom rewrite 32.532.5 67.067.0 12.512.5 −51.0-51.0 No
Airline threshold --- 200.0200.0 30.030.0 25.025.0 ---
Airline Initial 10.010.0 329.0329.0 15.015.0 −92.0-92.0 No
Airline Frozen Telecom rewrite 10.010.0 220.0220.0 10.010.0 −24.0-24.0 No

Overall, the frozen Telecom rewriter substantially reduces the sole active constraint violation in both target domains while preserving all other satisfied constraints and maintaining or improving accuracy. This complementary experiment provides evidence that DCAPO learns constraint-directed editing behavior that generalizes beyond its training suite without target-domain parameter updates.

[1] OpenAI. "GPT-5 mini Model." https://developers.openai.com/api/docs/models/gpt-5-mini.

[2] OpenAI. "GPT-5.1 Model." https://developers.openai.com/api/docs/models/gpt-5.1.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…