Diagnosis Before Recovery: Turning Agent Failures into Selective Self-Correction

arXiv cs.CL 论文

摘要

This paper introduces DARC, a diagnosis-guided recovery harness that makes agent self-correction selective by profiling failure modes and pruning mismatched interventions before test-time correction, improving performance on ALFWorld, AppWorld, and XBRL Finance.

arXiv:2608.11772v1 Announce Type: new Abstract: Self-correction is particularly useful when a failure constrains the next repair. Coding agents benefit from this property because compilers, tests, and execution traces turn many failures into typed recovery signals, but broad language-agent tasks often expose only a coarse task failure. This creates a tension for generic recovery playbooks: they broaden the agent's context precisely when the system needs a narrower repair interface, mixing incompatible signals for invalid actions, missing procedures, and strict-format errors. Our insight is that development-set failures can recover part of the missing diagnostic substrate by deciding which recovery interventions are admissible before test-time correction. We propose DARC, a diagnosis-guided recovery harness that profiles task-family failure modes, prunes mismatched interventions from a shared recovery library, and freezes a verifier-selected success-cost policy for deployment. This causal order makes correction selective: the harness first determines what kind of failure can be repaired, then decides how much recovery evidence to spend. In ALFWorld, AppWorld, and XBRL Finance, the same protocol yields an action-validity harness, a procedural-recovery fallback, and a format-precision retrieval policy; in each evaluated setting it improves average task performance over base agents and broad playbooks while reducing environment steps or retrieval budget. Our experiments show that failures need not trigger uniformly more context: DARC turns self-correction from prompt expansion into recovery-interface design. DARC provides a practical route toward more reliable agents in domains where compiler-like feedback is absent: making failures actionable before making contexts larger.
查看原文
查看缓存全文

缓存时间: 2026/08/13 15:28

# 1Introduction
Source: [https://arxiv.org/html/2608.11772](https://arxiv.org/html/2608.11772)
Diagnosis Before Recovery: Turning Agent Failures into Selective Self\-Correction

Pan Wang Yihao Hu Hang Wang Zirui Lv Xin Zhang Jianshe Li Jiang\-Ming Yang Wei Wu Yongqi Tong🖂

Ant International

AbstractSelf\-correction is particularly useful when a failure constrains the next repair\. Coding agents benefit from this property because compilers, tests, and execution traces turn many failures into typed recovery signals, but broad language\-agent tasks often expose only a coarse task failure\. This creates a tension for generic recovery playbooks: they broaden the agent’s context precisely when the system needs a narrower repair interface, mixing incompatible signals for invalid actions, missing procedures, and strict\-format errors\. Our insight is that development\-set failures can recover part of the missing diagnostic substrate by deciding which recovery interventions are admissible before test\-time correction\. We propose DARC, a diagnosis\-guided recovery harness that profiles task\-family failure modes, prunes mismatched interventions from a shared recovery library, and freezes a verifier\-selected success\-cost policy for deployment\. This causal order makes correction selective: the harness first determines what kind of failure can be repaired, then decides how much recovery evidence to spend\. In ALFWorld, AppWorld, and XBRL Finance, the same protocol yields an action\-validity harness, a procedural\-recovery fallback, and a format\-precision retrieval policy; in each evaluated setting it improves average task performance over base agents and broad playbooks while reducing environment steps or retrieval budget\. Our experiments show that failures need not trigger uniformly more context: DARC turns self\-correction from prompt expansion into recovery\-interface design\. DARC provides a practical route toward more reliable agents in domains where compiler\-like feedback is absent: making failures actionable before making contexts larger\.Keywords:language agents, self\-correction, failure diagnosis, recovery policies, agent evaluation

## 1Introduction

Coding agents have become one of the most visible successes of language\-agent research\. A major reason is not only that code models improved, but that software environments provide an unusually powerful recovery interface: compilers expose syntax and type errors, tests expose behavioral mismatches, and execution traces localize intermediate states\[[13](https://arxiv.org/html/2608.11772#bib.bib35),[95](https://arxiv.org/html/2608.11772#bib.bib36),[25](https://arxiv.org/html/2608.11772#bib.bib67),[88](https://arxiv.org/html/2608.11772#bib.bib37),[37](https://arxiv.org/html/2608.11772#bib.bib2)\]\. These signals do more than add information\. They make failure actionable\. A type error, a failing assertion, and a timeout call for different repairs; the environment helps the agent distinguish them\.

Most agent tasks are asked to self\-correct without this diagnostic substrate\. An embodied household agent may fail after issuing an invalid action, but the benchmark may only report that the episode was not solved\. A multi\-application assistant may miss a goal because it lacks the right API workflow, while a financial extraction agent may locate the evidence but violate a strict schema\. These are not the same failure\. Yet many recovery recipes treat them as if they were: append reflection, retrieve more examples, expose a longer tool manual, or run a broad recovery playbook\. That strategy is attractive because it is generic, but it suffers from three concrete problems\.1Intervention Mismatch: a recovery signal chosen without diagnosis often cannot address the failure at hand, such as exposing an exhaustive API manual to fix an invalid embodied action or a strict\-format violation\.2Recovery Interference: irrelevant procedures can pull an embodied agent away from state\-compatible actions, long manuals can mix incompatible workflow rules, and demonstrations for one failure mode can degrade another\.3Uncontrolled Recovery Cost: triggering every recovery signal on every failure inflates environment steps, retrieval budget, and inference tokens regardless of whether the extra evidence is needed\.

The key question is therefore not whether agents need more recovery material, but*which failure should be allowed to trigger which recovery signal*\. This paper studies*diagnosis\-guided agent self\-correction*: using development failures to recover part of the compiler\-like role that broad agent tasks lack\. Instead of treating a failure as a request for more context, we treat it as evidence about the dominant bottleneck of a task family\. The output is a*recovery harness*: a frozen policy that links a diagnosed failure mode to a restricted set of admissible recovery interventions, such as an action\-validity guard, a procedural API source, a local induction rule, or a retrieval\-demonstration budget\.

We proposeDARC, a framework forDiagnosis\-guidedAgentRecovery andCorrection\. DARC makes two design choices explicit\.First, to address[1](https://arxiv.org/html/2608.11772#issue..mismatch), it profiles development\-set failures and restricts the recovery library before test evaluation, so interventions that cannot address the diagnosed failure mode are excluded rather than mixed into a generic playbook\.Second, to resolve[2](https://arxiv.org/html/2608.11772#issue..interference)and[3](https://arxiv.org/html/2608.11772#issue..cost), within the admissible set it uses training\-set verifier feedback to distill a short success\-cost policy for deployment, so that expensive recovery evidence is spent only when cheaper interventions fail\. To ensure stability and auditability, we freeze this diagnosis at the task\-family level rather than learning it online\.

We evaluate this protocol in three settings chosen to stress different recovery needs\. ALFWorld tests action validity, where recovery should constrain state\-incompatible actions rather than expose unrelated manuals\. AppWorld tests procedural breadth, where recovery should reveal richer API workflow knowledge only when cheaper procedural sources fail\. XBRL Finance tests format precision, where recovery should tune demonstration evidence without expanding into a broad playbook\. These settings allow us to evaluate whether failure diagnosis makes self\-correction more reliable and cost\-aware across diverse bottlenecks\.

Our contributions are:

- •We formulate diagnosis\-guided agent self\-correction as the problem of turning ambiguous task failures into actionable recovery signals, motivated by the compiler\-like feedback available in coding but often absent in broad agent tasks\.
- •We propose DARC, which constructs recovery harnesses by development\-set failure diagnosis, admissible\-intervention restriction, and success\-cost policy distillation\.
- •We evaluate DARC on ALFWorld, AppWorld, and XBRL Finance, showing that targeted recovery improves average success or accuracy under the reported protocols while reducing environment steps or retrieval budget\.
- •We provide extensive ablations isolating the impact of correct, generic, and mismatched recovery policies, demonstrating that diagnosis\-guided restriction is essential for efficient self\-correction\.

![Refer to caption](https://arxiv.org/html/2608.11772v1/darc_pipeline.png)Figure 1:DARC constructs a diagnosis\-guided recovery harness\. Development failures are converted into a task\-family failure diagnosis, which restricts the candidate recovery interventions\. Training\-set verifier feedback then scores candidate fallback policies, and the selected policy is frozen before test evaluation\.
## 2Related Work

Self\-correction from execution feedback\.Recent work shows that agents can improve when feedback is structured enough to guide repair\. In code generation, Self\-Debugging uses execution results and explanations to refine programs\[[13](https://arxiv.org/html/2608.11772#bib.bib35)\], while LDB segments programs into execution units and verifies intermediate runtime states\[[95](https://arxiv.org/html/2608.11772#bib.bib36)\]\. Related code\-agent and program\-synthesis work uses generated tests, execution traces, benchmarks, or agent\-computer interfaces to expose concrete repair signals\[[10](https://arxiv.org/html/2608.11772#bib.bib70),[47](https://arxiv.org/html/2608.11772#bib.bib71),[12](https://arxiv.org/html/2608.11772#bib.bib72),[6](https://arxiv.org/html/2608.11772#bib.bib73),[25](https://arxiv.org/html/2608.11772#bib.bib67),[88](https://arxiv.org/html/2608.11772#bib.bib37),[85](https://arxiv.org/html/2608.11772#bib.bib68),[80](https://arxiv.org/html/2608.11772#bib.bib69)\]\. Work on learning from mistakes and negative examples similarly suggests that errors can be useful supervision when their structure is exposed\[[70](https://arxiv.org/html/2608.11772#bib.bib43),[78](https://arxiv.org/html/2608.11772#bib.bib91),[76](https://arxiv.org/html/2608.11772#bib.bib96),[21](https://arxiv.org/html/2608.11772#bib.bib30)\]\. Voyager uses environment feedback, execution errors, and self\-verification to grow a skill library in Minecraft\[[75](https://arxiv.org/html/2608.11772#bib.bib14)\]\. DARC takes this compiler\-like feedback as motivation, but targets settings where such feedback is not naturally available: it uses development failures to build a task\-family recovery interface for non\-coding agent tasks\.

Language\-agent recovery and reflection\.ReAct\[[92](https://arxiv.org/html/2608.11772#bib.bib12)\]interleaves reasoning and acting, Reflexion\[[64](https://arxiv.org/html/2608.11772#bib.bib13)\]stores verbal feedback, and recursive critique\[[30](https://arxiv.org/html/2608.11772#bib.bib15)\]uses feedback loops for computer\-control tasks\. Broader reasoning and refinement methods use chain\-of\-thought, self\-consistency, decomposition, search, or process supervision to make intermediate reasoning states more explicit\[[82](https://arxiv.org/html/2608.11772#bib.bib50),[31](https://arxiv.org/html/2608.11772#bib.bib51),[81](https://arxiv.org/html/2608.11772#bib.bib52),[93](https://arxiv.org/html/2608.11772#bib.bib53),[96](https://arxiv.org/html/2608.11772#bib.bib90),[91](https://arxiv.org/html/2608.11772#bib.bib54),[46](https://arxiv.org/html/2608.11772#bib.bib55),[83](https://arxiv.org/html/2608.11772#bib.bib56),[40](https://arxiv.org/html/2608.11772#bib.bib57),[14](https://arxiv.org/html/2608.11772#bib.bib58),[72](https://arxiv.org/html/2608.11772#bib.bib45),[71](https://arxiv.org/html/2608.11772#bib.bib44),[77](https://arxiv.org/html/2608.11772#bib.bib1)\]\. These methods demonstrate the value of self\-correction, but the recovery mechanism is often applied uniformly across failures\. DARC instead makes the recovery policy conditional on a diagnosed failure mode: action\-validity recovery, procedural recovery, and format\-precision recovery expose different interventions\.

Prompt optimization and generic context\.Frameworks such as DSPy\[[28](https://arxiv.org/html/2608.11772#bib.bib20)\]and teleprompter\-based optimization\[[48](https://arxiv.org/html/2608.11772#bib.bib16)\]tune instructions and demonstrations over validation data\. Tool and multi\-agent systems expose external modules, APIs, planning roles, or conversation protocols to language models\[[26](https://arxiv.org/html/2608.11772#bib.bib59),[60](https://arxiv.org/html/2608.11772#bib.bib3),[52](https://arxiv.org/html/2608.11772#bib.bib60),[36](https://arxiv.org/html/2608.11772#bib.bib61),[62](https://arxiv.org/html/2608.11772#bib.bib62),[56](https://arxiv.org/html/2608.11772#bib.bib10),[54](https://arxiv.org/html/2608.11772#bib.bib4),[84](https://arxiv.org/html/2608.11772#bib.bib63),[34](https://arxiv.org/html/2608.11772#bib.bib64),[19](https://arxiv.org/html/2608.11772#bib.bib65),[67](https://arxiv.org/html/2608.11772#bib.bib66)\]\. Other lines use reinforcement learning or preference optimization to update model behavior\[[49](https://arxiv.org/html/2608.11772#bib.bib83),[8](https://arxiv.org/html/2608.11772#bib.bib84),[32](https://arxiv.org/html/2608.11772#bib.bib85),[61](https://arxiv.org/html/2608.11772#bib.bib19),[59](https://arxiv.org/html/2608.11772#bib.bib24),[4](https://arxiv.org/html/2608.11772#bib.bib25),[38](https://arxiv.org/html/2608.11772#bib.bib26),[79](https://arxiv.org/html/2608.11772#bib.bib46),[86](https://arxiv.org/html/2608.11772#bib.bib47),[51](https://arxiv.org/html/2608.11772#bib.bib48)\], including multi\-turn or device\-control agents\[[97](https://arxiv.org/html/2608.11772#bib.bib27),[7](https://arxiv.org/html/2608.11772#bib.bib28),[55](https://arxiv.org/html/2608.11772#bib.bib29)\]\. These approaches are complementary to DARC\. Our focus is not weight updates or arbitrary prompt search, but the construction of a recovery interface that decides which feedback and interventions are relevant for a diagnosed failure mode\.

When more context is not neutral\.The motivation for diagnosis\-guided recovery is strengthened by evidence that irrelevant or poorly placed context can hurt language\-model behavior\. GSM\-IC shows that irrelevant context can distract LLM reasoning\[[63](https://arxiv.org/html/2608.11772#bib.bib38)\], while Lost in the Middle shows that models do not robustly use long contexts even when relevant information is present\[[42](https://arxiv.org/html/2608.11772#bib.bib39)\]\. Long\-context, real\-world chat, format\-following, and safety studies similarly show that performance depends on where information appears, whether irrelevant material is present, and whether the task constraints are precise\[[9](https://arxiv.org/html/2608.11772#bib.bib5),[20](https://arxiv.org/html/2608.11772#bib.bib81),[35](https://arxiv.org/html/2608.11772#bib.bib82),[89](https://arxiv.org/html/2608.11772#bib.bib6),[69](https://arxiv.org/html/2608.11772#bib.bib9),[41](https://arxiv.org/html/2608.11772#bib.bib42),[50](https://arxiv.org/html/2608.11772#bib.bib49)\]\. In agent settings, a generic playbook can similarly mix unrelated procedures, constraints, and demonstrations\. DARC addresses this by restricting recovery context before policy search rather than appending a universal context bundle after every failure\.

Cascades, routing, and adaptive computation\.LLM cascade methods such as FrugalGPT\[[11](https://arxiv.org/html/2608.11772#bib.bib17)\]and AutoMix\[[2](https://arxiv.org/html/2608.11772#bib.bib18)\]route queries among models to trade cost for accuracy\. Retrieval\-augmented and adaptive\-retrieval methods decide what evidence to fetch or how much retrieval is needed for a query\[[33](https://arxiv.org/html/2608.11772#bib.bib21),[27](https://arxiv.org/html/2608.11772#bib.bib74),[17](https://arxiv.org/html/2608.11772#bib.bib75),[22](https://arxiv.org/html/2608.11772#bib.bib76),[23](https://arxiv.org/html/2608.11772#bib.bib77),[16](https://arxiv.org/html/2608.11772#bib.bib78),[5](https://arxiv.org/html/2608.11772#bib.bib79),[87](https://arxiv.org/html/2608.11772#bib.bib80),[24](https://arxiv.org/html/2608.11772#bib.bib11)\]\. DARC routes among*recovery interventions*rather than base models\. Scaling or switching the model does not necessarily fix an invalid action, a missing API procedure, or an output\-format violation\. The closest matched baseline is therefore a validation\-selected full\-library recovery cascade without diagnosis; we report this controlled comparison on ALFWorld in Section[6](https://arxiv.org/html/2608.11772#S6)\(Table[14](https://arxiv.org/html/2608.11772#A8.T14)\), where diagnosis matches full\-library accuracy while searching a much smaller policy space\.

## 3Problem Setup: Diagnosis\-Guided Recovery

Let𝒳\\mathcal\{X\}denote a task family and let an agent produce an output or trajectoryyyfor each taskx∈𝒳x\\in\\mathcal\{X\}\. Evaluation is given by a task verifiers⁡\(x,y\)∈\{0,1\}s\(x,y\)\\in\\\{0,1\\\}and an execution costc⁡\(x,y\)≥0c\(x,y\)\\geq 0, such as environment steps, latency, or retrieval budget\. We assume a library of candidate recovery interventionsℛ\\mathcal\{R\}, where an intervention may be an action guard, an API procedure source, a local induction rule, or a few\-shot retrieval budget\. We use*intervention*for an executable correction signal that can be attached to a base agent and evaluated by the task verifier\. A failure signal is*actionable*when it selects or parameterizes an admissible intervention rather than merely adding more undifferentiated context\.

The central object in this paper is a*recovery harness*\. A harness for failure modemmis defined as a tuple

Hm=\(m,ℛm,πm\),H\_\{m\}=\(m,\\mathcal\{R\}\_\{m\},\\pi\_\{m\}\),\(1\)whereℛm⊆ℛ\\mathcal\{R\}\_\{m\}\\subseteq\\mathcal\{R\}is the set of interventions admissible for that diagnosed failure mode andπm=\(r1,…,rL\)\\pi\_\{m\}=\(r\_\{1\},\\ldots,r\_\{L\}\)is the ordered deployment policy over those interventions\. In our instantiation,mmis assigned at the task\-family level from development\-set failure profiles\. Each benchmark family or split pair defines one𝒳\\mathcal\{X\}and one fixed recovery policy before test evaluation\.

The recovery objective is to select a short policy that improves task success without invoking unnecessary or mismatched interventions:

maxπ∈Σ⁡\(ℛm\)⁡𝔼x∼𝒳​\[s⁡\(x,π\)\]−λ​max⁡\(0,𝔼x∼𝒳​\[c⁡\(x,π\)\]−τfree\),\\max\_\{\\pi\\in\\Sigma\(\\mathcal\{R\}\_\{m\}\)\}\\;\\mathbb\{E\}\_\{x\\sim\\mathcal\{X\}\}\[s\(x,\\pi\)\]\-\\lambda\\max\\big\(0,\\mathbb\{E\}\_\{x\\sim\\mathcal\{X\}\}\[c\(x,\\pi\)\]\-\\tau\_\{\\text\{free\}\}\\big\),\(2\)whereΣ⁡\(ℛm\)\\Sigma\(\\mathcal\{R\}\_\{m\}\)is the space of bounded\-length recovery policies,λ\\lambdacontrols the cost\-success tradeoff, andτfree\\tau\_\{\\text\{free\}\}is the cost allowance of a standard attempt\. This formulation makes two questions explicit: which recovery signals are actionable for this failure mode, and in what order should they be invoked?

## 4DARC: Diagnosis\-Guided Agent Recovery and Correction

DARC constructs a recovery harness in two stages \(Figure[1](https://arxiv.org/html/2608.11772#S1.F1)\)\. The diagnosis stage turns development failures into a task\-family failure mode and restricts the recovery interventions that may be used\. The policy\-distillation stage freezes a cost\-aware fallback policy over that restricted intervention set\. Algorithm[1](https://arxiv.org/html/2608.11772#alg1)summarizes the procedure\.

Algorithm 1DARC Recovery\-Harness Construction0:Task family

𝒳\\mathcal\{X\}, candidate intervention library

ℛ\\mathcal\{R\}, training tasks

𝒟train\\mathcal\{D\}\_\{\\text\{train\}\}, failure\-profile data

𝒟dev\\mathcal\{D\}\_\{\\text\{dev\}\}, penalty

λ\\lambda\.

1:Profile:Run the base agent on

𝒟dev\\mathcal\{D\}\_\{\\text\{dev\}\}and measure failure signatures\.

2:Diagnose:Select dominant failure mode

mmand admissible intervention set

ℛm⊆ℛ\\mathcal\{R\}\_\{m\}\\subseteq\\mathcal\{R\}\.

3:Evaluate interventions:For each

xi∈𝒟trainx\_\{i\}\\in\\mathcal\{D\}\_\{\\text\{train\}\}and intervention

rj∈ℛmr\_\{j\}\\in\\mathcal\{R\}\_\{m\}, record success

s⁡\(xi,rj\)s\(x\_\{i\},r\_\{j\}\)and cost

c⁡\(xi,rj\)c\(x\_\{i\},r\_\{j\}\)\.

4:Distill policy:Enumerate bounded candidate policies

π∈Σ⁡\(ℛm\)\\pi\\in\\Sigma\(\\mathcal\{R\}\_\{m\}\)and score them by

J⁡\(π\)J\(\\pi\)\.

5:Freeze:Deploy

π∗=arg⁡maxπ⁡J⁡\(π\)\\pi^\{\*\}=\\arg\\max\_\{\\pi\}J\(\\pi\)as the task\-family recovery policy\.

Candidate intervention library\.The candidate libraryℛ\\mathcal\{R\}is fixed before test evaluation\. It contains the recovery interventions available to all relevant baselines in a benchmark family: action guards for ALFWorld, procedural knowledge sources and local induction rules for AppWorld, and retrieval\-demonstration budgets for Finance\. DARC does not invent new interventions at test time; it restricts this pre\-specified library to the interventions that match the diagnosed failure mode\.

### 4\.1Failure Diagnosis

DARC converts development\-set failure analysis into a harness restriction\. For each task family, we execute the base agent on development tasks and measure observable failure signatures: invalid or state\-incompatible actions in ALFWorld, missing cross\-application procedures in AppWorld, and exact\-format violations in XBRL Finance\. These signatures identify a dominant failure mode and determine the admissible intervention setℛm\\mathcal\{R\}\_\{m\}\.

This frozen, task\-family\-level diagnosis makes the harness auditable, avoids test\-time updates, and prevents the policy from observing test labels\. While the framework can support learned per\-instance routing, our experiments evaluate the controlled setting where each family instantiates one dominant failure mode\. Appendix[C](https://arxiv.org/html/2608.11772#A3)lists the failure signals and intervention sets, while Appendix[D](https://arxiv.org/html/2608.11772#A4)provides representative development\-trace diagnosis examples\.

The output of diagnosis is not a longer prompt; it is a constrained recovery space\. ALFWorld receives an action\-validity harness, AppWorld receives a procedural\-knowledge harness, and Finance receives a format\-precision harness based on retrieval demonstrations\. This restriction is the key difference from a universal playbook: interventions that cannot address the diagnosed failure mode are excluded before policy search, reducing irrelevant or conflicting recovery context\.

### 4\.2Recovery\-Policy Distillation

Givenℛm\\mathcal\{R\}\_\{m\}, DARC estimates which intervention or intervention sequence should be used at deployment time\. For each training taskxix\_\{i\}and interventionrjr\_\{j\}, we collect

Ei,j=\(s⁡\(xi,rj\),c⁡\(xi,rj\)\),E\_\{i,j\}=\\big\(s\(x\_\{i\},r\_\{j\}\),c\(x\_\{i\},r\_\{j\}\)\\big\),\(3\)where success is measured by the same task verifier used for training\-set adaptation and cost is measured in the relevant budget unit\. This uses training\-set success feedback; it does not use test labels\. Section[5](https://arxiv.org/html/2608.11772#S5)reports this accounting explicitly for all methods\.

DARC evaluates a candidate policyπ=\(r1,…,rL\)\\pi=\(r\_\{1\},\\ldots,r\_\{L\}\)as a short\-circuit policy: the agent tries interventions in order and stops when one succeeds\. The halting index is

hi∗\(π\)=\{min⁡\{t:s⁡\(xi,rt\)=1\},if any intervention in​π​succeeds,L,otherwise\.h\_\{i\}^\{\*\}\(\\pi\)=\\begin\{cases\}\\min\\\{t:s\(x\_\{i\},r\_\{t\}\)=1\\\},&\\text\{if any intervention in \}\\pi\\text\{ succeeds,\}\\\\ L,&\\text\{otherwise\.\}\\end\{cases\}\(4\)The empirical success and cost are

succ^​\(π\)=1\|𝒟train\|​∑imaxrt∈π⁡s⁡\(xi,rt\),\\widehat\{\\mathrm\{succ\}\}\(\\pi\)=\\frac\{1\}\{\|\\mathcal\{D\}\_\{\\text\{train\}\}\|\}\\sum\_\{i\}\\max\_\{r\_\{t\}\\in\\pi\}s\(x\_\{i\},r\_\{t\}\),\(5\)cost^​\(π\)=1\|𝒟train\|​∑i∑t=1hi∗​\(π\)c⁡\(xi,rt\)\.\\widehat\{\\mathrm\{cost\}\}\(\\pi\)=\\frac\{1\}\{\|\\mathcal\{D\}\_\{\\text\{train\}\}\|\}\\sum\_\{i\}\\sum\_\{t=1\}^\{h\_\{i\}^\{\*\}\(\\pi\)\}c\(x\_\{i\},r\_\{t\}\)\.\(6\)The deployed policy maximizes

J⁡\(π\)=succ^​\(π\)−λ​max⁡\(0,cost^​\(π\)−τfree\)\.J\(\\pi\)=\\widehat\{\\mathrm\{succ\}\}\(\\pi\)\-\\lambda\\max\(0,\\widehat\{\\mathrm\{cost\}\}\(\\pi\)\-\\tau\_\{\\text\{free\}\}\)\.\(7\)
The short\-circuit estimate assumes that intervention attempts are evaluated under a controlled retry protocol: later interventions are invoked only after an earlier intervention fails, and the verifier can attribute success and cost to the invoked intervention\. In resettable environments, each intervention can be evaluated from the same initial state; in retrieval and extraction settings, interventions differ only in the supplied evidence budget\. This assumption is explicit because it determines when an offline evidence matrix is a valid proxy for deployment\. Table[1](https://arxiv.org/html/2608.11772#S4.T1)summarizes the deployment semantics used by each benchmark family\.

Table 1:Deployment semantics for the reported DARC policies\. The policy is frozen before test evaluation; later interventions are invoked only after earlier interventions fail under the benchmark verifier\.BenchmarkLater intervention observesSide\-effect controlReported costALFWorldSame episode specification with a stricter action\-validity harnessResettable evaluation from the same initial environment stateEnvironment steps, invalid actions, seconds per episodeAppWorldRicher procedural context after a cheaper procedural source failsControlled task attempts with success attributed by the task verifierEnvironment steps and task/scenario completionFinanceSame extraction query with a different retrieval\-demonstration budgetStateless extraction; no environment side effectsRetrieval budgetkkand answer accuracy
### 4\.3Structural Properties

The success term in DARC is a coverage objective over recovery interventions\. For a subsetA⊆ℛmA\\subseteq\\mathcal\{R\}\_\{m\}, definef⁡\(A\)=1n​∑imaxr∈A⁡s⁡\(xi,r\)f\(A\)=\\frac\{1\}\{n\}\\sum\_\{i\}\\max\_\{r\\in A\}s\(x\_\{i\},r\)\. Thenffis monotone and submodular, because adding an intervention can only cover additional tasks and marginal gains shrink as the covered set grows\. This explains why short policies can capture most of the reachable recovery set in our finite candidate spaces\.

The full objective in Eq\.[7](https://arxiv.org/html/2608.11772#S4.E7)is an ordered, cost\-penalized policy objective, so the coverage result alone does not establish optimal cost\-aware ordering\. Instead, diagnosis reduces the candidate space and policy distillation enumerates bounded policies inside that space\. For a fixed finite policy classΣK\\Sigma\_\{K\}, standard uniform convergence gives that the empirical maximizer approaches the best population policy at rateO⁡\(log⁡\|ΣK\|/n\)O\(\\sqrt\{\\log\|\\Sigma\_\{K\}\|/n\}\)under bounded per\-task costs\. Since\|ΣK\|\|\\Sigma\_\{K\}\|decreases with\|ℛm\|\|\\mathcal\{R\}\_\{m\}\|, diagnosis\-guided restriction supports selection within a fixed finite candidate class; transfer across new failure modes remains an empirical question\.

## 5Experiments

We evaluate whether diagnosis\-guided recovery improves agent self\-correction under controlled adaptation budgets\. The experiments answer four questions:

- •RQ1 \(Performance\):How does DARC compare with base agents and generic playbook baselines?
- •RQ2 \(Transfer\):Do frozen recovery policies transfer across related splits or tasks?
- •RQ3 \(Diagnosis\):How much does selecting the correct diagnosis\-guided recovery policy matter relative to generic or mismatched policies?
- •RQ4 \(Cost\):Does the distilled policy reduce unnecessary environment steps or retrieval budget?

### 5\.1Experimental Setup

Benchmarks and recovery diagnoses\.We instantiate one dominant failure diagnosis per benchmark family \(Appendix[C](https://arxiv.org/html/2608.11772#A3)\)\.ALFWorld\[[65](https://arxiv.org/html/2608.11772#bib.bib22)\]is treated as an action\-validity setting, so the recovery harness contains task\-specific action guards\.AppWorld\[[73](https://arxiv.org/html/2608.11772#bib.bib23)\]is treated as a procedural\-knowledge setting, so the harness contains Auto\-Knowledge, local induction, and retrieval fallback interventions\.XBRL Finance\[[45](https://arxiv.org/html/2608.11772#bib.bib31),[74](https://arxiv.org/html/2608.11772#bib.bib32)\]is treated as a format\-precision setting, so the harness restricts interventions to retrieval\-based demonstrations and distills the retrieval budgetkk\.

Baselines\.We compare againstBase LLM,ICL\[[1](https://arxiv.org/html/2608.11772#bib.bib33)\],MIPROv2\[[48](https://arxiv.org/html/2608.11772#bib.bib16)\],GEPA\[[3](https://arxiv.org/html/2608.11772#bib.bib34)\], andACE\[[94](https://arxiv.org/html/2608.11772#bib.bib97)\]\. These baselines cover many\-shot in\-context learning, instruction/demonstration optimization, and reflective prompt evolution\[[28](https://arxiv.org/html/2608.11772#bib.bib20)\]\. All offline\-adaptation methods use the same training split and adaptation budget available to DARC unless a baseline is not applicable to a benchmark\. Appendix[G](https://arxiv.org/html/2608.11772#A7)summarizes the mechanisms\.

Supervision and feedback accounting\.DARC uses training\-set verifier outcomes to estimate intervention success in the evidence matrix; it does not use test labels\. This differs from prompt\-optimization baselines that directly use answer labels to construct prompts or demonstrations\. Table[2](https://arxiv.org/html/2608.11772#S5.T2)separates these forms of information\.

Table 2:Information used during adaptation\. “Train success” denotes training\-set verifier or task\-success feedback used to score candidate policies\. “Answer labels” denotes direct use of ground\-truth answers to construct prompts, demonstrations, or optimized instructions\. No method uses test labels\.MethodTrain successAnswer labelsTest labelsBase LLMNoNoNoICLNoYesNoMIPROv2 / GEPAYesYesNoACEYesNoNoDARCYesNoNo

Evaluation scope\.We report all quantitative metrics as empirical estimates across the respective evaluation splits, and we complement the headline comparison with scenario\-cluster bootstrap confidence intervals and paired significance tests to assess whether the observed gaps exceed split\-level sampling noise \(Figure[2](https://arxiv.org/html/2608.11772#S5.F2)\)\. To isolate the impact of our diagnosis\-guided restriction, the ablation studies compare three recovery strategies: \(1\) thecorrectpolicy, which aligns interventions with the diagnosed failure mode; \(2\) agenericbaseline that uses a standard, unconstrained recovery playbook; and \(3\) amismatchedpolicy that acts as a negative control by applying an incompatible intervention set\. This design separates the actual benefits of targeted recovery from the simple effect of adding more context\.

### 5\.2Main Benchmark Results

Tables[3](https://arxiv.org/html/2608.11772#S5.T3)and[4](https://arxiv.org/html/2608.11772#S5.T4)report the main results\. Across the evaluated settings, DARC generally improves average performance over base agents and generic playbooks, but the gains are not uniform across every metric\. In particular, ACE matches or exceeds DARC on some AppWorld challenge metrics for Qwen3\.5\-27B and Qwen3\.6\-27B\[[57](https://arxiv.org/html/2608.11772#bib.bib40),[58](https://arxiv.org/html/2608.11772#bib.bib41)\]\. We therefore interpret these results as evidence for the average utility of diagnosis\-guided recovery, though the gains vary by metric\.

On ALFWorld, the action\-validity recovery policy substantially improves both seen and unseen splits\. With DeepSeek\-V4\-Flash, valid\-unseen success increases from 39\.55% for the base agent and 54\.48% for ACE to 90\.30%\. On AppWorld, the procedural recovery policy gives the strongest gains on Test\-Normal and improves average TGC for all three base models, while challenge\-split SGC remains competitive with ACE rather than uniformly better\. On Finance, the format\-precision policy reaches 94\.50% macro accuracy with DeepSeek\-V4\-Flash, compared with 80\.50% for ACE and 74\.00% for MIPROv2 under the reported protocol\. As detailed in Table[4](https://arxiv.org/html/2608.11772#S5.T4), “Answer Labels” follows Table[2](https://arxiv.org/html/2608.11772#S5.T2): whether ground\-truth answers are directly used to construct prompts or demonstrations during adaptation\. DARC uses training\-set verifier outcomes to score retrieval budgets but does not use test labels\.

Statistical significance\.Because agent benchmarks are evaluated on finite task splits, we quantify the uncertainty of the headline AppWorld comparison at the scenario level\. AppWorld Test\-Normal contains 168 tasks nested within 56 scenarios \(three tasks per scenario\); since outcomes within the same scenario are correlated, we treat the scenario rather than the individual task as the independent statistical unit\. We align all methods by task identifier, compute per\-scenario TGC as the fraction of completed tasks and SGC as an indicator that all three tasks are completed, and estimate 95% confidence intervals with 20,000 scenario\-cluster bootstrap resamples shared across methods\. Figure[2](https://arxiv.org/html/2608.11772#S5.F2)reports the resulting intervals for DeepSeek\-V4\-Flash: those of DARC do not overlap those of ACE or the base agent\. Using a two\-sided pairedtt\-test for per\-scenario TGC and an exact McNemar test for paired SGC outcomes, we confirm that all DARC\-versus\-baseline comparisons remain significant across the 56 scenarios after Holm correction\. These intervals quantify scenario\-sampling uncertainty rather than variation across model\-training seeds\.

Figure 2:AppWorld Test\-Normal completion for DeepSeek\-V4\-Flash with 95% scenario\-cluster bootstrap confidence intervals \(20,000 resamples over 56 scenarios\)\. The intervals of DARC do not overlap those of ACE or the base agent on either TGC or SGC, and paired scenario\-level tests with Holm correction confirm the gaps are significant\.Table 3:Benchmark results on ALFWorld and AppWorld\. For ALFWorld, we report success rates on valid\_seen and valid\_unseen\. For AppWorld, TGC is Task Goal Completion and SGC is Scenario Goal Completion\. Bold marks the best value within each base\-model block and metric\.MethodALFWorldAppWorldvalid\_seen↑\\uparrowvalid\_unseen↑\\uparrowMacro Avg\.↑\\uparrowTest\-NormalTest\-ChallengeAverageTGC↑\\uparrowSGC↑\\uparrowTGC↑\\uparrowSGC↑\\uparrowTGC↑\\uparrowSGC↑\\uparrowDeepSeek\-V4\-FlashBase LLM40\.71%39\.55%40\.13%23\.21%7\.14%13\.43%6\.47%18\.32%6\.81%ICL46\.43%42\.54%44\.48%59\.52%42\.86%37\.17%19\.42%48\.35%31\.14%MIPROv254\.29%49\.25%51\.77%57\.14%35\.71%32\.85%10\.07%45\.00%22\.89%GEPA59\.29%63\.43%61\.36%54\.17%30\.36%33\.57%12\.95%43\.87%21\.65%ACE50\.00%54\.48%52\.24%54\.76%39\.29%35\.73%17\.99%45\.25%28\.64%DARC93\.57%90\.30%91\.94%95\.83%87\.50%53\.96%30\.22%74\.90%58\.86%Qwen3\.5\-27BBase LLM58\.57%55\.22%56\.90%42\.26%23\.21%23\.74%12\.23%33\.00%17\.72%ICL72\.14%70\.90%71\.52%75\.00%57\.14%59\.71%38\.13%67\.36%47\.64%MIPROv269\.29%60\.45%64\.87%4\.76%0\.00%6\.95%0\.72%5\.86%0\.36%GEPA79\.29%72\.39%75\.84%50\.60%17\.86%34\.29%12\.95%42\.44%15\.40%ACE80\.00%81\.34%80\.67%79\.17%64\.29%74\.58%51\.08%76\.88%57\.68%DARC94\.29%95\.52%94\.90%93\.45%89\.29%65\.47%41\.01%79\.46%65\.15%Qwen3\.6\-27BBase LLM59\.29%56\.72%58\.00%42\.86%32\.14%26\.14%12\.95%34\.50%22\.55%ICL75\.00%76\.12%75\.56%60\.71%46\.43%41\.73%25\.18%51\.22%35\.80%MIPROv263\.57%55\.22%59\.40%14\.29%8\.93%6\.47%2\.88%10\.38%5\.91%GEPA90\.00%83\.58%86\.79%45\.83%30\.36%34\.53%18\.71%40\.18%24\.53%ACE80\.71%78\.36%79\.54%67\.86%55\.36%53\.00%32\.37%60\.43%43\.86%DARC97\.14%95\.52%96\.33%86\.31%78\.57%47\.72%32\.37%67\.02%55\.47%

Table 4:Finance benchmark results on FiNER tags and Formula extraction\.MethodAnswer LabelsFiNER / Tags Acc↑\\uparrowFormula Acc↑\\uparrowAverage↑\\uparrowDeepSeek\-V4\-FlashBase LLMNo68\.00%8\.00%38\.00%ICLYes77\.50%66\.00%71\.75%MIPROv2Yes78\.50%69\.50%74\.00%GEPAYes82\.50%61\.00%71\.75%ACENo83\.00%78\.00%80\.50%DARCNo90\.00%99\.00%94\.50%Qwen3\.5\-27BBase LLMNo47\.50%24\.00%35\.75%ICLYes69\.50%45\.50%57\.50%MIPROv2Yes72\.00%58\.00%65\.00%GEPAYes68\.00%61\.00%64\.50%ACENo82\.00%79\.00%80\.50%DARCNo87\.50%98\.50%93\.00%Qwen3\.6\-27BBase LLMNo53\.00%36\.00%44\.50%ICLYes67\.00%46\.00%56\.50%MIPROv2Yes72\.50%60\.00%66\.25%GEPAYes77\.50%60\.00%68\.75%ACENo81\.50%75\.00%78\.25%DARCNo86\.50%98\.50%92\.50%

### 5\.3Cross\-Task Transferability

We next test whether a frozen recovery policy can transfer across related tasks\. For Finance, we distill a retrieval\-budget policy on Formula and deploy it on FiNER tags, and vice versa\. For ALFWorld, we distill on valid\_seen and deploy on valid\_unseen\. As shown in Table[5](https://arxiv.org/html/2608.11772#S5.T5), the target\-tuned row is shown only when a target\-specific policy was available\.

Table 5:Cross\-task transferability of frozen DARC policies\. Finance transfers between the Formula and FiNER\-tags tasks; ALFWorld transfers from valid\_seen to valid\_unseen\.Finance \(Acc↑\\uparrow\)ALFWorld \(Succ↑\\uparrow\)MethodFormula→\\rightarrowFiNERFiNER→\\rightarrowFormulaseen→\\rightarrowunseenBase LLM68\.00%8\.00%39\.55%ICL77\.50%66\.00%42\.54%MIPROv278\.50%69\.50%49\.25%GEPA82\.50%61\.00%63\.43%ACE83\.00%78\.00%54\.48%DARC \(Frozen\)89\.50%96\.00%90\.30%DARC \(Target\-Tuned\)90\.00%99\.00%–

These within\-family transfer results suggest that the frozen recovery policy can preserve much of the target\-tuned performance when the failure mode remains similar\. For Finance, the frozen retrieval\-budget policy remains close to the target\-tuned policy: Formula\-to\-FiNER reaches 89\.50% versus 90\.00%, and FiNER\-to\-Formula reaches 96\.00% versus 99\.00%\. For ALFWorld, the same action\-validity policy transfers from valid\_seen to valid\_unseen and reaches 90\.30%\.

## 6Analysis and Ablation

The diagnosis\-guided view predicts that recovery interventions are not interchangeable across failure modes\. A retrieval demonstration can help Finance formatting but cannot make an ALFWorld action admissible\. An action guard can prune embodied commands but cannot supply the AppWorld API procedure needed for a multi\-application workflow\. We test this prediction by comparing correct, generic, and mismatched recovery policies\.

### 6\.1Ablation: Recovery Diagnosis

Table 6:Impact of selecting the correct recovery diagnosis\.BenchmarkMetricCorrectGenericMismatchedALFWorldSuccess↑\\uparrow91\.94%52\.24%52\.24%AppWorldTGC↑\\uparrow70\.24%61\.90%64\.88%AppWorldSGC↑\\uparrow53\.57%50\.00%46\.43%FinanceMacro↑\\uparrow94\.50%80\.50%37\.75%

Table[6](https://arxiv.org/html/2608.11772#S6.T6)shows that the correct recovery policy \(aligned with the diagnosed failure mode\) outperforms both a generic playbook and a mismatched intervention set across all evaluated settings\. For AppWorld Test\-Normal \(evaluated under a stricter 25\-step budget not comparable to Table[3](https://arxiv.org/html/2608.11772#S5.T3)\), correct diagnosis reaches 70\.24% TGC compared to 61\.90% \(generic\) and 64\.88% \(mismatched\), while achieving the best SGC with fewer environment steps than the generic playbook \(36\.60 vs\. 42\.97\)\.

While AppWorld confidence intervals overlap, the directional advantage is consistent\. Notably, the mismatched policy exceeds the generic playbook on AppWorld TGC\. This supports our premise that excessive irrelevant context \(generic\) can be more harmful than largely inert mismatched interventions, though the expected ordering holds under the stricter SGC metric\. The penalty for mismatched interventions is much larger on ALFWorld and Finance, where they actively conflict with the required recovery behavior\.

Overall, these results highlight the necessity of diagnosis\-guided restriction: adding context only helps when interventions match the underlying failure mode\. Further ablations \(Appendix[H](https://arxiv.org/html/2608.11772#A8)\) confirm that isolating the diagnosis step maintains accuracy while significantly improving search efficiency and stability\.

Figure 3:Cumulative solved episodes on ALFWorld as the maximum environment\-step budget increases\. DARC solves more episodes at lower budgets because the action\-validity recovery policy reduces invalid or inefficient actions\.
### 6\.2Matched\-Information Fairness

The large ALFWorld gain invites a fairness concern: does DARC win only because its action\-validity guard sees privileged admissibility information that baselines do not? We test this directly on the full 134\-task valid\_unseen split, with all methods using the same DeepSeek\-V4\-Flash backbone, identical environment observations, the full set of admissible actions returned by the environment, a 50\-step budget, and the same evaluation script\. Crucially, DARC’s guard is not a model\-probability ranker and does not read the environment’s ground\-truth action: it is a deterministic, diagnosis\-aware rule scorer that ranks each admissible commandaaby

S⁡\(a\)=Sgoal\+Sphase\+Ssearch\+Strain\-prior−Sconflict−Sloop,S\(a\)=S\_\{\\text\{goal\}\}\+S\_\{\\text\{phase\}\}\+S\_\{\\text\{search\}\}\+S\_\{\\text\{train\-prior\}\}\-S\_\{\\text\{conflict\}\}\-S\_\{\\text\{loop\}\},\(8\)and keeps the top 12\. All terms are computed from the task description and training\-set priors; none use test labels or environment\-provided correct actions\.

Table[7](https://arxiv.org/html/2608.11772#S6.T7)decomposes the sources of the gain\. In this table, “Base \+ matched metadata” adds only parsed task type, target object, and movable/goal containers on top of the full action set, without diagnosis, ranking, or direct execution\. Numbers are a same\-day matched rerun under the 50\-step budget; the ranked\-recovery row is the run reported as DARC valid\_unseen in Table[3](https://arxiv.org/html/2608.11772#S5.T3)\(90\.30%\)\. They are not directly comparable to the valid\_seen\-selected frozen cascade in Table[14](https://arxiv.org/html/2608.11772#A8.T14)\(99\.25%, different selection protocol\)\. Granting the base agent the same parsed metadata \(task type, target object, movable and goal containers\) improves success only marginally \(39\.55%→\\rightarrow43\.28%\), so information access alone is not the driver\. Restricting the action view to a*random*top\-12 collapses ACE \(54\.48%→\\rightarrow25\.37%\), so action\-space restriction by itself is not a free lunch and can hurt\. Diagnosis as a bare label, without the ranked recovery operator, stays at base level \(38\.81%\)\. The gain materializes only with the ranked recovery operator, which reaches 89–90% while cutting invalid actions per episode to 0\.11\. The ALFWorld improvement is therefore attributable to the quality of the diagnosis\-guided*ranking*of already\-available admissible actions, not to privileged information or restriction alone\.

Appendix[F](https://arxiv.org/html/2608.11772#A6)isolates this further with a2×22\\times 2factorial over the two components of the harness\. Neither component works alone: the recovery prompt on the full action set is worth−0\.75\-0\.75pp, the ranked action view without the recovery prompt is worth\+3\.73\+3\.73pp, and forcing the guard’s top\-1 command with no language model in the loop reaches only 40\.33%\. The two components together are worth\+49\.26\+49\.26pp, an interaction of\+46\.27\+46\.27pp\. The ALFWorld gain is thus a property of the recovery*interface*, where restriction and instruction are explicitly matched to each other, rather than of either prompt content or action pruning in isolation\.

Table 7:Matched\-information fairness evaluation on the ALFWorld valid\_unseen split\.MethodAction viewSuccess↑\\uparrowSteps↓\\downarrowInvalid/ep↓\\downarrowvs\. ACEBase LLMFull39\.55%35\.251\.709−14\.93\-14\.93Base \+ matched metadataFull43\.28%34\.021\.560−11\.19\-11\.19ACEFull54\.48%30\.061\.7840\.000\.00ACE \+ random top\-kkRandom top\-1225\.37%42\.167\.403−29\.10\-29\.10DARC, diagnosis onlyFull38\.81%34\.692\.507−15\.67\-15\.67DARC, ranked recoveryRanked top\-1290\.30%16\.500\.575\+35\.82\+35\.82DARC, full guardRanked top\-1289\.55%18\.380\.112\+35\.07\+35\.07

### 6\.3Weight\-Space Training Extension

Beyond test\-time recovery, we conduct a preliminary probe into extending DARC to weight\-space training\. Using Qwen3\-8B, we compare two full\-parameter fine\-tuning methods guided by a DARC\-derived two\-stage curriculum \(diverse\_replaythenuniform\_rollout, allocating 5\.0M and 2\.5M tokens respectively\)\.DARC\-GRPOupdates weights using standard GRPO, whileDARC\-OPSDadds an online exponential\-moving\-average \(EMA\) teacher for policy self\-distillation\. Table[8](https://arxiv.org/html/2608.11772#S6.T8)summarizes the results for the final checkpoints\.

Table 8:Full evaluation of weight\-space training extensions on ALFWorld\. Models are fine\-tuned from Qwen3\-8B using a DARC\-derived two\-stage curriculum\.Methodvalid\_seenvalid\_unseenMacro↑\\uparrowΔ\\DeltaBaseBase Qwen3\-8B7\.14%4\.48%5\.81%–DARC\-GRPO12\.14%8\.96%10\.55%\+4\.74 ppDARC\-OPSD9\.29%6\.72%8\.00%\+2\.19 pp

Both weight\-space variants improve success over the base model, suggesting that the DARC\-derived curriculum transfers to weight\-space training\. DARC\-GRPO improves macro success by 4\.74 percentage points, while DARC\-OPSD yields a smaller 2\.19 pp gain, indicating that online self\-distillation does not provide additional benefit over standard GRPO in this setting\. Because these are single\-seed runs with modest absolute gains, we treat this as a proof of concept rather than a fully verified training recipe\.

### 6\.4Benchmark\-Specific Failure Modes

Action validity in ALFWorld\.The ALFWorld recovery policy restricts the agent to state\-compatible actions\. With DeepSeek\-V4\-Flash, DARC reduces invalid actions per episode to 0\.091 \(Table[10](https://arxiv.org/html/2608.11772#S6.T10)\) and improves macro success to 91\.94% \(Table[3](https://arxiv.org/html/2608.11772#S5.T3)\)\. This supports the interpretation that action validity is the dominant failure mode in this setting\.

Procedure breadth in AppWorld\.AppWorld requires multi\-step API knowledge\. The procedural recovery policy uses a fallback chain because the interventions are complementary: a local induction rule can recover tasks that an Auto\-Knowledge source misses\. The gains are strongest on Test\-Normal; the Test\-Challenge split remains harder and includes metrics where ACE is competitive or better\.

Format precision in Finance\.Finance shows that a recovery policy may tune a single intervention dimension rather than switch among heterogeneous interventions\. Once the admissible set is restricted to retrieval demonstrations, DARC selects how much evidence to retrieve\. Table[9](https://arxiv.org/html/2608.11772#S6.T9)shows that larger retrieval budgets are not monotonic:k=8k=8andk=16k=16slightly reduce tag accuracy relative to smaller budgets\. The distilled policy usesk=2k=2for Formula andk=1k=1for Tags, staying in the top macro\-accuracy band while reducing the mean retrieval budget to 1\.5 demonstrations\.

Table 9:Finance retrieval\-budget distillation\. The DARC policy selectsk=2k=2for Formula andk=1k=1for Tags, staying in the top macro\-accuracy band with a mean budget of 1\.5 demonstrations\.MethodAnswer LabelsFormulaTagsMacroMeankkBase LLMNo8\.0%68\.0%38\.00%–ICLYes66\.0%77\.5%71\.75%4\.0MIPROv2Yes69\.5%78\.5%74\.00%–GEPAYes61\.0%82\.5%71\.75%–ACENo78\.0%83\.0%80\.50%–Fixed retrievalk=1k=1No96\.0%90\.0%93\.00%1\.0Fixed retrievalk=2k=2No99\.0%89\.5%94\.25%2\.0Fixed retrievalk=4k=4No99\.0%89\.5%94\.25%4\.0Fixed retrievalk=8k=8No99\.0%89\.0%94\.00%8\.0Fixed retrievalk=16k=16No99\.0%88\.0%93\.50%16\.0DARC policyNo99\.0%90\.0%94\.50%1\.5

### 6\.5Cost\-Success Tradeoff

Figure 4:Cost\-success tradeoff on AppWorld\. The red star marks the distilled DARC policy; points farther right use more environment steps\.Figure[4](https://arxiv.org/html/2608.11772#S6.F4)visualizes the candidate AppWorld policies\. A policy that stacks many interventions can improve coverage but increases mean environment steps\. A policy that is too short saves cost but misses recoverable tasks\. The selected DARC policy lies on the observed high\-success, lower\-cost frontier for this candidate set\.

### 6\.6Cost and Speed Efficiency

Table 10:Cost and speed efficiency on ALFWorld with DeepSeek\-V4\-Flash\. DARC improves success per 100 environment steps by reducing invalid actions and shortening trajectories\.MethodEnv Steps↓\\downarrowInvalid/ep\.↓\\downarrowSec\./ep\.↓\\downarrowSucc\./100 steps↑\\uparrowBase LLM34\.561\.288155\.41\.16ICL32\.252\.45323\.31\.38GEPA26\.511\.48920\.02\.31ACE30\.531\.343143\.81\.71DARC15\.830\.09110\.36\.02

Table[10](https://arxiv.org/html/2608.11772#S6.T10)shows the cost side of the ALFWorld recovery policy\. Relative to the base agent, DARC reduces average environment steps by 54\.2% and invalid actions by 92\.9%\. It also improves success per 100 steps from 1\.16 to 6\.02\. Figure[3](https://arxiv.org/html/2608.11772#S6.F3)shows the budget\-level view of the same effect: DARC solves more episodes than each baseline at every maximum environment\-step budget\. These numbers support the claim that diagnosis\-guided recovery can improve both success and cost in an action\-validity setting\.

## 7Conclusion and Limitations

In this work, we introduced DARC, a framework that recasts agent self\-correction from indiscriminate context expansion to diagnosis\-guided recovery\. By profiling task\-family failure modes to restrict admissible interventions and distilling a cost\-aware policy, DARC improves success across ALFWorld, AppWorld, and XBRL Finance while mitigating the overhead and interference of generic playbooks\. Future work includes extending our static diagnosis to dynamic, instance\-level routing for mixed\-mode failures, developing more sample\-efficient policy distillation methods, and expanding full\-library cascade comparisons to broader domains\.

## References

- \[1\]R\. Agarwal, A\. Singh, L\. Zhang, B\. Bohnet, L\. Rosias, S\. Chan, B\. Zhang, A\. Anand, Z\. Abbas, A\. Nova,et al\.\(2024\)Many\-shot in\-context learning\.Advances in Neural Information Processing Systems37,pp\. 76930–76966\.Cited by:[§5\.1](https://arxiv.org/html/2608.11772#S5.SS1.p2.1)\.
- \[2\]P\. Aggarwal, A\. Madaan, A\. Anand, S\. P\. Potharaju, S\. Mishra, P\. Zhou, A\. Gupta, D\. Rajagopal, K\. Kappaganthu, Y\. Yang, S\. Upadhyay, M\. Faruqui, and Mausam\(2023\)AutoMix: automatically mixing language models\.arXiv preprint arXiv:2310\.12963\.Cited by:[Appendix B](https://arxiv.org/html/2608.11772#A2.p1.1),[§2](https://arxiv.org/html/2608.11772#S2.p5.1)\.
- \[3\]L\. A\. Agrawal, S\. Tan, D\. Soylu, N\. Ziems, R\. Khare, K\. Opsahl\-Ong, A\. Singhvi, H\. Shandilya, M\. J\. Ryan, M\. Jiang,et al\.\(2025\)Gepa: reflective prompt evolution can outperform reinforcement learning\.arXiv preprint arXiv:2507\.19457\.Cited by:[§5\.1](https://arxiv.org/html/2608.11772#S5.SS1.p2.1)\.
- \[4\]\(2024\)Back to basics: revisiting reinforce\-style optimization for learning from human feedback in llms\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 12248–12267\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[5\]A\. Asai, Z\. Wu, Y\. Wang, A\. Sil, and H\. Hajishirzi\(2024\)Self\-RAG: learning to retrieve, generate, and critique through self\-reflection\.InInternational Conference on Learning Representations,Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p5.1)\.
- \[6\]J\. Austin, A\. Odena, M\. Nye, M\. Bosma, H\. Michalewski, D\. Dohan, E\. Jiang, C\. Cai, M\. Terry, Q\. Le, and C\. Sutton\(2021\)Program synthesis with large language models\.InarXiv preprint arXiv:2108\.07732,Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[7\]H\. Bai, Y\. Zhou, M\. Cemri, J\. Pan, A\. Suhr, S\. Levine, and A\. Kumar\(2024\)Digirl: training in\-the\-wild device\-control agents with autonomous reinforcement learning\.Advances in Neural Information Processing Systems37,pp\. 12461–12495\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[8\]Y\. Bai, S\. Kadavath, S\. Kundu, A\. Askell, J\. Kernion, A\. Jones, A\. Chen, A\. Goldie, A\. Mirhoseini, C\. McKinnon,et al\.\(2022\)Constitutional ai: harmlessness from ai feedback\.InarXiv preprint arXiv:2212\.08073,Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[9\]Y\. Bai, X\. Lv, J\. Zhang, H\. Lyu, J\. Tang, Z\. Huang, Z\. Du, X\. Liu, A\. Zeng, L\. Hou,et al\.\(2024\)Longbench: a bilingual, multitask benchmark for long context understanding\.InProceedings of the 62nd annual meeting of the association for computational linguistics \(volume 1: Long papers\),pp\. 3119–3137\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p4.1)\.
- \[10\]B\. Chen, F\. Zhang, A\. Nguyen, D\. Zan, Z\. Lin, J\. Lou, and W\. Chen\(2022\)CodeT: code generation with generated tests\.arXiv preprint arXiv:2207\.10397\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[11\]L\. Chen, M\. Zaharia, and J\. Zou\(2023\)FrugalGPT: how to use large language models while reducing cost and improving performance\.arXiv preprint arXiv:2305\.05176\.Cited by:[Appendix B](https://arxiv.org/html/2608.11772#A2.p1.1),[§2](https://arxiv.org/html/2608.11772#S2.p5.1)\.
- \[12\]M\. Chen, J\. Tworek, H\. Jun, Q\. Yuan, H\. P\. d\. O\. Pinto, J\. Kaplan, H\. Edwards, Y\. Burda, N\. Joseph, G\. Brockman,et al\.\(2021\)Evaluating large language models trained on code\.InarXiv preprint arXiv:2107\.03374,Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[13\]X\. Chen, M\. Lin, N\. Schärli, and D\. Zhou\(2024\)Teaching large language models to self\-debug\.InInternational Conference on Learning Representations,Cited by:[§1](https://arxiv.org/html/2608.11772#S1.p1.1),[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[14\]K\. Cobbe, V\. Kosaraju, M\. Bavarian, M\. Chen, H\. Jun, L\. Kaiser, M\. Plappert, J\. Tworek, J\. Hilton, R\. Nakano,et al\.\(2021\)Training verifiers to solve math word problems\.InarXiv preprint arXiv:2110\.14168,Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[15\]A\. Fourney, G\. Bansal, H\. Mozannar, C\. Tan, E\. Salinas, F\. Niedtner, G\. Proebsting, G\. Bassman, J\. Gerrits, J\. Alber,et al\.\(2024\)Magentic\-one: a generalist multi\-agent system for solving complex tasks\.arXiv preprint arXiv:2411\.04468\.Cited by:[Appendix B](https://arxiv.org/html/2608.11772#A2.p2.1)\.
- \[16\]L\. Gao, X\. Ma, J\. Lin, and J\. Callan\(2023\)Precise zero\-shot dense retrieval without relevance labels\.InProceedings of the 61st Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 1762–1777\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p5.1)\.
- \[17\]K\. Guu, K\. Lee, Z\. Tung, P\. Pasupat, and M\. Chang\(2020\)REALM: retrieval\-augmented language model pre\-training\.InInternational Conference on Machine Learning,pp\. 3929–3938\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p5.1)\.
- \[18\]D\. Hendrycks, C\. Burns, S\. Basart, A\. Zou, M\. Mazeika, D\. Song, and J\. Steinhardt\(2021\)Measuring massive multitask language understanding\.InInternational Conference on Learning Representations,Cited by:[Appendix B](https://arxiv.org/html/2608.11772#A2.p2.1)\.
- \[19\]S\. Hong, X\. Zheng, J\. Chen, Y\. Cheng, J\. Wang, C\. Zhang, Z\. Wang, S\. K\. S\. Yau, Z\. Lin, L\. Zhou,et al\.\(2024\)MetaGPT: meta programming for a multi\-agent collaborative framework\.International Conference on Learning Representations\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[20\]C\. Hsieh, S\. Sun, S\. Kriman, S\. Acharya, D\. Rekesh, F\. Jia, and B\. Ginsburg\(2024\)RULER: what’s the real context size of your long\-context language models?\.arXiv preprint arXiv:2404\.06654\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p4.1)\.
- \[21\]Y\. Hu, Z\. Wen, X\. Liu, P\. Wang, X\. Zhang, and W\. Wu\(2026\)SEAL: synergistic co\-evolution of agents and learning environments\.arXiv preprint arXiv:2605\.24426\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[22\]G\. Izacard and E\. Grave\(2021\)Leveraging passage retrieval with generative models for open domain question answering\.InProceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics,pp\. 874–880\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p5.1)\.
- \[23\]G\. Izacard, P\. Lewis, M\. Lomeli, L\. Hosseini, F\. Petroni, T\. Schick, J\. Dwivedi\-Yu, A\. Joulin, S\. Riedel, and E\. Grave\(2022\)Few\-shot learning with retrieval augmented language models\.arXiv preprint arXiv:2208\.032991\(2\),pp\. 4\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p5.1)\.
- \[24\]S\. Jeong, J\. Baek, S\. Cho, S\. J\. Hwang, and J\. C\. Park\(2024\)Adaptive\-rag: learning to adapt retrieval\-augmented large language models through question complexity\.InProceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies \(Volume 1: Long Papers\),pp\. 7036–7050\.Cited by:[Appendix B](https://arxiv.org/html/2608.11772#A2.p1.1),[§2](https://arxiv.org/html/2608.11772#S2.p5.1)\.
- \[25\]C\. E\. Jimenez, J\. Yang, A\. Wettig, S\. Yao, K\. Pei, O\. Press, and K\. Narasimhan\(2024\)SWE\-bench: can language models resolve real\-world github issues?\.International Conference on Learning Representations\.Cited by:[§1](https://arxiv.org/html/2608.11772#S1.p1.1),[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[26\]E\. Karpas, O\. Abend, Y\. Belinkov, B\. Lenz, O\. Lieber, N\. Ratner, Y\. Shoham, H\. Bata, Y\. Levine, K\. Leyton\-Brown,et al\.\(2022\)MRKL systems: a modular, neuro\-symbolic architecture that combines large language models, external knowledge sources and discrete reasoning\.InarXiv preprint arXiv:2205\.00445,Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[27\]V\. Karpukhin, B\. Oguz, S\. Min, P\. Lewis, L\. Wu, S\. Edunov, D\. Chen, and W\. Yih\(2020\)Dense passage retrieval for open\-domain question answering\.InProceedings of the 2020 Conference on Empirical Methods in Natural Language Processing,pp\. 6769–6781\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p5.1)\.
- \[28\]O\. Khattab, A\. Singhvi, P\. Maheshwari, Z\. Zhang, K\. Santhanam, S\. Vardhamanan, S\. Haq, A\. Sharma, T\. T\. Joshi, H\. Moazam,et al\.\(2023\)Dspy: compiling declarative language model calls into self\-improving pipelines\.arXiv preprint arXiv:2310\.03714\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1),[§5\.1](https://arxiv.org/html/2608.11772#S5.SS1.p2.1)\.
- \[29\]T\. Khot, H\. Trivedi, M\. Finlayson, Y\. Fu, K\. Richardson, P\. Clark, and A\. Sabharwal\(2023\)Decomposed prompting: a modular approach for solving complex tasks\.International Conference on Learning Representations\.Cited by:[Appendix B](https://arxiv.org/html/2608.11772#A2.p2.1)\.
- \[30\]G\. Kim, P\. Baldi, and S\. McAleer\(2023\)Language models can solve computer tasks\.Advances in Neural Information Processing Systems36,pp\. 39648–39677\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[31\]T\. Kojima, S\. S\. Gu, M\. Reid, Y\. Matsuo, and Y\. Iwasawa\(2022\)Large language models are zero\-shot reasoners\.InAdvances in Neural Information Processing Systems,Vol\.35,pp\. 22199–22213\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[32\]H\. Lee, S\. M\. X\. Phatale, H\. Mansoor, T\. Mesnard, J\. Ferret, K\. Lu, C\. Bishop, E\. Hall, V\. Carbune, A\. Rastogi, and S\. Prakash\(2023\)RLAIF: scaling reinforcement learning from human feedback with ai feedback\.InarXiv preprint arXiv:2309\.00267,Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[33\]P\. Lewis, E\. Perez, A\. Piktus, F\. Petroni, V\. Karpukhin, N\. Goyal, H\. Küttler, M\. Lewis, W\. Yih, T\. Rocktäschel,et al\.\(2020\)Retrieval\-augmented generation for knowledge\-intensive nlp tasks\.Advances in neural information processing systems33,pp\. 9459–9474\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p5.1)\.
- \[34\]G\. Li, H\. A\. A\. K\. Hammoud, H\. Itani, D\. Khizbullin, and B\. Ghanem\(2023\)CAMEL: communicative agents for mind exploration of large language model society\.Advances in Neural Information Processing Systems36,pp\. 51991–52008\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[35\]J\. Li, M\. Wang, Z\. Zheng, and M\. Zhang\(2024\)LooGLE: can long\-context language models understand long contexts?\.arXiv preprint arXiv:2311\.04939\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p4.1)\.
- \[36\]M\. Li, F\. Song, B\. Yu, H\. Yu, Z\. Li, F\. Huang, and Y\. Li\(2023\)API\-bank: a comprehensive benchmark for tool\-augmented llms\.arXiv preprint arXiv:2304\.08244\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[37\]Z\. Li, H\. Wang, Y\. Zhao, G\. Chen, Y\. Li, K\. Chen, Y\. Cao, G\. Ye, H\. Chai, and Z\. Yin\(2026\)Rethinking the role of entropy in optimizing tool\-use behaviors for large language model agents\.InProceedings of the 64th Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 27955–27967\.Cited by:[§1](https://arxiv.org/html/2608.11772#S1.p1.1)\.
- \[38\]Z\. Li, T\. Xu, Y\. Zhang, Z\. Lin, Y\. Yu, R\. Sun, and Z\. Luo\(2023\)Remax: a simple, effective, and efficient reinforcement learning method for aligning large language models\.arXiv preprint arXiv:2310\.10505\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[39\]P\. Liang, R\. Bommasani, T\. Lee, D\. Tsipras, D\. Soylu, M\. Yasunaga, Y\. Zhang, D\. Narayanan, Y\. Wu, A\. Kumar,et al\.\(2023\)Holistic evaluation of language models\.InTransactions on Machine Learning Research,Cited by:[Appendix B](https://arxiv.org/html/2608.11772#A2.p2.1)\.
- \[40\]H\. Lightman, V\. Kosaraju, Y\. Burda, H\. Edwards, B\. Baker, T\. Lee, J\. Leike, J\. Schulman, I\. Sutskever, and K\. Cobbe\(2024\)Let’s verify step by step\.InInternational Conference on Learning Representations,Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[41\]Z\. Lin, Z\. Wang, Y\. Tong, Y\. Wang, Y\. Guo, Y\. Wang, and J\. Shang\(2023\)ToxicChat: unveiling hidden challenges of toxicity detection in real\-world user\-ai conversation\.InFindings of the Association for Computational Linguistics: EMNLP 2023,Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p4.1)\.
- \[42\]N\. F\. Liu, K\. Lin, J\. Hewitt, A\. Paranjape, M\. Bevilacqua, F\. Petroni, and P\. Liang\(2024\)Lost in the middle: how language models use long contexts\.Transactions of the Association for Computational Linguistics12,pp\. 157–173\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p4.1)\.
- \[43\]X\. Liu, H\. Yu, H\. Zhang, Y\. Xu, X\. Lei, H\. Lai, Y\. Gu, H\. Ding, K\. Men, K\. Yang,et al\.\(2024\)Agentbench: evaluating llms as agents\.InInternational Conference on Learning Representations,Vol\.2024,pp\. 52989–53046\.Cited by:[Appendix B](https://arxiv.org/html/2608.11772#A2.p2.1)\.
- \[44\]Z\. Liu, W\. Yao, J\. Zhang, L\. Yang, Z\. Liu, J\. Tan, P\. K\. Choubey, T\. Lan, J\. Wu, H\. Wang,et al\.\(2024\)Agentlite: a lightweight library for building and advancing task\-oriented llm agent system\.arXiv preprint arXiv:2402\.15538\.Cited by:[Appendix B](https://arxiv.org/html/2608.11772#A2.p2.1)\.
- \[45\]L\. Loukas, M\. Fergadiotis, I\. Chalkidis, E\. Spyropoulou, P\. Malakasiotis, I\. Androutsopoulos, and G\. Paliouras\(2022\)FiNER: financial numeric entity recognition for xbrl tagging\.InProceedings of the 60th Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 4419–4431\.Cited by:[§5\.1](https://arxiv.org/html/2608.11772#S5.SS1.p1.1)\.
- \[46\]A\. Madaan, N\. Tandon, P\. Gupta, S\. Hallinan, L\. Gao, S\. Wiegreffe, U\. Alon, N\. Dziri, S\. Prabhumoye, Y\. Yang,et al\.\(2023\)Self\-refine: iterative refinement with self\-feedback\.InAdvances in Neural Information Processing Systems,Vol\.36,pp\. 46534–46594\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[47\]A\. Ni, S\. Iyer, D\. Radev, V\. Stoyanov, W\. Yih, S\. Wang, and X\. V\. Lin\(2023\)Lever: learning to verify language\-to\-code generation with execution\.InInternational Conference on Machine Learning,pp\. 26106–26128\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[48\]K\. Opsahl\-Ong, M\. J\. Ryan, J\. Purtell, D\. Broman, C\. Potts, M\. Zaharia, and O\. Khattab\(2024\)Optimizing instructions and demonstrations for multi\-stage language model programs\.InProceedings of the 2024 Conference on Empirical Methods in Natural Language Processing,pp\. 9340–9366\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1),[§5\.1](https://arxiv.org/html/2608.11772#S5.SS1.p2.1)\.
- \[49\]L\. Ouyang, J\. Wu, X\. Jiang, D\. Almeida, C\. Wainwright, P\. Mishkin, C\. Zhang, S\. Agarwal, K\. Slama, A\. Ray,et al\.\(2022\)Training language models to follow instructions with human feedback\.InAdvances in Neural Information Processing Systems,Vol\.35,pp\. 27730–27744\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[50\]L\. Pan, Y\. Tong, X\. Zhang, X\. Zhang, J\. Zhou, and Z\. Chu\(2025\)Understanding and mitigating overrefusal in llms from an unveiling perspective of safety decision boundary\.InProceedings of the 2025 Conference on Empirical Methods in Natural Language Processing,pp\. 21057–21075\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p4.1)\.
- \[51\]L\. Pan, H\. Yang, H\. Li, Y\. Lu, Y\. Tong, Y\. Wang, S\. Wang, Z\. Chu, L\. Shen, Y\. Lu, and H\. Wang\(2026\)Optimal transport for llm reward modeling from noisy preference\.arXiv preprint arXiv:2605\.06036\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[52\]B\. Paranjape, S\. Lundberg, S\. Singh, H\. Hajishirzi, L\. Zettlemoyer, and M\. T\. Ribeiro\(2023\)ART: automatic multi\-step reasoning and tool\-use for large language models\.InarXiv preprint arXiv:2303\.09014,Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[53\]J\. S\. Park, J\. C\. O’Brien, C\. J\. Cai, M\. R\. Morris, P\. Liang, and M\. S\. Bernstein\(2023\)Generative agents: interactive simulacra of human behavior\.arXiv preprint arXiv:2304\.03442\.Cited by:[Appendix B](https://arxiv.org/html/2608.11772#A2.p2.1)\.
- \[54\]S\. G\. Patil, T\. Zhang, X\. Wang, and J\. E\. Gonzalez\(2024\)Gorilla: large language model connected with massive apis\.Advances in Neural Information Processing Systems37,pp\. 126544–126565\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[55\]Z\. Qi, X\. Liu, I\. L\. Iong, H\. Lai, X\. Sun, J\. Sun, X\. Yang, Y\. Yang, S\. Yao, W\. Xu,et al\.\(2025\)Webrl: training llm web agents via self\-evolving online curriculum reinforcement learning\.InInternational Conference on Learning Representations,Vol\.2025,pp\. 79791–79821\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[56\]Y\. Qin, S\. Liang, Y\. Ye, K\. Zhu, L\. Yan, Y\. Lu, Y\. Lin, X\. Cong, X\. Tang, B\. Qian,et al\.\(2023\)Toolllm: facilitating large language models to master 16000\+ real\-world apis\.InThe twelfth international conference on learning representations,Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[57\]Qwen Team\(2026\)Qwen3\.5: towards native multimodal agents\.External Links:[Link](https://qwen.ai/blog?id=qwen3.5)Cited by:[§5\.2](https://arxiv.org/html/2608.11772#S5.SS2.p1.1)\.
- \[58\]Qwen Team\(2026\)Qwen3\.6\-27B: flagship\-level coding in a 27B dense model\.External Links:[Link](https://qwen.ai/blog?id=qwen3.6-27b)Cited by:[§5\.2](https://arxiv.org/html/2608.11772#S5.SS2.p1.1)\.
- \[59\]R\. Rafailov, A\. Sharma, E\. Mitchell, C\. D\. Manning, S\. Ermon, and C\. Finn\(2023\)Direct preference optimization: your language model is secretly a reward model\.Advances in neural information processing systems36,pp\. 53728–53741\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[60\]T\. Schick, J\. Dwivedi\-Yu, R\. Dessì, R\. Raileanu, M\. Lomeli, E\. Hambro, L\. Zettlemoyer, N\. Cancedda, and T\. Scialom\(2023\)Toolformer: language models can teach themselves to use tools\.Advances in neural information processing systems36,pp\. 68539–68551\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[61\]Z\. Shao, P\. Wang, Q\. Zhu, R\. Xu, J\. Song, X\. Bi, H\. Zhang, M\. Zhang, Y\. Li, Y\. Wu,et al\.\(2024\)Deepseekmath: pushing the limits of mathematical reasoning in open language models\.arXiv preprint arXiv:2402\.03300\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[62\]Y\. Shen, K\. Song, X\. Tan, D\. Li, W\. Lu, and Y\. Zhuang\(2023\)HuggingGPT: solving ai tasks with chatgpt and its friends in hugging face\.Advances in Neural Information Processing Systems36,pp\. 38154–38180\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[63\]F\. Shi, X\. Chen, K\. Misra, N\. Scales, D\. Dohan, E\. H\. Chi, N\. Schärli, and D\. Zhou\(2023\)Large language models can be easily distracted by irrelevant context\.InProceedings of the 40th International Conference on Machine Learning,pp\. 31210–31227\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p4.1)\.
- \[64\]N\. Shinn, F\. Cassano, A\. Gopinath, K\. Narasimhan, and S\. Yao\(2023\)Reflexion: language agents with verbal reinforcement learning\.Advances in neural information processing systems36,pp\. 8634–8652\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[65\]M\. Shridhar, X\. Yuan, M\. Côté, Y\. Bisk, A\. Trischler, and M\. Hausknecht\(2020\)Alfworld: aligning text and embodied environments for interactive learning\.arXiv preprint arXiv:2010\.03768\.Cited by:[§5\.1](https://arxiv.org/html/2608.11772#S5.SS1.p1.1)\.
- \[66\]A\. Srivastava, A\. Rastogi, A\. Rao, A\. A\. M\. Shoeb, A\. Abid, A\. Fisch, A\. Brown, A\. Santoro, A\. Gupta, A\. Garriga\-Alonso,et al\.\(2023\)Beyond the imitation game: quantifying and extrapolating the capabilities of language models\.Transactions on Machine Learning Research\.Cited by:[Appendix B](https://arxiv.org/html/2608.11772#A2.p2.1)\.
- \[67\]T\. R\. Sumers, S\. Yao, K\. Narasimhan, and T\. L\. Griffiths\(2023\)Cognitive architectures for language agents\.arXiv preprint arXiv:2309\.02427\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[68\]M\. Suzgun, N\. Scales, N\. Schärli, S\. Gehrmann, Y\. Tay, H\. W\. Chung, A\. Chowdhery, Q\. V\. Le, E\. H\. Chi, D\. Zhou,et al\.\(2023\)Challenging big\-bench tasks and whether chain\-of\-thought can solve them\.InFindings of the Association for Computational Linguistics: ACL 2023,pp\. 13003–13051\.Cited by:[Appendix B](https://arxiv.org/html/2608.11772#A2.p2.1)\.
- \[69\]Z\. R\. Tam, C\. Wu, Y\. Tsai, C\. Lin, H\. Lee, and Y\. Chen\(2024\)Let me speak freely? a study on the impact of format restrictions on performance of large language models\.arXiv preprint arXiv:2408\.02442\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p4.1)\.
- \[70\]Y\. Tong, D\. Li, S\. Wang, Y\. Wang, F\. Teng, and J\. Shang\(2024\)Can llms learn from previous mistakes? investigating llms’ errors to boost for reasoning\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 3065–3080\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[71\]Y\. Tong, S\. Wang, D\. Li, Y\. Wang, S\. Han, Z\. Lin, C\. Huang, J\. Huang, and J\. Shang\(2024\)Optimizing language model’s reasoning abilities with weak supervision\.arXiv preprint arXiv:2405\.04086\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[72\]Y\. Tong, Y\. Wang, D\. Li, S\. Wang, Z\. Lin, S\. Han, and J\. Shang\(2023\)Eliminating reasoning via inferring with planning: a new framework to guide llms’ non\-linear thinking\.arXiv preprint arXiv:2310\.12342\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[73\]H\. Trivedi, T\. Khot, M\. Hartmann, R\. Manku, V\. Dong, E\. Li, S\. Gupta, A\. Sabharwal, and N\. Balasubramanian\(2024\)Appworld: a controllable world of apps and people for benchmarking interactive coding agents\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 16022–16076\.Cited by:[§5\.1](https://arxiv.org/html/2608.11772#S5.SS1.p1.1)\.
- \[74\]D\. Wang, J\. Patel, D\. Zha, S\. Y\. Yang, and X\. Liu\(2025\)Finlora: benchmarking lora methods for fine\-tuning llms on financial datasets\.arXiv preprint arXiv:2505\.19819\.Cited by:[§5\.1](https://arxiv.org/html/2608.11772#S5.SS1.p1.1)\.
- \[75\]G\. Wang, Y\. Xie, Y\. Jiang, A\. Mandlekar, C\. Xiao, Y\. Zhu, L\. Fan, and A\. Anandkumar\(2023\)Voyager: an open\-ended embodied agent with large language models\.arXiv preprint arXiv:2305\.16291\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[76\]P\. Wang, Y\. Hu, X\. Liu, J\. Yang, H\. Wang, and Z\. Wen\(2026\)AtlasVA: self\-evolving visual skill memory for teacher\-free vlm agents\.arXiv preprint arXiv:2605\.17933\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[77\]P\. Wang\(2026\)REFLEX: reflective evolution from LLM experience\.InICML 2026 AI for Science Workshop,External Links:[Link](https://openreview.net/forum?id=xftknNrW7n)Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[78\]R\. Wang, H\. Li, X\. Han, Y\. Zhang, and T\. Baldwin\(2024\)Learning from failure: integrating negative examples when fine\-tuning large language models as agents\.arXiv preprint arXiv:2402\.11651\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[79\]S\. Wang, Y\. Tong, H\. Zhang, D\. Li, X\. Zhang, and T\. Chen\(2025\)BPO: towards balanced preference optimization between knowledge breadth and depth in alignment\.InProceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies \(Volume 1: Long Papers\),pp\. 8811–8826\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[80\]X\. Wang, B\. Li, Y\. Song, F\. F\. Xu, X\. Tang, M\. Zhuge, J\. Pan, Y\. Song, B\. Li, J\. Singh,et al\.\(2024\)OpenDevin: an open platform for ai software developers as generalist agents\.arXiv preprint arXiv:2407\.16741\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[81\]X\. Wang, J\. Wei, D\. Schuurmans, Q\. Le, E\. Chi, S\. Narang, A\. Chowdhery, and D\. Zhou\(2022\)Self\-consistency improves chain of thought reasoning in language models\.arXiv preprint arXiv:2203\.11171\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[82\]J\. Wei, X\. Wang, D\. Schuurmans, M\. Bosma, F\. Xia, E\. Chi, Q\. V\. Le, and D\. Zhou\(2022\)Chain\-of\-thought prompting elicits reasoning in large language models\.InAdvances in Neural Information Processing Systems,Vol\.35,pp\. 24824–24837\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[83\]S\. Welleck, X\. Lu, P\. West, F\. Brahman, T\. Shen, D\. Khashabi, and Y\. Choi\(2023\)Generating sequences by learning to self\-correct\.InThe Eleventh International Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=hH36JeQZDaO)Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[84\]Q\. Wu, G\. Bansal, J\. Zhang, Y\. Wu, B\. Li, E\. Zhu, L\. Jiang, X\. Zhang, S\. Zhang, J\. Liu,et al\.\(2024\)Autogen: enabling next\-gen llm applications via multi\-agent conversations\.InFirst conference on language modeling,Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[85\]C\. S\. Xia, Y\. Deng, S\. Dunn, and L\. Zhang\(2024\)Agentless: demystifying llm\-based software engineering agents\.arXiv preprint arXiv:2407\.01489\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[86\]Z\. Xu, Y\. Tong, X\. Zhang, J\. Zhou, and X\. Wang\(2026\)Understanding conflicts in multi\-objective alignment through reward consistency\.InFindings of the Association for Computational Linguistics: ACL 2026,pp\. 5450–5472\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.
- \[87\]S\. Yan, J\. Gu, Y\. Zhu, and Z\. Ling\(2024\)Corrective retrieval augmented generation\.arXiv preprint arXiv:2401\.15884\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p5.1)\.
- \[88\]J\. Yang, C\. E\. Jimenez, A\. Wettig, K\. Lieret, S\. Yao, K\. Narasimhan, and O\. Press\(2024\)SWE\-agent: agent\-computer interfaces enable automated software engineering\.InAdvances in Neural Information Processing Systems,Vol\.37\.Cited by:[§1](https://arxiv.org/html/2608.11772#S1.p1.1),[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[89\]M\. Yang, E\. Huang, L\. Zhang, M\. Surdeanu, W\. Y\. Wang, and L\. Pan\(2025\)How is llm reasoning distracted by irrelevant context? an analysis using a controlled benchmark\.InProceedings of the 2025 Conference on Empirical Methods in Natural Language Processing,pp\. 13340–13358\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p4.1)\.
- \[90\]S\. Yao, N\. Shinn, P\. Razavi, and K\. Narasimhan\(2024\)τ\\tau\-bench: : a benchmark for tool\-agent\-user interaction in real\-world domains\.arXiv preprint arXiv:2406\.12045\.Cited by:[Appendix B](https://arxiv.org/html/2608.11772#A2.p2.1)\.
- \[91\]S\. Yao, D\. Yu, J\. Zhao, I\. Shafran, T\. L\. Griffiths, Y\. Cao, and K\. Narasimhan\(2023\)Tree of thoughts: deliberate problem solving with large language models\.InAdvances in Neural Information Processing Systems,Vol\.36,pp\. 11809–11822\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[92\]S\. Yao, J\. Zhao, D\. Yu, N\. Du, I\. Shafran, K\. Narasimhan, and Y\. Cao\(2022\)React: synergizing reasoning and acting in language models\.arXiv preprint arXiv:2210\.03629\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[93\]E\. Zelikman, Y\. Wu, J\. Mu, and N\. D\. Goodman\(2022\)STaR: bootstrapping reasoning with reasoning\.InAdvances in Neural Information Processing Systems,Vol\.35,pp\. 15476–15488\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[94\]Q\. Zhang, C\. Hu, S\. Upasani, B\. Ma, F\. Hong, V\. Kamanuru, J\. Rainton, C\. Wu, M\. Ji, H\. Li, U\. Thakker, J\. Zou, and K\. Olukotun\(2026\)Agentic context engineering: evolving contexts for self\-improving language models\.InThe Fourteenth International Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=eC4ygDs02R)Cited by:[§5\.1](https://arxiv.org/html/2608.11772#S5.SS1.p2.1)\.
- \[95\]L\. Zhong, Z\. Wang, and J\. Shang\(2024\)Debug like a human: a large language model debugger via verifying runtime execution step\-by\-step\.InFindings of the Association for Computational Linguistics: ACL 2024,pp\. 851–870\.Cited by:[§1](https://arxiv.org/html/2608.11772#S1.p1.1),[§2](https://arxiv.org/html/2608.11772#S2.p1.1)\.
- \[96\]D\. Zhou, N\. Schärli, L\. Hou, J\. Wei, N\. Scales, X\. Wang, D\. Schuurmans, O\. Bousquet, Q\. Le, and E\. Chi\(2023\)Least\-to\-most prompting enables complex reasoning in large language models\.InInternational Conference on Learning Representations,Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p2.1)\.
- \[97\]Y\. Zhou, A\. Zanette, J\. Pan, S\. Levine, and A\. Kumar\(2024\)Archer: training language model agents via hierarchical multi\-turn rl\.arXiv preprint arXiv:2402\.19446\.Cited by:[§2](https://arxiv.org/html/2608.11772#S2.p3.1)\.

## Appendix ATheoretical Proofs

### A\.1Proof of Monotone Submodularity

For an intervention subsetAA, a task is covered if at least one intervention inAAsucceeds on it\. Thusf\(A\)=1n∑i𝟏\[∃r∈A:s\(xi,r\)=1\]f\(A\)=\\frac\{1\}\{n\}\\sum\_\{i\}\\mathbf\{1\}\[\\exists r\\in A:s\(x\_\{i\},r\)=1\]is a standard coverage function\. Coverage functions are monotone because adding an intervention cannot remove a covered task, and submodular because the marginal gain of adding an intervention decreases as the covered set grows\.

### A\.2Uniform\-Convergence Bound for a Fixed Chain Class

LetΣK\\Sigma\_\{K\}be a finite class of duplicate\-free chains of length at mostKK, and suppose per\-task cost is bounded byCmaxC\_\{\\max\}\. For a fixed chainSS, Hoeffding’s inequality bounds the deviation of both empirical success and empirical cost\. Applying a union bound overΣK\\Sigma\_\{K\}yields a uniform deviation term of orderO⁡\(log⁡\|ΣK\|/n\)O\(\\sqrt\{\\log\|\\Sigma\_\{K\}\|/n\}\)for the penalized objective\. The empirical maximizer is therefore near the best chain in the fixed class up to twice this deviation\. This bound does not replace empirical validation; it only explains why reducing\|ΣK\|\|\\Sigma\_\{K\}\|can reduce finite\-sample search risk\.

## Appendix BExtended Related Work

Cascades and adaptive computation\.DARC is structurally related to LLM cascades and adaptive computation\. FrugalGPT\[[11](https://arxiv.org/html/2608.11772#bib.bib17)\]and AutoMix\[[2](https://arxiv.org/html/2608.11772#bib.bib18)\]route among language models to reduce cost, while Adaptive\-RAG\[[24](https://arxiv.org/html/2608.11772#bib.bib11)\]adjusts retrieval complexity\. DARC instead routes among recovery interventions inside an agent harness\. The base model is fixed; what changes is whether the agent receives an action guard, procedural source, retrieval evidence, or another admissible recovery operation\.

Broader evaluation context\.The benchmarks in this paper sit within a broader evaluation ecosystem for language\-model capability, instruction following, tool use, and interactive autonomy\[[18](https://arxiv.org/html/2608.11772#bib.bib86),[66](https://arxiv.org/html/2608.11772#bib.bib87),[68](https://arxiv.org/html/2608.11772#bib.bib88),[39](https://arxiv.org/html/2608.11772#bib.bib89),[43](https://arxiv.org/html/2608.11772#bib.bib7),[90](https://arxiv.org/html/2608.11772#bib.bib8)\]\. This ecosystem increasingly shifts from single\-turn answer quality toward process observability: intermediate reasoning, external tool calls, state changes, and verifiable task completion\[[29](https://arxiv.org/html/2608.11772#bib.bib95),[53](https://arxiv.org/html/2608.11772#bib.bib92),[44](https://arxiv.org/html/2608.11772#bib.bib94),[15](https://arxiv.org/html/2608.11772#bib.bib93)\]\. DARC follows this shift but focuses on what to do after failure: it treats failures as signals for selecting recovery interventions rather than as final outcomes alone\.

## Appendix CRecovery\-Harness Mapping

Table[11](https://arxiv.org/html/2608.11772#A3.T11)summarizes the evaluated task\-family mappings\. The mapping is frozen before test evaluation and should be interpreted as the recovery\-harness instantiation used in this paper, not as a learned universal diagnostic router\.

Table 11:Frozen task\-family to recovery\-harness mapping\. The diagnostic signal is measured on development tasks; the admissible intervention set is then fixed for test\-time policy distillation and deployment\.Task FamilyDevelopment\-Set SignalFailure ModeAdmissible Intervention SetALFWorldInvalid / state\-incompatible actionsAction validityAction pruning and admissibility guardsAppWorldMissing API workflow / multi\-step procedure failuresProcedure breadthAuto\-Knowledge, local induction, retrieval fallbackFinanceExact formula/tag format errorsFormat precisionRetrieval few\-shot demonstrations and budget selection

## Appendix DRepresentative Diagnosis Records

Table[12](https://arxiv.org/html/2608.11772#A4.T12)makes the diagnosis interface concrete\. The diagnostic LLM receives only development\-set trajectory summaries and verifier\-visible failure signals, then maps the dominant recurring pattern to one label from the fixed failure\-mode vocabulary\. These task\-family diagnoses and their associated intervention sets are frozen before test evaluation\.

Table 12:Representative development\-trace diagnosis examples\. The trace summaries compress recurring observable failures; no test labels or hidden benchmark state are supplied to the diagnostic LLM\.BenchmarkObserved Failure TraceLLM DiagnosisALFWorldThe agent repeatedly issues actions that are unavailable in the current environment state, making no state progress across consecutive steps\.Action validityAppWorldAPI calls omit a required upstream dependency, such as resolving an entity or resource identifier before invoking the downstream cross\-application operation\.Procedure breadthFinanceThe retrieved evidence supports the correct formula or tag, but the response contains prose, extra fields, or a malformed schema that fails exact\-match evaluation\.Format precision
## Appendix EGenerated Recovery Trace Example

Figure[5](https://arxiv.org/html/2608.11772#A5.F5)illustrates the AppWorld procedural recovery harness\. The distilled policy first uses a lower\-cost procedural source and invokes richer context only when the earlier intervention fails, reducing unnecessary context calls while preserving recovery capacity\.

Figure 5:Example AppWorld recovery trace\. The distilled procedural policy invokes additional context only after a cheaper intervention fails\.
## Appendix FFactorial Decomposition of the ALFWorld Recovery Harness

Section[6\.2](https://arxiv.org/html/2608.11772#S6.SS2)shows that neither privileged information nor action\-space restriction alone explains the ALFWorld gain\. This appendix reports the underlying2×22\\times 2factorial experiment that separates the two components of the action\-validity harness: the*restricted action view*produced by the guard of Eq\.[8](https://arxiv.org/html/2608.11772#S6.E8), and the*recovery prompt*that instructs the agent how to act inside that view\.

Protocol\.All configurations run on the full ALFWorld valid\_unseen split \(134 tasks\) with DeepSeek\-V4\-Flash, the full set of admissible actions returned by the environment, a 50\-step budget, temperature 0, and the same evaluation script\. The two factors are toggled independently: the action view is either the full admissible set or the guard\-ranked top\-12, and the recovery prompt is either absent or present\. We report exact task counts so that paired tests can be reproduced from the released per\-task outcomes\. Success is reported as solved task count over 134\. Neither factor is effective in isolation; the gain appears only when the recovery prompt is paired with the restricted action view\.

Table 13:Factorial decomposition of the action\-validity harness on ALFWorld valid\_unseen\.Action viewRecovery promptSolvedSuccess↑\\uparrowFull admissible setAbsent53 / 13439\.55%Full admissible setPresent52 / 13438\.81%Guard\-ranked top\-12Absent58 / 13443\.28%Guard\-ranked top\-12Present119 / 13488\.81%

The effect is an interaction, not a sum of main effects\.Holding the action view at the full admissible set, adding the recovery prompt changes success by−0\.75\-0\.75pp \(53→5253\\rightarrow 52tasks\)\. Holding the recovery prompt absent, restricting the action view to the guard\-ranked top\-12 changes success by\+3\.73\+3\.73pp \(53→5853\\rightarrow 58tasks\)\. The two single\-factor effects therefore account for\+2\.98\+2\.98pp in total, whereas enabling both factors yields\+49\.26\+49\.26pp \(53→11953\\rightarrow 119tasks\)\. The difference\-in\-differences interaction term is

88\.81−43\.28−38\.81\+39\.55=\+46\.27​pp,88\.81\-43\.28\-38\.81\+39\.55=\+46\.27~\\text\{pp\},\(9\)so essentially the entire effect is attributable to the pairing rather than to either component\. This is the empirical form of the Intervention Mismatch argument in Section[1](https://arxiv.org/html/2608.11772#S1): a recovery signal is only useful when it lands on an interface that can execute it\.

Invalid actions explain the mechanism\.The three configurations for which we measured action\-level statistics show why the prompt is inert without the restricted view\. On the full admissible set, the recovery prompt*increases*invalid actions per episode from 1\.709 to 2\.507 \(Table[7](https://arxiv.org/html/2608.11772#S6.T7)\): the prompt tells the agent what the task requires, but many of the resulting commands are not executable in the current state, so the additional guidance is spent on rejected actions\. Under the guard\-ranked view the same guidance becomes executable and invalid actions fall to 0\.575\. The recovery prompt does not add knowledge the agent lacked; it becomes actionable only once the action interface is compatible with it\.

Auxiliary controls\.Two further controls bound the contribution of the guard itself\. First, forcing the top\-1 guard\-ranked command at every step*without any language model*in the loop reaches 40\.33%, statistically indistinguishable from the 39\.55% base agent\. The guard is therefore a high\-recall candidate filter rather than a hand\-written solver: its top\-1 ordering is usually not the correct action, but the correct action is retained within the top\-12 while distractors are removed\. Second, attaching the same ranked view and recovery prompt to a plain base agent, without the remaining harness components, reaches 82\.28%, so most of the effect is carried by the restriction\-prompt pairing and6\.536\.53pp remain attributable to the rest of the harness\.

Scope of this decomposition\.These are single\-run results at temperature 0 on one split and one backbone, so the small single\-factor effects \(−0\.75\-0\.75pp and\+3\.73\+3\.73pp, i\.e\. one and five tasks\) should be read as null rather than as measured directions\. The joint effect \(66 tasks\) is far outside this range\. We report the decomposition for ALFWorld only; the corresponding factorial for the AppWorld procedural harness and the Finance retrieval harness is not available, and whether the same superadditive structure holds for those failure modes remains an open question\.

## Appendix GBaseline Descriptions

We compare against two groups of methods:

- •Base LLM: The unaugmented model using a standard ReAct\-style execution loop without additional recovery\-harness construction\.
- •ICL: Standard prompting with a fixed set of demonstrations sampled or retrieved from the training set\.
- •MIPROv2: A DSPy prompt\-optimization method that jointly tunes instructions and demonstrations\.
- •GEPA: A reflective prompt\-evolution method that mutates prompts based on execution feedback\.
- •ACE: a broad recovery\-playbook baseline constructed from training\-set execution feedback\.

All applicable offline\-adaptation baselines use the same training split and adaptation budget as DARC\. We further include a stronger matched baseline that performs validation\-selected intervention\-chain search without diagnosis\-guided restriction \(the full\-library cascade in Table[14](https://arxiv.org/html/2608.11772#A8.T14)\); extending it from ALFWorld to the other task families remains future work\.

## Appendix HIsolating the Diagnosis Step

The generic and mismatched conditions in Section[6](https://arxiv.org/html/2608.11772#S6)vary the intervention set but do not run the same policy search as DARC\. We therefore add the strongest matched control: a*full\-library cascade*that performs the identical validation\-selected policy search as DARC\. This control shares the same base outputs, verifier, clean\-restart protocol, maximum chain lengthL=3L\{=\}3, cost penaltyλ=0\.02\\lambda\{=\}0\.02, and selection splits, but it omits the diagnosis step that first restricts the candidate library\. Table[14](https://arxiv.org/html/2608.11772#A8.T14)reports the result on ALFWorld\. Both cascades share the same base outputs, verifier, clean\-restart protocol, maximum chain lengthL=3L\{=\}3, and cost penaltyλ=0\.02\\lambda\{=\}0\.02, and are selected on valid\_seen and frozen for valid\_unseen; the only variable is whether diagnosis restricts the candidate recovery library before search\. The diagnosed row re\-selects a cascade \(type\_saturation→\\rightarrowloop\_fallback→\\rightarrowaction\_pruning\) over the four action\-validity harnesses, so its accuracy differs from the fixed single\-harness DARC reported in Table[3](https://arxiv.org/html/2608.11772#S5.T3)\. Removing diagnosis does not produce a significant accuracy gain: the full\-library cascade reaches 98\.51% test accuracy versus 99\.25% for the diagnosed cascade \(Δ=\+0\.75\\Delta\{=\}\{\+\}0\.75pp, 95% CI\[0\.00,2\.24\]\[0\.00,2\.24\]; not significant\)\. Diagnosis therefore does not trade accuracy for efficiency—it attains statistically indistinguishable accuracy while searching a10×10\\timessmaller policy space \(40 vs\. 400 candidate policies\) and selecting a markedly more stable policy \(14 vs\. 34 distinct chains under resampling\)\. This empirically supports the finite\-sample argument in Section[4\.3](https://arxiv.org/html/2608.11772#S4.SS3): restrictingℛm\\mathcal\{R\}\_\{m\}shrinks\|ΣK\|\|\\Sigma\_\{K\}\|and the associated search risk at no measured accuracy cost\.

Table 14:Isolating the diagnosis step on ALFWorld \(DeepSeek\-V4\-Flash\)\.MethodSearch spaceSelectionTestDistinct chainsDARC \(diagnosed\)4097\.14%99\.25%14Full\-library cascade40097\.86%98\.51%34

## Appendix IAutomatic Diagnosis Evaluation

To validate the reliability of the LLM\-based failure diagnosis used in DARC, we evaluate its agreement against a verifier\-backed reference on a sample of 72 development traces\. Table[15](https://arxiv.org/html/2608.11772#A9.T15)reports the agreement rate and Macro\-F1 score\. The LLM automatic diagnosis achieves 97\.22% agreement with the reference, demonstrating that the failure profiling step reliably identifies the correct dominant failure mode without requiring human labels\.

Table 15:Evaluation of the automatic failure diagnosis\.MethodHuman LabelsNAgreementMacro\-F1MajorityNo7233\.33%–Uniform RandomNo7233\.33%–LLM Automatic DiagnosisNo7297\.22%0\.972Verifier\-backed ReferenceNo72100\.00%1\.000

相似文章

DART: 结构化工具代理的语义可恢复性

arXiv cs.AI

DART 为结构化工具代理引入了语义可恢复性,形式化了一个标准,用于确定在做出下游承诺后,本地检查点恢复是否仍然有效。在三个基于LLM的领域进行的实验表明,它正确恢复了基线本地恢复失败的所有承诺敏感案例,且安全审计未发现不安全的回滚。