betaFeedback

WorksComputer Science

Don't Forget What You Just Learned: Self-Directed Repair Turns Agent Mistakes Into Lasting Lessons

Abstract

Intelligent agents should learn from their mistakes so that experience leads to continuous improvement. Yet today's agents recover from a mistake only temporarily: in-context reflections are easily forgotten across sessions and compete for limited context, while full-parameter fine-tuning is expensive and can interfere with existing capabilities. We introduce Self-Direction, a mechanism for agents to learn from mistakes that combines the benefits of temporary in-context retries and policy updates. When an agent fails a task, it reflects on its own trajectory in order to extract a lesson and immediately distills it into a lightweight low-rank adapter. By keeping the original weights frozen, Self-Direction prevents adapter training from overwriting base-model parameters while training additional parameters equivalent to ~0.02% of the base model's parameter count for each adapter. The agent then saves these adapters in a persistent library of lessons, automatically routing them to solve related problems later. Experiments with agents based on open-weight models from the Qwen family across open-ended research (GAIA), tool-use workflows (Claw-Eval), and terminal tasks (Terminal-Bench 2.1) show that our method improves overall success rates by 8.9 to 17.0 percentage points and performs competitively with frontier systems. We find that Self-Direction reduces repeated mistakes across future encounters of a task, nearly doubling the reliability of an agent's corrections. Learned lessons also transfer: a handful of adapters generalize to dozens of new tasks without additional training. Ultimately, this self-directed repair transforms everyday mistakes into lasting lessons.

Introduction

Modern agents can often correct their mistakes and complete the task at hand. Yet, this recovery is ephemeral: In a new session, the agent is just as likely to repeat the same mistake [10] (Rabanser et al. 2026). As agents tackle longer-horizon workflows, each additional step introduces another opportunity for error. Even frontier agents make mistakes across tool use, coding, and general assistant tasks [6] (Yuan et al. 2026). Repeatedly correcting the same mistakes is costly, leads to inconsistent performance, and leaves the potential for continuous improvement unrealized. Our goal is not just to fix an agent’s mistake in the current session, but to learn persistent lessons to avoid repeating the mistake in the future.

Existing approaches encapsulate lessons either in context or in model weights, but enable only part of the desired behavior. Context-based methods, e.g., demonstrations, prompt optimization, reflection, hard-coded skill files, and persistent agent harnesses, can change behavior quickly during deployment (Shinn et al., 2023; Majumder et al., 2024; Zhao et al., 2024). They enable agents to accumulate experience without access to model parameters, but their lessons remain external: They must be retrieved when relevant, compete for limited context, and may not reliably influence behavior on related future tasks.

Conversely, parameter-based methods, such as supervised fine-tuning and reinforcement learning, can produce more persistent behavioral change, but typically require separate training processes, substantial data and optimization, and careful management of interference to reduce the risk of catastrophic forgetting (Luo et al., 2023; Gu et al., 2024; Ven et al., 2025). What is missing is a continuous mechanism to fix mistakes in the current session and avoid repeating mistakes in future sessions, without impacting existing capabilities.

To address this gap, we introduce Self-Direction, a mechanism for agents to learn from their mistakes. After a failed execution, the agent examines its trajectory to extract a lesson and then distills the lesson into a lightweight Low-Rank Adaptation (LoRA) repair adapter. Self-Direction turns feedback about a mistake from the environment or a user into a LoRA lesson that can be employed immediately to retry the current task and retained for future use. Self-Direction uses a router to determine if an existing lesson is relevant to the current task based on the similarity between the current task description and descriptions of previously seen tasks, enabling reuse of lessons on future tasks. Each lesson is encoded in a separate adapter while the base model and previously learned adapters remain frozen, preventing new training from overwriting existing parameters. Furthermore, each lesson requires only a modest amount of memory (e.g., ∼85\sim85 MB for Qwen3.6-27B), allowing the library of lessons to grow with the agent’s experience. An overview of Self-Direction is presented in Figure 3.

Self-Direction pipeline overview

Figure 3. Self-Direction pipeline overview. On detecting a mistake, the agent either self-reflects on the failed trajectory and trains a new LoRA adapter or retrieves an adapter already stored in the library of lessons; the selected adapter is then loaded and the task retried.

We evaluate Self-Direction on open-weight agents across terminal coding, tool-use, web search, and personal assistant tasks. We find:

  1. Self-Direction increases success across task types. By repairing mistakes, Self-Direction raises the task success rate by 17.0 percentage points on GAIA (Mialon et al., 2023), 13.8 points on Terminal-Bench 2.1 (Merrill et al., 2026), and 8.9 points on Claw-Eval (Ye et al., 2026) (tool-using workflows), outperforming in-context reflections and reflections distilled into Skills.md. On Terminal-Bench 2.1, official scores show that Self-Direction with a 27B-parameter Qwen agent outperforms GLM-5.1, a model with approximately 30× more parameters, and performs competitively with frontier closed-weight systems including Claude Opus 4.7 and Gemini 3.1 Pro (see § 4).

  1. Self-Direction prevents repeated mistakes across future encounters of a task. Self-Direction repairs are reliable across repeated encounters. It nearly doubles the recovery rate across three encounters compared with base-agent retrying. On Claw-Eval, Self-Direction raises pass3, which measures success in all three independent runs, from 51.6% to 64.6%, achieving performance competitive with that of frontier agents that use GPT-5.4, Kimi-K2.6, and Gemini 3.1 Pro (see § 4.2).

  1. Self-Direction generalizes to new tasks without sacrificing existing capabilities. With a library capped at just three adapters, occupying 256 MB of memory in total, Self-Direction raises task success on GAIA from 36.4% to 52.7%. Lessons learned exclusively from easier GAIA tasks improve success on unseen, harder tasks by 10.5 points, whereas three adapters learned from Claw-Eval operations tasks raise success on workflow tasks from 75.0% to 87.5%, without additional training. Notably, Self-Direction enables these gains without interfering with existing capabilities (§ 4.3).

Together, these results bring open-weight agents closer to continuous improvement, where lessons accumulate with continued use.

Related Work

After failing to complete a task, an agent could simply re-run the same task [7] or spend additional inference-time compute (Snell et al., 2025). Both methods improve the fraction of tasks solved by at least one attempt. However, these methods retain no lesson from the recovery after the episode ends, leaving the agent just as likely to repeat the same mistake. Methods that do retain lessons differ mainly in where the lesson is stored: in the agent’s context, its harness, or its weights.

Lessons kept in context. The most direct way to preserve a lesson is to write it down. Reflexion (Shinn et al., 2023), ExpeL (Zhao et al., 2024), CLIN (Majumder et al., 2024), and Voyager (Wang et al., 2024) store verbal reflections, causal abstractions, or executable skills in episodic memory to condition later trials. This enables rapid adaptation without parameter updates but leaves lessons external to the policy: Reuse requires repeatedly retrieving them into a finite context window. This process is fragile, as performance is sensitive to prompt composition (Lu et al., 2022) and models use relevant information less reliably in longer contexts (Liu et al., 2023). Appendix § 6 further discusses the expressive limits of context-based adaptation.

Lessons kept in the harness. An orthogonal approach modifies the agent’s harness—its prompts, tools, and memory—while leaving the model fixed [8] (Ning et al. 2026). Recent systems search over agent designs or self-improve by rewriting their code in response to environmental feedback [16] (Zhang et al. 2026c; Robeyns et al. 2025). Closest to our setting, Zhang et al. (2026b) let a fixed model mine its failure traces to propose minimal, regression-tested harness edits. We share this failure-driven, teacherless trigger but instead incorporate repairs into the policy itself. Harness-only methods change how a fixed policy is invoked, not what it has learned; gains remain in the scaffold, leaving the underlying model no more capable after deployment. Appendix § 6 reviews self-synthesizing and evolving harnesses more broadly.

Lessons kept in weights. Parameter updates write lessons directly into the policy, though full fine-tuning can interfere with existing capabilities (Luo et al., 2023). Parameter-efficient methods, such as LoRA [15], constrain these updates, motivating approaches that convert failures into weights. FailForge (Lv et al., 2026) and SKILLO (Lu et al., 2026), however, typically rely on global fine-tuning, privileged reference solutions, or stronger external teachers. Test-Time Training (TTT) instead adapts parameters online to the current input [2] (Sun et al. 2020) but applies updates unconditionally and discards them after the episode. Self-Direction differs from both: Triggered only by a verified failure, it derives supervision from the agent’s own failed trajectory without a stronger teacher, then uses a targeted adapter (Ren et al., 2026) to store each repair as a routable entry in a persistent library of lessons. Appendix § 6 compares other parameter-efficient, self-rewarding, and TTT methods.

Learning from Mistakes

Consider an agent governed by an initial policy π0\pi_0 deployed across a task set T\mathcal{T}. During execution, the tasks on which the agent fails are denoted by a mistake subset Tfail\mathcal{T}_{\mathrm{fail}}. When an agent encounters a task t∈Tfailt \in\mathcal{T}_{\mathrm{fail}}, the goal is to repair the immediate mistake while updating the system so that similar mistakes are avoided in the future and base capabilities are preserved.

Experimental Setup and Evaluation on GAIA

Existing Paradigms for Repairing Mistakes

Motivated by current mechanisms for repairing mistakes outlined in § 2, we consider four strategies. They differ in where lessons are encoded and whether they persist after the episode: nowhere, in the context, in the weights, or in the harness (see Figure 2).

Figure 2. Self-Direction outperforms alternative mistake-repair strategies on GAIA. SVD-initialized LoRA achieves success on 92/165 tasks (55.8%), outperforming Retrying (pass@3), Reflections in Context, and Accumulating Reflections in Skills.md. Self-Direction recovers 28 mistakes, yielding a 17.0-point gain over the initial base execution. We also compare our results with Failed Trajectory in Context and doubling the tool call budget in Appendix § 8.§ 2.

  • Resampling (lesson not stored): Agents spend extra test-time compute by drawing multiple independent samples from the unmodified base model π0\pi_{0} to hopefully generate a new, correct rollout ((Muennighoff et al., 2025)). No lesson is stored, even in the current session: Each agent action is selected from the same policy, π0\pi_{0}.

  • Reflection in Context (lesson stored in current session’s context): Reflecting on mistakes and inserting verbal critiques, error rationales, or raw failed trajectories into the prompt context has been shown to be an effective method for boosting agent performance ((Shinn et al., 2023; Majumder et al., 2024)). By self-reflecting and loading task-specific procedural lessons into context, agents can avoid mistakes when retrying the task. However, by default, the lesson is forgotten once a new session without the current context begins.

  • Reflection in Weights (lessons persist across sessions in weights): As an alternative to loading procedural per-task reflections in context as textual lessons, agents can incorporate the same reflections in weights through a lightweight adapter, which enables the lessons to persist in the policy and can lead to corrective behavior.

  • Accumulating reflections in Skills.md (lessons are accumulated across sessions in a text file): Instead of relying on an external mechanism to determine relevant in-context reflections for a task and retrying, agents can learn from mistakes by distilling and accumulating reflections across sessions and tasks in a shared Markdown text file, often called Skills.md. Agents can load the relevant Skills.md into context when the same or similar tasks are encountered.

We compare these approaches using open-weight agents across general assistant, coding, and tool-calling agentic tasks.

Experimental Setup and Evaluation on GAIA

Experimental setup. To evaluate mechanisms for repairing mistakes under controlled conditions, we standardize our primary agent architecture on open-weight models from the Qwen family. The main part of this article contains results for Qwen3.6-27B (Qwen Team, 2026a). The agent operates inside a ReAct interaction loop using standard benchmark system prompts outlined in Appendix § 12 (Yao et al., 2022). Appendix § 11 lists all hyperparameters, Appendix § 12 lists the prompts, and Appendix § 9 repeats the loop on the stronger Qwen3.8-27B (with additional results for Qwen3.5-9B) (Qwen Team, 2026b). Open-weight models enable us to directly compare in-weight versus in-context reflections, described in § 3.2, while keeping the agent’s base model fixed.

Metrics. In addition to accuracy, measured as the Task Success Rate, we report pass@kpass@k and passkpass^{k} to separate coverage from consistency across kk independent executions of the whole pipeline. Pass@kPass@k is the fraction of tasks solved in at least one run; passkpass^{k} is the fraction solved in every run.

Evaluating assistant, tool-calling, and coding agents. Our evaluation spans three distinct domains. GAIA (Mialon et al., 2023) comprises 165 validation tasks across three difficulty levels. Agents use web search, page retrieval, Python, a shell, and file inspection; success is verified by matching a short final answer against a reference. Claw-Eval (Ye et al., 2026) evaluates tool-use workflows over mock email, calendar, task-tracking, and business services. Verification considers the whole trace, including tool calls, audit logs, and produced artifacts, together with an LLM judge. A task can therefore fail because of the actions the agent took even when its final message looks correct. Terminal-Bench 2.1 (Merrill et al., 2026) comprises 89 tasks executed through a persistent shell inside a fresh container. Success is verified by hidden tests run after the attempt. We provide additional experiments for browser agents on MiniWoB++ in Appendix § 7. Additional details on benchmark-specific tool calls are presented in Appendix § 11.§ 4.

In this section, we employ GAIA as a diagnostic testbed to motivate our pipeline design, reserving comprehensive cross-domain evaluations on Claw-Eval and Terminal-Bench 2.1 for § 4.

Findings on GAIA. We evaluate task success across standard retrying, in-context reflections, and in-weight parametric updates on the 165 GAIA validation tasks (see Figure 2).

Retrying boosts coverage but lacks persistence: Resampling from the base model by doing parallel rollouts is effective for immediate task recovery, yielding a 10.9 pp gain with pass@3 compared to the initial base execution. However, retrying leaves model parameters untouched; once an episode ends, the agent remains just as likely to repeat the same mistake when encountering a similar task in future sessions. We also compare our results with Failed Trajectory in Context in Appendix § 8.§ 2.

In-weight updates outperform in-context reflections: To enable lessons to persist, we compare adding failure reflections to context versus incorporating them in weights. Encoding reflections in weights achieves higher task success than loading them into context (+10.3 pp). As mistakes accumulate, we find that encoding reflections into a single LoRA adapter is not as effective as individual LoRA adapters per task (see Figure 14), suggesting that LoRA updates per task are effective in capturing repairs without using global parameter updates. A qualitative example of a successful recovery from a mistake on a Level 1 task is presented in Figure 15.

Figure 14. Recovery after an initial failure on GAIA. The complete Self-Direction loop recovers 27.7% of the failures. Text memory stores lessons in Skills.md; the single-LoRA baselines pool experience across failures and the mismatched condition applies an unrelated adapter.

Figure 15. Self-Direction recovers failing tasks. A qualitative example showing how Self-Direction reflects on the failure, correctly identifies overuse of invalid tools, and generates corrective examples that ultimately help the agent succeed on a GAIA Level-1 task.

Harness summaries (Skills.md) underperform and constrain context budget: As execution failures accumulate, storing textual reflections in context hits severe scaling limits. Storing full failure trajectories and reflections across GAIA tasks exceeds Qwen3.6-27B’s native context window by over 10× (Appendix § 10.§ 2). Distilling reflections into a high-level Skills.md file avoids context overflow but task performance is lower than when reflections are retained in weights (see Figure 2).

Across 165 GAIA tasks, Self-Direction improves accuracy from 38.8% to 55.8%, a gain of 17.0 points (paired task-level tt-test: t(164)=5.79t(164) = 5.79, p=3.50×10−8p = 3.50 \times10^{-8}; 95% CI: [11.2, 22.8] pp). We also find that loading an incorrect or mismatched adapter degrades performance below the clean base policy (Appendix § 10.§ 1), motivating us to include a router to select an adapter relevant to the task at hand based on the similarity between the current task description and the source-task descriptions associated with stored adapters. Additional details about the tt-test are presented in Appendix § 8.9.

The Self-Direction Loop

Motivated by these diagnostic findings, we introduce Self-Direction: a mechanism that enables agents to learn from a failed execution by reflecting on their mistakes and distilling the resulting lessons into a LoRA adapter, which can later be loaded for similar tasks (see Figure 3). This enables learning from mistakes to scale while preserving the agent’s existing capabilities (see § 4.3). Self-Direction operates in two main modes:

Training repair adapters. When an agent encounters a failure, it performs self-directed reflection to synthesize a concise set (N≤24N \le24) of procedural instruction-response examples. Crucially, the model acts as its own teacher without relying on external supervisor models and does not require full rollouts; the procedural examples are behavioral corrections (see Appendix § 14). These examples are distilled into a lightweight LoRA adapter. To maintain numerical stability and keep the base weights unchanged, adapter matrix AA is initialized from the leading right-singular vectors of the targeted base weights and frozen, whereas matrix BB (initialized to zero) is optimized (see Appendix § 15). Training each adapter updates additional parameters equivalent to at most approximately 0.02% of the base model’s parameter count, enabling continuous accumulation in a persistent library of lessons L\mathcal{L} with a modest memory footprint (∼85\sim85 MB for Qwen3.6-27B). Adapter optimization takes ∼1.5\sim1.5 minutes on an H200 GPU in our setup; reflection and example synthesis require additional time. Additional details about the reflection, synthesis, and training stages are presented in Appendix § 11.§ 3.

Reusing adapters. When the same or a similar failed task is encountered, Self-Direction uses a sentence-embedding router2 ((Reimers and Gurevych, 2019)) to compare the incoming task with the task descriptions stored alongside each lesson in L\mathcal{L} (the similarity is 1 if a new adapter is trained for the current task). The corresponding adapter is then loaded into the frozen base model for re-execution.

Base retry fallback: Motivated by the benefits of resampling, if an adapter-guided retry fails, Self-Direction unloads the adapter and executes a final attempt on the base model with a prompt that indicates that a prior attempt failed (Appendix § 12). This fallback uses the remaining rollout budget for immediate recovery after the adapter is unloaded.

Results

Beyond GAIA, we expand our evaluation to coding, tool-calling assistant tasks, and browser agent tasks. We find Self-Direction can repair mistakes across diverse settings, avoid repeating mistakes in the future, and scale learning while preserving existing capabilities, with repair adapters that generalize to unseen task categories and difficulties.

Self-Direction Repairs Mistakes Across Various Task Types

First, we measure whether Self-Direction improves task success across diverse agentic environments. We compare it to the base agent over three independent runs across Claw-Eval, GAIA, Terminal-Bench 2.1, as well as browser gym tasks from MiniWoB++. We find Self-Direction improves task success across all task types. On Claw-Eval, mean success increases from 64.4% ±\pm 3.6% to 73.3% ±\pm 2.8%, a gain of 8.9 percentage points (Figure 4). On Terminal-Bench 2.1, mean success increases from 51.7% ±\pm 4.1% to 65.5% ±\pm 0.6%, a gain of 13.8 points (Figure 1). On GAIA, the gain is 17.0 points (Figure 2). We observe additional gains compared to the base agent on MiniWoB++ browser tasks (Appendix § 7.§ 1).

Figure 1. Self-Direction turns an agent’s own failures into reusable LoRA lessons. Left: Current agents fail to reliably reuse lessons learned by spending extra resources correcting a mistake. Self-Direction enables storage and reuse of lessons to avoid repeated mistakes. Right: On Terminal-Bench 2.1, Self-Direction lifts performance from 51.7% to 65.5%, outperforming existing baselines and frontier models1.

Figure 4. Self-Direction improves task success across distinct agentic environments. Left: Across three runs, Self-Direction improves mean success on Claw-Eval from 64.4% to 73.3% and outperforms other baselines. Error bars denote one sample standard deviation; cross-run pass@3 and pass3^{3} results are reported in Appendix § 8.§ 3. Terminal-Bench 2.1 and GAIA results are reported in Figure 1 and Figure 2, respectively. Right: Self-Direction enables a 27B model to outperform several larger frontier models across pass@3 and pass3^{3} metrics for Claw-Eval tasks.3

Self-Direction outperforms repair baselines and is agent-rollout efficient. We also compare Self-Direction with other strategies, such as adding reflection in context or distilling reflections in a Skills.md file. As shown in Figure 4, Self-Direction outperforms both settings. In addition, we find that Self-Direction compares favorably when controlling compute in terms of the number of rollouts (see Figure 10); e.g., Self-Direction achieves 55.8% task success on GAIA with only 2.10 agent rollouts per task, matching the base agent’s pass@6.

Figure 10. Self-Direction reaches higher accuracy with comparable task-environment rollouts. Relative to base pass@k, Self-Direction outperforms the pass@k baseline across all three benchmarks while using a comparable number of full agent rollouts. Reflection, synthesis, and adapter optimization details are presented in Appendix § 11.§ 3.

Self-Direction narrows the gap to reported frontier agents. For Claw-Eval and Terminal-Bench 2.1, we also compare Self-Direction with officially reported numbers for frontier agents. We find Self-Direction with a

27B-parameter Qwen model achieves a competitive task success rate. For example, on Terminal-Bench 2.1, Self-Direction outperforms GLM-5.1, a model with 30× more parameters, and is competitive with closed-weight models, such as Opus 4.7 and Gemini 3.1 Pro (see Figure 1). Similarly, on Claw-Eval, Self-Direction outperforms GLM-5.1 and is competitive with Gemini 3.1 Pro and Claude Opus 4.7 (see Figure 4).

The gains extend across GAIA difficulty levels (Appendix § 8.§ 2), Claw-Eval task categories and execution structures (Table 5), and Terminal-Bench 2.1 difficulty levels (Table 6). The gains also extend to agents with Qwen3.5 and Qwen3.8 model variants (Table 4 and Appendix § 9). Together, these results demonstrate that Self-Direction improves diverse agents across open-ended research, tool-using workflows, terminal coding, and browser interaction.

StageAttemptsNew winsStage successCumulative winsOverall accuracy
Phase 1892325.8%2325.8%
Phase 4: adapter65710.8%3033.7%
Phase 4: base fallback5811.7%3134.8%
Final8931—3134.8%

Table 4. Terminal-Bench 2.1 results for Qwen3.5-9B

StratificationGroupNMean AccuracyPass³
Initial baseFull loopInitial baseFull loop
OverallAll tasks16164.4%73.3%51.6%64.6%
CategoryWorkflow4778.7%87.9%61.7%78.7%
Ops3189.2%98.9%80.6%96.8%
Finance1428.6%40.5%14.3%28.6%
Office QA1033.3%43.3%20.0%20.0%
Communication875.0%75.0%75.0%75.0%
Productivity761.9%66.7%42.9%57.1%
Operations683.3%88.9%83.3%83.3%
Safety553.3%60.0%40.0%60.0%
Terminal513.3%33.3%0.0%0.0%
Other categories2846.4%54.8%32.1%46.4%
Task structureMulti-service6080.6%91.1%66.7%85.0%
Other general tasks10154.8%62.7%42.6%52.5%
State-changing action required3971.8%78.6%59.0%74.4%
No expected state change12262.0%71.6%49.2%61.5%
Safety-primary6571.3%75.4%58.5%70.8%
Not safety-primary9659.7%71.9%46.9%60.4%

Table 5. Claw-Eval results stratified by task category and structure. Mean accuracy is computed across three independent runs, while pass³ requires success in all three runs. Task categories partition the 161 tasks. Task-structure rows describe three separate binary attributes: multi-service, state-changing, and safety-primary.

StratificationGroupNMean AccuracyPass3^{3}
Initial baseFull loopInitial baseFull loop
OverallAll tasks8951.7%65.5%34.8%57.3%
DifficultyEasy4100.0%100.0%100.0%100.0%
DifficultyMedium5562.4%78.2%43.6%70.9%
DifficultyHard3025.6%37.8%10.0%26.7%
CategorySoftware Engineering2638.5%47.4%26.9%42.3%
CategorySystem Administration963.0%88.9%33.3%77.8%
CategoryData Science850.0%70.8%25.0%62.5%
CategoryScientific Computing829.2%37.5%12.5%37.5%
CategorySecurity875.0%91.7%62.5%87.5%
CategoryDebugging586.7%93.3%60.0%80.0%
CategoryFile Operations533.3%60.0%20.0%40.0%
CategoryData Processing483.3%83.3%75.0%75.0%
CategoryMathematics425.0%41.7%0.0%25.0%
CategoryModel Training466.7%83.3%50.0%75.0%
CategoryMachine Learning366.7%88.9%33.3%66.7%
CategoryData Querying1100.0%100.0%100.0%100.0%
CategoryGames10.0%33.3%0.0%0.0%
CategoryOptimization1100.0%100.0%100.0%100.0%
CategoryPersonal Assistant1100.0%100.0%100.0%100.0%
CategoryVideo Processing10.0%0.0%0.0%0.0%

Table 6. Terminal-Bench 2.1 results stratified by difficulty and task category. Mean accuracy is computed across three independent runs, while pass3^{3} requires success in all three runs. Self-Direction improves both medium and hard tasks and produces gains across a broad range of technical categories.

Next, we study whether a repair persists across repeated encounters of a task.

Learned Lessons Prevent Repeated Mistakes

After repairing a mistake, we study how consistently Self-Direction prevents repetitions of the same mistakes in the future. We evaluate whether a repair is merely the result of a lucky retry or a persistent lesson in two ways. First, we measure whether a repair remains effective over future repeated encounters of a task. Second, we assess variability in how often a learned lesson repairs a mistake across multiple independent runs.

Self-Direction avoids repeating mistakes across future encounters of a task. Across 185 prior mistakes from the three benchmarks, Self-Direction nearly doubles the fraction solved consistently across three encounters: pass3pass^{3} increases from 9.7% to 18.9% (+9.2 pp) across GAIA, Terminal-Bench 2.1, and Claw-Eval (see Table 1). At each encounter, both base retrying and Self-Direction receive up to two full rollouts. We report mistakes avoided, passkpass^{k}, as the fraction of prior mistakes solved in every encounter through encounter kk. We also report corrections preserved, passk/pass1pass^{k}/pass^{1}, as the fraction of first-encounter successes that remain successful through encounter kk. More importantly, after Self-Direction repairs a mistake once, 76.9% of the repairs remain effective through a second encounter and 67.3% through a third, compared with only 52.4% and 42.9% for the base agent.

BenchmarkEncountersMistakes avoided (passk\mathrm{pass}^{k})Corrections preserved
kkBase retrySelf-DirectionGainBase retrySelf-Direction
GAIA29.9%21.8%+11.9 pp45.5%78.6%
36.9%19.8%+12.9 pp31.8%71.4%
Terminal-Bench 2.1213.6%20.5%+6.8 pp50.0%69.2%
313.6%15.9%+2.3 pp50.0%53.8%
Claw-Eval215.0%22.5%+7.5 pp75.0%81.8%
312.5%20.0%+7.5 pp62.5%72.7%
Total211.9%21.6%+9.7 pp52.4%76.9%
39.7%18.9%+9.2 pp42.9%67.3%

Table 1. Self-Direction prevents repaired mistakes from recurring. Learned lessons increase success across repeated encounters and preserve repairs more reliably than base-model retrying. Results cover 101 GAIA, 44 Terminal-Bench 2.1, and 40 Claw-Eval prior mistakes.

In Figure 5, we illustrate the variable performance of the base agent on Terminal-Bench 2.1 across three independent runs, which range from 48.3% to 56.2%; Self-Direction improves every run with gains ranging from +9.0 to +18.0 pp. Notably, pass3\mathrm{pass}_{3}, which requires a task to succeed in all three runs, increases from 34.8% to 57.3% (+22.5 pp). We show a similar plot for eight runs in Section C.4.

Figure 5. Self-Direction reduces the performance variability of the base agent. Left: Base agent performance varies within the same benchmark in the exact same setting, ranging from 48.3% to 56.2%. Self-Direction helps maintain reliable performance across all runs. Right: Self-Direction increases pass@3 from 64.0% to 74.2% and pass3pass^{3} from 34.8% to 57.3%. Reference frontier scores are provided for context to highlight differences between different harnesses and agentic settings.

Therefore, Self-Direction spends compute on repairing the current mistake, retaining the resulting lesson, and helping the agent avoid that mistake across future task encounters.

Next, we ask whether a growing library of lessons preserves the agent’s existing capabilities.

Self-Direction Learns New Lessons Without Impacting Existing Capabilities

Continual lesson acquisition is useful only if learning a new lesson does not disrupt the agent’s existing capabilities. Self-Direction limits this interference in two ways. First, it routes every task to the unchanged base model for the initial attempt; adapter retrieval occurs only after a base agent makes a mistake. Second, each learned lesson is stored as a separate lightweight adapter, leaving the base model and previously learned adapters frozen. Learning a new lesson, therefore, cannot overwrite previously acquired behavior.

On a retry, Self-Direction loads an existing adapter only when the current task goal is sufficiently similar to the adapter’s source-task goal under threshold τ\tau. An agent with τ=1\tau= 1 will load an existing adapter only if the same task is encountered again; otherwise, the agent will train a new adapter. In this setting, Self-Direction trains new adapters for each new task and preserves stored base-model and adapter parameters by keeping them frozen. When τ<1\tau< 1, Self-Direction loads adapters for similar but not necessarily identical tasks, enabling reuse of adapters across new tasks. We find that empirically, except for low thresholds τ<0.30\tau< 0.30, the router preserves or improves existing capabilities even with a library of lessons containing adapters from the two other unrelated benchmarks. The detailed findings are presented in Appendix § 8.8.

Next, we study a simple strategy of selecting the most similar adapter, without a fixed threshold. We find that selecting the most similar adapter leads to generalization across new tasks.

Learned Lessons Transfer to Unseen Tasks Across Difficulties and Types

Training a new lesson for each failure may not always be practical. Here, we ask whether lessons acquired through Self-Direction transfer to unseen tasks. We explore three types of transfer: to unseen tasks in a continual deployment stream, to unseen harder tasks, and to unseen task categories.

A library of three lessons boosts task success across GAIA. We simulate a deployment stream by randomly interleaving all 165 GAIA tasks across all levels. The agent begins with an empty library of lessons and applies Self-Direction to learn new lessons. With the library capped at three adapters, the complete Self-Direction loop increases task success across the full 165-task GAIA stream from 36.4% to 52.7%, a gain of 16.3 points, as shown in Table 3. The complete three-adapter library occupies only 256 MB, showing that useful experience can be retained with a modest incremental memory footprint. We report additional deployment-stream experiments with libraries containing six or twelve adapters in Appendix § 8.7.

GeneralizationLessons learned fromLibraryEvaluation tasksImprovement
Tasks in a continual stream GAIA3 GAIA tasks3 adaptersGAIA deployment stream (n=165n = 165)+16.3 pp<br>36.4%→52.7%36.4\% \to52.7\%
Harder tasks GAIAEasy Level 1 tasks28 adaptersHarder Level 2 tasks (n=86n = 86)+10.47 pp<br>40.7%→51.2%40.7\% \to51.2\%
Tasks across categories Claw-EvalOperations tasks3 adaptersUnseen workflow tasks (n=24n = 24)+12.5 pp<br>75.0%→87.5%75.0\% \to87.5\%

Table 3. Self-Direction transfers learned lessons to unseen tasks. Stored lessons generalize to new tasks in a continual deployment stream, harder tasks, and related task categories.

Lessons learned on easier tasks transfer to harder tasks. We study how well lessons learned on easier Level-1 GAIA tasks transfer to unseen, harder Level-2 tasks. Specifically, we train 28 adapters on failed Level-1 tasks, freeze the resulting library, and evaluate it on 86 unseen Level-2 tasks. We find that reusing Level-1 lessons recovers nine failures, increasing overall accuracy from 40.7% to 51.2% – a gain of 10.5 percentage points. The base agent achieves a pass@2 rate of 43% on this subset, demonstrating that the learned repairs remain effective even on more challenging tasks.

Lessons transfer across related task categories. Finally, we test whether lessons cross category boundaries within Claw-Eval. We freeze a library of three adapters learned exclusively from operations tasks and evaluate it on 24 unseen workflow tasks (Table 3). The base agent solves 18 tasks on the initial execution. On the six remaining failures, the operations library solves three, recovering half of the failures without training on a single workflow task. This raises accuracy from 75.0% to 87.5%, a gain of 12.5 percentage points. Qualitative examples of these transfers are presented in Appendix § 13.

Collectively, our findings present Self-Direction as a promising foundation for agents that improve through continual use. Across research, tool-use, browser, and coding environments, Self-Direction repairs mistakes now, prevents repeating mistakes in the future, preserves existing capabilities, and generalizes to harder tasks and tasks in related categories. Self-Direction offers a path towards agents whose deployment experience compounds over time—where each mistake can contribute not only to solving the task at hand, but to building lasting capabilities.

Conclusion

A growing library of lessons holds promise for scaling continuous agent self-improvement. Encoding each lesson as a LoRA adapter provides a practical way to store and reuse experience across deployments and domains. Besides self-improvement, Self-Direction may support model specialization for tailored applications, personalization, and patching security vulnerabilities. Lessons could also be implemented through self-evolving harnesses or stored in Skills.md files for use in context. Future research can explore how to select the most suitable medium for retaining a given lesson and how to compose multiple lessons when addressing a mistake.

Limitations. Self-Direction begins with a mistake, which must be detected through self-evaluation or grader feedback, or reported by a user. It then retains the resulting lesson. Encoding that lesson in model weights requires GPU resources and storage capacity beyond standard inference to train LoRA adapters. Textual reflections can instead be stored and accumulated until sufficient resources become available. Compared with in-context or textual lessons, which transfer across model families and remain human-interpretable, in-weight repairs avoid consuming the limited context window but remain model-specific.

Expanded Related Work

Lessons kept in context. Expanding on the context-based methods discussed in § 2, systems frequently rely on iterative self-correction without training. For instance, Self-Refine allows a single model to critique and revise its own output ((Madaan et al., 2023)), whereas GEPA turns this reflective step into an optimizer by attributing outcomes to specific prompt content and evolving candidate pools ([1]). Maintaining textual skills has also appeared in deployed systems as markdown skill files ([4]), with recent work co-evolving such skills alongside persistent knowledge bases for cross-model transfer ((Tang et al., 2026)). Other approaches, like Skill-Pro, refine a skill memory using a PPO-style objective while keeping the underlying model frozen ((Mi et al., 2026)). However, relying on externalized skills has significant operational downsides. Retrieved skills have been shown to introduce functional failures and efficiency regressions even when they appear relevant ([9]). Furthermore, the limitation is fundamentally expressive: Gupta et al. [13] argue that concatenating exemplars is only a shallow form of adaptation, as the context can only reach the internal states that a literal prompt induces through frozen weights.

Lessons kept in the harness. Expanding on the harness-based methods discussed in § 2, there is extensive debate regarding how to best represent an agent’s harness ([8] (Pan et al. 2026; Wang et al. 2026)) and what elements the harness should own at runtime ([17]). While early work focused on meta-agents programming new agents in code ([16]), recent systems have heavily specialized this self-evolving loop. For instance, Lou et al. (2026) synthesize code harnesses automatically, Sengupta and Wang (2026) treat harness configuration as a direct optimization target, and Lee et al. [19] optimize a weaker agent’s harness using a stronger external one. Lin et al. (2026) pair every harness edit with a prediction that is later verified against task outcomes. Beyond single-episode optimization, Nie et al. (2026a) distribute this process across deployments and Nie et al. (2026b) evolve harness code over an unlabeled test stream, though adaptation is scheduled per batch rather than conditioned on a verified failure. Other approaches synthesize harnesses just in time ((Zhang et al., 2026a)), adapt the model-environment interface offline ((Xu et al., 2026)), compose harnesses into multi-day development loops ((Yan et al., 2026)), or expose this evolving surface directly in deployed systems ([18]). Ultimately, all of these methods accumulate a lineage of scaffold code rather than a library of parametric repairs.

Lessons kept in weights. As discussed in § 2, low-rank adaptation reduces the risk of catastrophic forgetting. However, empirical analysis shows that routing among several adapters can still underperform an oracle ([5]). Variations like PiSSA initialize an adapter from the principal singular components of a pretrained weight and train those components, refactoring the stored weight into a residual ((Meng et al., 2024)). In contrast, we freeze the spectral factor and train only the zero-initialized coefficient matrix, leaving base weights completely untouched such that the adapter remains detachable. This follows the initialization introduced for online parametric memory by Ren et al. (2026), though their adaptation is triggered by context-budget overflow and evolves a single intra-episode state rather than a retrievable library.

Furthermore, the training signal for in-weight learning is typically gathered in offline batches, as seen in STaR and ReST ([12] (Zelikman et al. 2022)). Methods that learn specifically from mistakes usually rely on a stronger corrector, such as GPT-4 ([3]), or the model judging itself ((Yuan et al., 2024)). When a teacher is given privileged information, the resulting performance gap conflates true transferable capability with information asymmetry ((Yu et al., 2026)). Closest to our setting, FailForge converts persistent failures into a training signal, but uses a stronger teacher, a reference patch as privileged input, and a single global fine-tune after which the textual skill is deliberately discarded ((Lv et al., 2026)). Finally, Test-Time Training (TTT) is related to our in-weight updates during goal execution. TTT adapts parameters on the current test input under a self-supervised objective ((Sun et al., 2020)), on text retrieved from neighbors before being reset ([14]), or through a per-task adapter trained on rule-based augmentations ([2]). In each of these cases, adaptation is transient and unconditional, whereas our method conditions strictly on verified failures and preserves the repair for future reuse.

Additional Browser and Computer-Use Benchmarks

We further evaluate whether Self-Direction extends to environments in which success depends on interacting with graphical interfaces rather than producing a textual answer. We consider MiniWoB++, which contains focused browser-control tasks. We retain the same fixed base model, reflection procedure, adapter training configuration, and adapter-first retry with base retry fallback used in the main experiments.

The benchmark provides the agent with a textual accessibility tree containing stable element identifiers. The agent receives no screenshots or visual pixels. The available tools support observing the page, executing BrowserGym actions, clicking, typing, selecting options, pressing keys, scrolling, waiting, and signaling completion.

MiniWoB++

Many MiniWoB++ categories are already saturated by the base agent and provide little opportunity for learning. We, therefore, focus on four categories with meaningful remaining headroom. These include a harder multi-target social-media task, collapsible interface elements, and two variants of email-inbox interaction. Simpler categories, such as navigate-tree and multi-layouts, were excluded because the base model already solves nearly all evaluated instances.

Across the selected categories, the common initial base execution solves 42/100 tasks. Three independent base attempts increase coverage to 55/100, whereas one execution of the full Self-Direction loop achieves 54/100. By nearly matching base pass@3, these results suggest that the same mechanism for learning from mistakes extends to browser interaction. The resulting adapters remain available for future reuse (see Table 2).

BenchmarkTask groupTasksInitial base (Qwen3.6-27B)Base pass@3 (no lesson retention)Full loop (lessons retained)
MiniWoB++social-media-all256/25 (24%)11/25 (44%)10/25 (40%)
MiniWoB++click-collapsible-2258/25 (32%)11/25 (44%)11/25 (44%)
MiniWoB++email-inbox2515/25 (60%)18/25 (72%)18/25 (72%)
MiniWoB++email-inbox-nl-turk2513/25 (52%)15/25 (60%)15/25 (60%)
MiniWoB++Overall10042/100 (42%)55/100 (55%)54/100 (54%)

Table 2. Additional results on browser use environments. Self-Direction enables meaningful gains in tasks involving browser use.

Expanded Results Across Benchmarks

The main text reports pooled and average results to emphasize the central empirical findings. Here, we present the stratification across GAIA difficulty levels and repeated executions of Claw-Eval and Terminal-Bench 2.1. These expanded results test whether the reported improvements are concentrated in particular task groups or isolated runs.

Self-Direction Trains Lessons That Can Be Reused for Future Tasks

We find that Self-Direction enables successful transfer of learned lessons to future related, unseen tasks as described in more detail in § 4.4.

GAIA Results by Difficulty Level

The pooled GAIA result presented in Figure 2 summarizes how different recovery strategies respond to an initial failure. Figure 6 expands this comparison across GAIA Levels 1–3. We compare Base resampling, Base resampling with double the tool call budget, Failed Trajectory in Context, Reflections in Context, reflections accumulating in Skills.md, and SVD-initialized LoRA using the strategies defined in § 3. All settings use up to 50 tool-call steps, except the 100-step budget ablation. The 100-step ablation demonstrates how sequential test-time scaling enables performance jumps. It should not be interpreted as a fair rollouts-matched comparison to other strategies and is reported for reference.

Figure 6. Expanded GAIA recovery results by difficulty level. Each panel compares base resampling, Failed Trajectory in Context, Reflections in Context, reflections in Skills.md, and SVD-LoRA. Stacked bars distinguish initial base successes from tasks recovered by each strategy. SVD-LoRA improves performance on all three levels and reaches 92/165 tasks overall.

SVD-initialized LoRA improves performance at every difficulty level. Starting from the initial base execution, the full loop increases accuracy from 25/53 to 35/53 on Level 1, from 31/86 to 46/86 on Level 2, and from 8/26 to 11/26 on Level 3. Pooled across all levels, modular lesson adapters recover 21 failures and the base retry fallback recovers seven more, producing the headline result of 92/165 (55.8%).

Expanded Per-Run Results on Claw-Eval and Terminal-Bench

The aggregate results presented in Figure 1 and Figure 4 report mean success across three runs. Here, we report all three complete executions of Claw-Eval and all eight executions of Terminal-Bench 2.1, together with task-level pass@k and passk^{k}. Pass@k measures coverage by counting tasks solved in at least one run, whereas passk^{k} measures consistency by requiring success in all kk runs.

The frontier-model reference points shown in Figure 5 and Figure 7 are reproduced from the corresponding public benchmark harnesses and should be interpreted as system-level results rather than controlled comparisons of the underlying models alone. Agent performance can vary substantially with the surrounding scaffold, including its prompts, tool interfaces, context management, stopping criteria, and retry policy. In contrast, all of our experiments use the same deliberately minimal ReAct harness described in § 3, enabling the effect of the Self-Direction loop to be isolated within our setting. These comparisons, therefore, provide useful performance context but do not attribute differences solely to model capability. More broadly, sophisticated continual harnesses and Self-Direction are complementary: Harnesses improve how a fixed model is orchestrated, whereas Self-Direction gives an open model a mechanism to convert failures into persistent, modular in-weight lessons. The same learning loop could consequently be incorporated into richer agent harnesses.

Figure 7. Expanded three-run results on Claw-Eval. The left panel decomposes each run into initial base successes, additional full-loop recoveries, and unresolved tasks. The right panel reports cross-run coverage (pass@3pass@3) and consistency (pass3pass^{3}). The full loop improves both metrics and produces a positive accuracy gain in every run. Reference-model scores are included for context and may use different agent configurations.

Claw-Eval. The full loop improves accuracy in every Claw-Eval run, with gains ranging from +4.3 to +15.5 percentage points (see Figure 7). Across the 161 tasks, pass@3 increases from 73.9% to 80.7%, whereas pass3 increases from 51.6% to 64.6%. Self-Direction, therefore, improves both the range of tasks the agent can solve and the set it solves consistently. We also report appropriate frontier model comparisons for context; the results are reported as is from the official harness used by the original benchmark authors (Ye et al., 2026).

Terminal-Bench Reliability Across Eight Runs

Three runs establish that the improvement is repeatable, but a larger campaign provides a stronger view of run-to-run reliability. We, therefore, execute the complete loop eight times on the same 89 Terminal-Bench 2.1 tasks. Self-Direction improves accuracy in all eight runs, with gains between 9.0 and 18.0 percentage points. Mean success increases from 51.8% for the initial base execution to 64.0% for the full loop, an average gain of 12.2 points (see Figure 8, Figure 9).

Terminal-Bench 2.1 outcomes across eight complete runs

Figure 8. Terminal-Bench 2.1 outcomes across eight complete runs. Each bar decomposes success from the initial base execution and additional recovery by the full loop. Self-Direction improves all eight runs and raises mean accuracy from 51.8% to 64.0%.

Figure 9. Self-Direction improves repeated-run reliability on Terminal-Bench 2.1. Left: passk^{k}, the fraction of tasks solved in each of kk runs, remains consistently higher for the full loop and increases from 25.8% to 48.3% at k=8k = 8. Lines report the mean over all subsets of kk runs, with shaded bands showing the minimum and maximum. Right: The loop preserves 100% pass8^{8} on easy tasks while increasing reliability from 29.1% to 58.2% on medium tasks and from 10.0% to 23.3% on hard tasks.

The larger campaign also sharpens the distinction between coverage and reliability. The full loop increases pass@8 from 74.2% to 80.9%, but its larger effect is on pass8: the number of tasks solved in every run increases from 23/89 to 43/89, corresponding to a nearly doubled rate, from 25.8% to 48.3%. The loop moves 20 tasks from intermittent success to 8/8 success. In addition, all 23 initially 8/8-reliable tasks remain reliable and six never-solved tasks gain some coverage. Thus, Self-Direction substantially enlarges the set of tasks solved consistently.

This eight-run analysis measures benchmark-level consistency when the complete learning process is executed independently in every run. Since Self-Direction may use up to three rollouts per task, the comparison with the base agent may not be compute-matched. The compute-matched analysis on recovery from mistakes is presented in § 4.2. It evaluates whether the same stored repair remains successful across repeated encounters.

In Table 4 we show additional results for Qwen3.5-9B on Terminal-Bench.

Gains Across Difficulty, Category, and Task Structure

Aggregate accuracy can conceal whether an improvement is concentrated in a narrow subset of tasks. We, therefore, stratify the results using the difficulty, category, and structural metadata provided by each benchmark. For every group, we report both mean accuracy across three runs and pass3.

GAIA difficulty levels. Figure 6 separates the GAIA comparison into Levels 1-3. Self-Direction improves performance at every level, showing that the pooled gain is not driven only by easier tasks.

Claw-Eval categories and task structure. Table 5 shows that the Claw-Eval improvement extends across heterogeneous workflows. On the two largest categories, Workflow and Ops, the full loop improves mean accuracy by 9.2 and 9.7 percentage points, respectively, while increasing pass3 by 17.0 and 16.2 points. Multi-service tasks exhibit a similarly broad improvement, with mean accuracy increasing from 80.6% to 91.1% and pass3 increasing from 66.7% to 85.0%.

The gains are not limited to one execution structure. Self-Direction improves both state-changing and non-state-changing tasks, as well as safety-primary and non-safety-primary tasks. The task-structure rows represent three separate binary attributes and are, therefore, not mutually exclusive across attributes.

Terminal-Bench difficulty and task categories. Table 6 shows that the improvement persists as the difficulty of Terminal-Bench 2.1 tasks increases. Easy tasks are already solved in every run by the base agent. On medium tasks, however, the full loop raises mean accuracy from 62.4% to 78.2% and pass³ from 43.6% to 70.9%. Hard-task accuracy increases from 25.6% to 37.8%, whereas pass³ increases from 10.0% to 26.7%.

Furthermore, the category breakdown in Table 6 shows improvements across substantially different technical capabilities, including software engineering, system administration, data science, security, scientific computing, and file operations. Improvements in pass³ are particularly pronounced for system administration, data science, security, and machine-learning tasks. The aggregate result, therefore, does not arise from repeatedly repairing one narrow class of terminal problems.

Together, these stratifications show that failure-conditioned Self-Direction remains useful across task types, execution structures, and difficulty levels. Results for very small groups should be interpreted descriptively, particularly categories containing fewer than five tasks.

Controlling for the Number of Agent Rollouts

Agent rollouts per task measure computational cost, counting task-environment executions only and excluding reflection, synthesis, and adapter training. We compare the loop’s accuracy and rollout count against the base pass@k curve.

Self-Direction improves accuracy at comparable task-environment rollout budgets. As shown in Figure 10, the loop reaches 55.8% accuracy on GAIA, with only 2.10 agent rollouts per task, matching the accuracy achieved by base pass@6. On Terminal-Bench 2.1, it reaches 66.3% accuracy with 1.90 rollouts per task, exceeding the 65.3% obtained by pass@3 using a similar number of rollouts. On Claw-Eval, the loop exceeds the accuracy of pass@3 while requiring a comparable average of 1.54 rollouts per task. Across all three domains, the loop obtains higher accuracy than simple retrying while using comparable or fewer task-environment rollouts, showing that Self-Direction uses rollouts efficiently compared with standard resampling. While this reinforces the strength of spending additional test-time compute, simply resampling parallel rollouts does not retain any lessons; the agent is just as likely to repeat the mistake if the same task is encountered again.

Adapters Trained in the GAIA Deployment Stream

Figure 11 reports the number of adapters trained for each of the P25, P50, and P75 thresholds in the GAIA deployment stream experiments, as described in § 4.4. Each new adapter occupies a marginal 85 MB of storage. Qualitative examples of recoveries from these adapters are further presented in Appendix § 13.§ 1.

Figure 11. Figure 11 A compact library of lessons amortizes learning across a deployment-like GAIA stream. Existing lessons avoid new adapter training for 88.7-97.1% of initial failures. Bars show adapters trained; annotations report storage and successful reuses; the green line shows training avoided through reuse.

Preserving Existing Lessons

Table 7 reports similarity thresholds that prevent retrieval of unrelated adapters in the evaluated cross-benchmark settings. A global threshold of 0.55 prevents all observed cross-benchmark retrievals with a full library of lessons from GAIA, Claw-Eval, and Terminal-Bench 2.1.

Benchmark PairMax. SimilaritySafe τ\tauCross-Domain RetrievalsCapabilities Preserved
GAIA–TB 2.10.5460.550 / 145✓
GAIA–Claw0.4150.420 / 141✓
TB 2.1–Claw0.3060.310 / 84✓
All three, one global τ\tau0.5460.550 / 370✓

Table 7. Self-Direction learns new lessons without disturbing existing capabilities. The safe threshold is the smallest two-decimal cutoff above the largest similarity observed across the pair. At this threshold, no evaluated task retrieves an adapter from the other domain in either direction, preventing cross-domain adapter application (✓).

Existing capabilities are preserved for reasonable threshold values. In addition to evaluating preservation of existing capabilities with a global threshold, we set up several experiments where the threshold τ\tau decreases below the cross-benchmark exclusion threshold, allowing selection and loading of adapters from other benchmarks. We vary τ\tau from 0.2 to 0.6 in increments of 0.01 and present the results in Figure 12. We find that except for low thresholds (dipping below 0.30), task success on GAIA and Terminal-Bench 2.1 is preserved even when the library contains lessons from the two other unrelated benchmarks. When τ\tau is very low (τ<0.35\tau< 0.35), we find that adapters from other benchmarks can help or hurt, depending on benchmark transfer.

Figure 12. Figure 12 Accuracy across router thresholds τ\tau with a fixed library of cross-benchmark lessons. Left: GAIA tasks failed by the base agent are retried with the corresponding top-matched adapter from Terminal-Bench and Claw-Eval libraries. Right: Terminal-Bench 2.1 tasks failed by the base agent are retried with the corresponding top-matched adapter from GAIA and Claw-Eval libraries. We see existing capabilities are preserved except for low thresholds dipping below 0.30, where adapters from other benchmarks in some cases can help or hurt accuracy on the new benchmark.

Statistical Comparison on GAIA

We compare Self-Direction with its initial base-agent execution using a paired, task-level tt-test. The unit of analysis is an individual GAIA task, rather than an evaluation run or difficulty level.

For each of the n=165n = 165 tasks, let

Bi∈{0,1}B_i \in\{0,1\}

denote whether the initial base-agent attempt is correct and let

Si∈{0,1}S_i \in\{0,1\}

denote whether the final output after executing the Self-Direction loop is correct. We define the paired difference

Di=Si−Bi.D_i = S_i - B_i.

The observed outcomes are:

OutcomeCountRate
Base correct6438.8%
Self-Direction correct9255.8%
Recovered by Self-Direction2817.0%

Table 8.

Thus, 64 tasks are solved by both stages, 28 are solved only after Self-Direction, and 73 are unsolved by both. The mean paired difference is

Dˉ=28165=0.1697.\bar{D} = \frac{28}{165} = 0.1697.

We compute the test statistic as

t=DˉsD/n,t = \frac{\bar{D}}{s_D/\sqrt{n}},

where sDs_D is the sample standard deviation of the 165 paired differences. The two-sided test gives

t(164)=5.79,p=3.50×10−8.t(164) = 5.79,\qquad p = 3.50 \times10^{-8}.

The corresponding 95% confidence interval for the accuracy improvement is [11.2, 22.8] percentage points.

The results are pooled at the task level across GAIA Levels 1-3, comprising 53 Level-1, 86 Level-2, and 26 Level-3 tasks.

Self-Direction with a Stronger Base Model

The benefits of Self-Direction should not depend on beginning with a weak base agent. We test this by applying the same loop to Qwen3.8-27B and comparing it with Qwen3.6-27B on identical GAIA, Claw-Eval, and Terminal-Bench 2.1 task sets.

As expected, Qwen3.8-27B solves more tasks during its initial execution on all three benchmarks. Self-Direction nevertheless provides substantial additional gains. On GAIA, it recovers 27 failures and raises accuracy from 59.4% to 75.8% (+16.4 pp). On Claw-Eval, it raises accuracy from 64.6% to 76.4% (+11.8 pp), whereas on Terminal-Bench 2.1, it improves accuracy from 55.1% to 73.0% (+17.9 pp). The corresponding Qwen3.6-27B runs also improve on every benchmark, with gains between 15.5 and 18.0 percentage points.

These results support the central role of failure as an intervention point. As the base model becomes more capable, fewer tasks enter the mistake subset but the remaining failures still provide useful signals for targeted in-weight repair. Self-Direction, therefore, complements improvements in the underlying model rather than merely compensating for a weaker checkpoint. This experiment establishes robustness across two capability levels within the same model family; broader generalization across model families and scales remains an important direction for future work.

Figure 13. Self-Direction continues to improve a stronger base model. We apply the same failure-conditioned loop to Qwen3.6-27B and Qwen3.8-27B on identical benchmark tasks. Blue denotes tasks solved by initial base execution, green denotes additional tasks recovered by the complete loop. Self-Direction produces substantial gains for both models across GAIA, Claw-Eval, and Terminal-Bench 2.1.

Why Self-Direction Uses Modular In-Weight Lessons

Self-Direction relies on two design choices. Each failure produces a distinct lesson adapter, and relevant experience is retrieved on a later task. We examine both choices on GAIA. We first compare failure-specific adapters with pooled, mismatched, and randomly initialized LoRA alternatives. We then quantify why retaining the complete learning history directly in context does not scale.

Lesson Specificity and Recovery

Adding or modifying existing parameters is useful only when it captures a lesson relevant to the failure being repaired. Figure 14 compares the complete Self-Direction policy with several alternative representations of the same failure-derived experience.

The full loop recovers 27.7% of the initial failures. A Dynamic LoRA adapter with Gaussian initialization instead of SVD initialization recovers 22.2% of the initial failures. A textual Skills.md memory has a recovery rate of 18.1%, showing that explicit textual lessons can provide useful immediate guidance. However, a single pooled LoRA recovers only 16.7% and 14.6% of attempted failures at ranks 16 and 64, respectively. Deliberately applying a mismatched adapter by choosing the least similar one reduces recovery further to 9.6%, which is lower than the recovery rate of base retrying with pass@2.

These results offer evidence that the benefit does not arise from inserting an arbitrary parameter update or increasing adapter capacity. Recovery is strongest when the learned lesson remains aligned with the failure that produced it.

Why Not Place Every Lesson in Context?

Textual memory is useful but accumulating every lesson in the active context is not a scalable form of persistence. The 101 failures in the GAIA Self-Direction run produce 2,428 corrective examples: 672 from Level 1, 1,323 from Level 2, and 433 from Level 3. Using the Qwen3.6 tokenizer, their instruction-response content is estimated to contain approximately 362k tokens, implying that each self-reflection loop produces an additional ∼ 3.6k tokens per failure. Including that formatting and stored rationales increases this total to approximately 410k tokens.

This already exceeds the model’s native 262,144-token context window. Moreover, the run reserves up to 16,384 tokens for generation, leaving at most 245,760 tokens for the input. Even the pooled synthesized responses across all failures require approximately 276k tokens, before including their instructions, the current task, system instructions, tool definitions, or the agent’s ongoing trajectory.

Stored contentApproximate tokensNative context windows
Full trajectories for 101 failures2.72M10.4×
Truncated failure representations188K0.72×
2,428 lesson instruction-response pairs362K1.38×
Lessons with formatting and rationales410K1.56×
Full trajectories and lessons3.13M11.9×

Table 8 (PDF p. 28). Context required to retain the complete GAIA learning history. Counts use the Qwen3.6 tokenizer. Totals are rounded because this section is intended as a capacity analysis.

The failed executions are larger still. Their full trajectories contain approximately 2.72M tokens. The compact representations supplied to lesson synthesis contain 188K tokens after truncation but combining even these compact failures with the generated lessons requires approximately 599K tokens. Retaining the complete failure trajectories and lessons would require roughly 3.13M tokens, or nearly twelve native context windows. The summary of this analysis is presented in Table 8.

The implication is not that textual memory is ineffective. The Skills.md baseline demonstrates that a small, relevant textual lesson can improve recovery. Rather, a continually growing agent cannot reinsert its entire learning history on every task. It must select a small amount of relevant experience. Self-Direction performs this selection over modular lesson adapters, enabling acquired lessons to persist without occupying the active prompt context.

Agent Execution and Training Hyperparameters

We use the same agent-generation and adapter-training configuration across benchmarks unless stated otherwise. This section separates the parameters governing task execution from those used to construct each modular lesson adapter.

Agent Generation and ReAct Execution

The agent operates through a ReAct-style loop (Yao et al. (2022)) that interleaves model decisions with environment interaction. At each step, the model receives the task and accumulated trajectory, then emits either a tool call or a final response. A tool call is executed by the environment, its observation is appended to the trajectory, and the model is invoked again. A rollout terminates when the model provides a final answer or exhausts its interaction budget.

The same decoding configuration is used for the initial base execution, adapter-guided retry, and base fallback (see Table 9, Table 10). The larger Terminal-Bench budget accommodates longer coding and environment-manipulation tasks. These values are upper bounds: A rollout terminates early whenever the agent completes the task or emits a final answer without any tool calls.

HyperparameterGAIA / Claw-EvalTerminal-Bench 2.1
Temperature0.60.6
Top-pp0.950.95
Maximum new tokens per turn16,38416,384
Maximum ReAct steps50100
Maximum tool calls100100
Stop generation after tool callYesYes

Table 9. Agent generation and interaction hyperparameters. The token limit applies independently to each model turn within the ReAct loop, rather than to the complete task trajectory.

ComponentHyperparameterValue
Corrective dataMaximum examples per failure24
Corrective dataMinimum examples required8
Corrective dataMaximum assistant-response length16,384 tokens
Corrective dataTrajectory steps retained for reflection24
LoRARank rr16
LoRAScaling parameter α\alpha16
LoRADropout0.05
LoRABias parametersNone
LoRATarget modulesFailure-dependent
SVD initializationInitialized factorAA from leading right singular vectors
SVD initializationTrainable factorBB only; initialized to zero
SVD initializationPower iterations2
SVD initializationOversampling dimension8
SVD initializationSVD deviceCPU, cached across lesson adapters
OptimizationLearning rate5×10−45 \times10^{-4}
OptimizationTraining epochs2
OptimizationPer-device batch size1
OptimizationGradient accumulation steps8
OptimizationEffective batch size8
Optimization OptimizationGradient checkpointingEnabled
OptimizationNumerical precisionBF16 when supported

Table 10. Adapter synthesis and training hyperparameters. These settings are shared across GAIA, Claw-Eval, and Terminal-Bench 2.1. Unlisted TrainingArguments retain their library defaults.

Adapter Synthesis and Training

Each failed execution produces up to 24 corrective examples. Adapter training begins only when at least eight valid examples are available. All base-model parameters remain fixed. Each lesson is represented by a rank-16 LoRA adapter initialized from the targeted base-model weights using the SVD procedure described in § 3. The first LoRA factor is initialized from the leading right singular vectors and frozen, whereas the second factor begins at zero and is optimized on the corrective examples.

The target modules depend on the normalized failure reason rather than the benchmark. Failures involving planning or interaction limits update the attention projections, q_proj and v_proj; incorrect answers and execution exceptions update the multi-layer perceptron (MLP) down_proj projection. This keeps the in-weight repair localized to the type of behavior implicated by the failure.

Reflection uses the same base model with temperature 0.6. Its maximum generation length is 16,384 tokens for all benchmarks. No external teacher model is used.

Failure normalization. We normalize each failure using the agent’s termination signal, the presence of an extractable response, and the binary verifier outcome. Budget exhaustion and execution exceptions take precedence over output-based labels. Otherwise, an empty response is assigned no_final_response, whereas a completed response rejected by the verifier is assigned wrong_answer. Table 11 summarizes the resulting vocabulary.

ReasonOperational definitionTarget modules
step_budgetThe agent reaches its maximum number of interaction steps before verified completion.q_proj, v_proj
tool_call_budgetThe agent exhausts its permitted tool calls before completing the task.q_proj, v_proj
no_final_responseThe execution ends without an extractable final response and was not terminated by a budget or exception.q_proj, v_proj
wrong_answerThe agent produces a response but the verifier rejects the resulting answer or environment state.down_proj
exceptionAn execution error prevents the agent from completing the task.down_proj

Table 11. Normalized failure reasons used by Self-Direction. Each categorical reason determines which projections are updated during adaptation.

The normalized reason, therefore, affects adaptation in two ways: It focuses reflection on the procedural deficiency exposed by the failure and determines where the resulting lesson is represented in the adapter. This routing is a lightweight localization prior rather than an assumption that planning and answer correctness reside in disjoint model components.

Information boundary. Normalized failure reasons are deliberately categorical and low-bandwidth. Let tt denote the agent’s termination status, ee indicate whether an extractable response was produced, and z=V(x,τ)∈{0,1}z = \mathcal{V}(x,\tau) \in\{0,1\} denote the verifier’s binary decision. The reason exposed to reflection and routing is

r=Normalize⁡(t,e,z).r = \operatorname{Normalize}(t,e,z).

The reference answer, hidden-test contents, and verifier-internal artifacts are not arguments to this function. In particular, rr contains neither gold-answer tokens nor test outputs, judge scores, rubrics, rationales, or free-form judge feedback. The loop observes only the categorical outcome of verification, not the information used internally to compute it.

We additionally enumerated every persisted reason value in the reported GAIA, Claw-Eval, and Terminal-Bench 2.1 runs. The observed values of rr were exclusively step_budget, wrong_answer, and exception; no stored reason contained task-specific text, answers, test results, scores, or judge feedback. Thus, the failure classification and module-routing decisions cannot communicate how to solve the task. They convey only a coarse description of how the preceding execution failed.

Adapter Training and Compute Requirements

Self-Direction performs a small amount of training only after a mistake is detected, triggering self-reflection and adapter training. Each reflection call produces ∼24\sim24 structured instruction-response examples. Measured with the Qwen3.6-27B tokenizer and the actual chat template used for training, these examples contain an average of 3,622 tokens per adapter. Rationales generated during reflection are retained for analysis but are not included in the training loss.

The fixed base model is adapted using rank-16 LoRA with SVD initialization. The LoRA AA matrices are initialized from cached right-singular directions of the corresponding base-model weights and remain frozen; only the BB matrices are optimized. Training uses two epochs, a per-device batch size of one, gradient accumulation over eight examples, BF16 precision, and gradient checkpointing on one NVIDIA H200. Thus, an average adapter processes approximately 7,244 token presentations across both epochs.

Measurement protocol. We report synthesis costs calculated from analyzing 46 GAIA failures, 39 Claw-Eval failures, and 45 Terminal-Bench 2.1 failures (130 in total). All stages execute sequentially on one NVIDIA H200. Synthesis time covers failure reflection and example generation, optimization time is the recorded trainer runtime, and end-to-end time extends from the beginning of reflection until the adapter is saved. The initial task execution and subsequent task-environment rollouts are excluded from these timings and reported separately in Figure 10.

Latency and energy. Reflection and data synthesis take 6.76 minutes, on average, on our setup, followed by 80.9 seconds (∼\sim 1.5 minutes) of adapter optimization. The complete post-failure construction process, therefore, takes 8.16 minutes, on average, and 6.95 minutes at the median. Average measured GPU energy is 30.4 Wh per adapter, comprising 26.6 Wh for synthesis and 3.68 Wh for optimization. Across the 130 measured adapters, this corresponds to approximately 17.7 H200 GPU-hours and 3.96 kWh of GPU energy. These measurements cover the GPU only and exclude host, storage, and datacenter overhead.

Trainable parameters and storage. The number of trainable parameters depends on the normalized failure reason and its corresponding target modules. Attention adapters that target q_proj and v_proj optimize 3.41M parameters, or 0.013% of the 26.90B-parameter base model. MLP adapters that target down_proj optimize 5.24M parameters, or 0.0195%. Thus, each repair trains at most approximately 0.02% additional parameters while leaving the base model fixed.

Because the frozen SVD-initialized AA matrices must also be retained, the complete adapter tensors contain 6.03M parameters for attention repairs and 23.07M parameters for MLP repairs. Their serialized weight files occupy 23.0 MiB and 88.0 MiB, respectively. The recorded artifact directories occupy 42.1–107.1 MiB because each directory also contains an identical 19.1 MiB tokenizer file; this shared file can be stored once when maintaining an adapter library.

Approximate optimization FLOPs. Let N=26.90BN = 26.90\mathrm{B} denote the number of base-model parameters and D=2×3,622=7,244D = 2 \times3{,}622 = 7{,}244 denote the average number of token presentations across two epochs. A forward pass through the base model costs approximately 2ND2ND. Backpropagation must propagate activation gradients through the fixed base model but does not compute updates for its weights, giving an approximate training cost of

Cadapter≈4ND≈7.8×1014 FLOPs=0.78 PFLOPsC_{\mathrm{adapter}} \approx4ND \approx7.8 \times10^{14}\ \mathrm{FLOPs} = 0.78\ \mathrm{PFLOPs}

per adapter, before the comparatively small LoRA and optimizer overhead. For reference, applying the conventional full-parameter training approximation of 6ND6ND yields a conservative upper bound of approximately 1.17 PFLOPs. These are analytical estimates rather than hardware-counter measurements; the latency and energy values in Table 12 are measured directly.

BenchmarkAdaptersTraining tokens per adapterSynthesis (min)Optimization (s)End-to-end (min)GPU energy (Wh)
GAIA464,0598.5180.99.8937.0
Claw-Eval393,7095.8280.37.1926.5
Terminal-Bench 2.1453,1005.7981.47.2227.1
Overall1303,6226.7680.98.1630.4

Table 12. Cost of constructing a modular lesson adapter. Values are averages over 130 failures across the three benchmarks. End-to-end latency includes reflection, data preparation, optimization, and adapter serialization on one NVIDIA H200. Energy denotes measured GPU energy over the same interval.

Benchmark Tool Interfaces

Each benchmark is evaluated using its native interaction interface. The initial base execution, adapter-guided retry, and base fallback receive the same tools. Hence, improvements cannot arise from exposing additional capabilities after failure. During reflection, Self-Direction also receives the tools available in the failed execution, enabling it to generate corrective examples that refer to valid actions.

GAIA uses a fixed collection of general-purpose research and file-processing tools. Claw-Eval exposes task-specific subsets of a larger service-oriented tool collection and its nine sandbox tasks provide shell and file-manipulation tools in addition. Terminal-Bench 2.1 exposes a single persistent shell inside a fresh task container (see Table 13).

BenchmarkAvailable tools
GAIAweb_search, web_fetch, python_exec, shell, file_read, file_open, and list_dir. These tools support web research, numerical computation, shell commands, directory inspection, and extraction from text, PDF, spreadsheet, HTML, and image files.
Claw-EvalEmail and contacts: gmail_list_messages, gmail_get_message, gmail_save_draft, gmail_send_message, contacts_search, contacts_get, and contacts_send_message. Calendar, tasks, and scheduling: calendar_list_events, calendar_get_event, calendar_create_event, calendar_get_user_events, calendar_delete_event, todo_list_tasks, todo_get_task, todo_update_task, todo_create_task, todo_delete_task, scheduler_list_jobs, scheduler_get_job, scheduler_job_history, scheduler_create_job, scheduler_update_job, and scheduler_delete_job. Business services: finance, CRM, inventory, reporting, helpdesk, and integration-management tools for listing, inspecting, updating, and creating benchmark entities. Knowledge and content: kb_search, kb_get_article, kb_update_article, notes_list, notes_get, notes_share, rss_list_feeds, rss_list_articles, rss_get_feed, rss_get_article, rss_publish, web_search, and web_fetch. Documents and media: documents_extract_text, ocr_extract_text, and caption_describe_image. The nine sandbox tasks additionally expose Bash, Read, Write, Edit, Glob, and Grep inside an isolated workspace.
Terminal-Bench 2.1terminal_shell, which executes Bash commands inside a fresh, task-specific Podman container. Commands share a persistent filesystem for the duration of an attempt and return their exit code, standard output, and standard error. The shell supports inspecting files and processes, editing or creating artifacts, installing dependencies, compiling software, configuring services, and running agent-authored validation checks.

Table 13. Tool interfaces used by each benchmark. The Claw-Eval row reports the union of tools across the evaluated tasks; each individual task exposes only its task-specific subset. Tool names are shown as presented to the agent.

For Terminal-Bench, each adapter or base retry begins in a fresh container to prevent filesystem changes from a previous attempt from leaking into the next one. Claw-Eval similarly relies on the official benchmark services and audit logs. GAIA retries retain access to the same task attachments and general-purpose tools. Thus, Self-Direction changes how the agent uses an existing interface, rather than changing the interface itself.

Self-Direction Loop

The Self-Direction loop has three main steps: 1) reflect on a failure to produce a textual lesson, 2) distill the lesson into a LoRA adapter, and 3) load the adapter into the model for a retry. The following Python pseudocode implements the high-level steps, including retrieval of existing lessons and the base retry fallback:

lesson_library = []
SIM_THRESHOLD = tau
LIBRARY_CAP = C

def self_direction(base_model, task, failure_trace):
    lesson, similarity = retrieve_best(
        task, lesson_library
    )

    if lesson is None or similarity < SIM_THRESHOLD:
        lesson = None

        # Learn only while the bounded library has capacity.
        if len(lesson_library) < LIBRARY_CAP:
            reason = normalize_failure(failure_trace)
            lessons = reflect(
                base_model,
                task,
                failure_trace,
                reason,
                REFLECTION_PROMPT,
            )

            adapter = train_lora(
                freeze(base_model), lessons
            )
            lesson = register(
                adapter,
                retrieval_key=embed(task),
                source_task=task,
            )
            lesson_library.append(lesson)

    # Retry using either a retrieved or newly learned lesson.
    success = False
    if lesson is not None:
        adapted_model = load_adapter(
            base_model, lesson.adapter
        )
        success, _ = agent(
            adapted_model, task
        )
        unload_adapter(adapted_model)

    # Fall back to the clean, fixed base model.
    if not success:
        success, _ = agent(
            base_model, task, RETRY_PROMPT
        )

    return success

Prompt Templates

Self-Direction uses the same base model for task execution and failure reflection. Prompts are specialized to each benchmark’s tools and success conditions but share the common structure shown next. We present generic versions for readability first; benchmark-specific prompts are presented in the following subsection G.3.

Task-Execution System Prompt

The execution prompt defines a ReAct-style interaction protocol. At each turn, the agent either emits one tool call and waits for its result or terminates with a final answer. Tool observations are appended to the trajectory before the next model invocation.

Task-execution system prompt

You are a careful agent working in [ENVIRONMENT]. Reason step by step and use the provided tools when they help.

Tool-use protocol:

  • Emit one tool call per turn using the required tool-call format, then stop generating.

  • Wait for the tool result before deciding the next action.

  • Inspect tool outputs and errors before proceeding.

  • Avoid repeating actions that do not advance the task.

  • Respect the available step and tool-call budgets.

Completion protocol:

  • Verify that the requested answer or environment state has been produced before stopping.

  • When the task is complete, end with: Final Answer: [ANSWER OR DONE]

GAIA specializes this template for short-answer problem solving. Terminal-Bench exposes a container shell and emphasizes verifying filesystem or program state. Claw-Eval supplies task-specific tools, whereas MiniWoB++ describes accessibility-tree observations and browser actions.

Failure-Reflection Prompt

After a verified failure, the base model acts as its own teacher. It receives the task, normalized failure reason, available tools, and a compact rendering of the failed trajectory. The prompt includes neither the correct answer nor any hidden tests.

The self-reflection stage produces structured instruction–response examples rather than an unconstrained textual critique. These examples teach the procedure that was missing from the failed execution and become the training data for the modular lesson adapter. These examples are not full model rollouts.

Failure-reflection prompt

You are a teacher model for continual agent learning.

A student agent attempted a task using tools and failed. Generate training examples that teach the PROCEDURE needed to solve this class of task. Do not teach the student to memorize the tools or answers.

NO ANSWER LEAKAGE:

  • Do not copy a task-specific answer, hidden solution, verifier rule, or final artifact into a response.

  • Teach how to derive or verify the answer instead.

Each example should teach:

  • which tools to use and in what order;

  • what queries, commands, or inputs to provide;

  • how to interpret observations and tool results;

  • how to recover from ineffective actions;

  • when enough evidence has been collected to stop.

Use the failed trajectory as evidence of the missing skill. Vary the examples across related situations so that the lesson describes a general procedure rather than one trajectory.

Return only a JSON array with exactly [N] objects: [ { "instruction": "...", "response": "...", "rationale": "..." } ]

TASK (x): [TASK]

FAILURE REASON (r): [FAILURE REASON]

FAILURE-SPECIFIC FOCUS: [GUIDANCE FOR WRONG ANSWER, STEP BUDGET, TOOL BUDGET, OR MISSING FINAL RESPONSE]

AVAILABLE TOOLS: [TOOL NAMES OR BENCHMARK TOOL DESCRIPTIONS]

FAILED TRAJECTORY (t): [COMPACT SEQUENCE OF ACTIONS, OBSERVATIONS, ERRORS, AND FINAL OUTPUT]

Benchmark-Specific Prompt Specializations

The generic templates above are instantiated by fixed benchmark-specific system prompts. These prompts are shared across tasks and runs within each benchmark; only the benchmark task, current observation, attachment, and task-local tool schema vary. To make these differences explicit, we reproduce the principal benchmark-specific clauses below. The bracketed benchmark names are editorial labels; the prompt text itself is reproduced verbatim.

Benchmark-specific execution clauses

[GAIA]

You are a careful problem solver working on GAIA benchmark tasks. Reason step by step and use the provided tools when they help.

Final answer protocol:

  • When you are ready, respond with concise reasoning followed by a single line beginning with ’Final Answer:’ on the last line.

  • The answer should be in the simplest form the question asks for (a number, a short string, or a comma-separated list).

[Terminal-Bench 2.1]

You are completing a Terminal-Bench task inside an isolated Linux container.

Use ‘terminal_shell’ to inspect the environment, create or edit files, install or configure software when necessary, and verify your work. Commands start in the task image’s working directory and filesystem changes persist throughout this attempt.

  • Check command exit codes and inspect relevant outputs or artifacts.

  • Do not look for benchmark tests, verifier files, reward files, or solutions. They are intentionally unavailable during the attempt.

When the requested state has been produced and checked, end with "Final Answer: done".

[Claw-Eval]

You are running Claw-Eval tasks through the official Claw-Eval harness. Use the provided benchmark tools directly and complete the user’s request. The benchmark grades the full trace, service audit logs, generated artifacts, and final response, not just a short final answer.

- Tool names are case-sensitive. Use exactly the names shown in the tool list.
- Do not claim that you performed an action unless you actually used the relevant tool or verified the artifact/state.

Stopping:
- When the task is complete, provide the requested result clearly. If the task asks for a report, classification, draft, or plan, put that content in your final assistant message.
[MiniWoB++]

You are controlling a browser for a MiniWoB++ task. Reason step by step.

Each observation contains:
  goal: <what to accomplish>
  url:, reward:, terminated:, truncated:[, last_action_error:]
  page: an accessibility tree where every interactive element has a bid.

- Use bids that appear in the current ‘page:‘ tree; never invent bids. If ‘last_action_error:‘ is set, do not repeat the same call—choose a different bid or re-observe. Avoid repeated scroll/wait loops.

Stopping:
- When an observation shows ‘terminated: True‘ with ‘reward >= 0.5‘, respond with a single line: ‘Final Answer: done‘. Do not invent any other final answer.

The reflection prompt is specialized in the same way. GAIA uses the generic failure-reflection system prompt shown above without an additional benchmark-specific override. The other benchmarks replace it with prompts that encode their observable state and explicitly exclude information unavailable to the agent as shown below.

Benchmark-specific reflection constraints

[Terminal-Bench 2.1]

Use only the task instruction and the agent’s terminal trajectory as evidence. The hidden verifier, benchmark tests, oracle solution, and reward implementation are unavailable and must not be guessed or reconstructed.

Vary examples across related tasks. Do not copy task-specific answers, secrets, exact final artifacts, hidden checks, or an oracle command sequence.

[Claw-Eval]

Use the failed trajectory as evidence of which agent skill was missing.

CRITICAL RULES:
  • Do not copy a task’s reference solution or grader rubric into the response.

  • Do not hardcode specific fixture answers unless the failed trajectory itself shows how to derive them from tools/files.

[MiniWoB++]

Use the trajectory as evidence of which browser skills the agent lacked or misapplied rather than guessing bids.

CRITICAL RULES:

  • Do not copy specific numeric bids, autocomplete picks, or other seed-specific values from the trajectory into the response. Bids change across seeds; teach the agent how to FIND the right element by role + name, not which integer to type.

Adapter Retry and Base Fallback

If the adapter-guided retry is unsuccessful, a final retry is attempted with the base agent, with a short instruction appended to the original prompt:

Retry instruction appended for the base fallback

You already tried this task once and produced an incorrect answer. Please try again.

For Claw-Eval, the final sentence also asks the agent to verify the result before stopping. During the adapter-guided retry, the selected modular adapter is active. If that attempt fails, the adapter is fully unloaded and the same task and retry suffix are presented to the base model. No reflection examples or adapter outputs are inserted into the fallback context. This isolates the fallback as an ordinary base-model retry while preserving the same failure-conditioned instruction.

Qualitative Analysis of Forward Transfer

The quantitative transfer results show that stored lesson adapters can improve later tasks. We now examine what these adapters appear to transfer qualitatively. Across GAIA and Claw-Eval, the strongest examples share a procedural structure – such as pagination, cross-system reconciliation, or exact-value verification – even when their topics, difficulty levels, or task categories differ. Figure 15 shows recovery with Self-Direction on a Level 1 task in GAIA. Examples of generated reflections are shown in the following section (Appendix § 14).

Transfer Within an Online GAIA Stream

The GAIA deployment experiment in § 4.4 interleaves all 165 tasks across difficulty levels and enables the agent to retrieve only adapters learned earlier in the stream. Across the three routing thresholds, existing adapters are selected for 282 later failures and produce 41 successful adapter-conditioned retries. Thirty of these successes cross GAIA difficulty levels. Same-level and cross-level retrievals have nearly identical success rates, 14.7% and 14.5%, suggesting that benchmark difficulty is not the natural boundary of a reusable lesson.

Table 14 presents representative transfers. In each case, the source and target differ in surface content but require a related sequence of actions or verification strategy.

Source adapterLater targetShared procedureObserved recovery
ORCID publication aggregation (Level 3)Wikipedia revision counting (Level 2)Traverse a complete remote history, handle pagination, apply a date constraint, and verify completeness before counting.Initial answer: 2610. Adapter answer: 2732 (correct).
BBC Earth video lookup (Level 1)Exact quotation from another video (Level 1)Identify the correct video and extract a localized fact using descriptions, timestamps, comments, or other supporting metadata.The initial execution exhausted its step budget; the adapter returned the exact quotation.
Spreadsheet aggregation (Level 1)Statistics over values extracted from an image (Level 2)Extract structured values, inspect intermediate data, compute with a tool, verify the calculation, and format only after validation.Initial answer: 2.404. Adapter answer: 17.056 (correct).
Caesar-cipher decoding (Level 2)Text-grid reconstruction (Level 1)Apply a text transformation, check linguistic coherence, and preserve exact capitalization, spacing, and output constraints.The initial execution recovered the meaning but violated formatting; the adapter returned the exact required sentence.

Table 14. Representative transfers in the shuffled GAIA stream. Every source task occurs before its target in the stream. The examples illustrate procedural reuse across topics, modalities, and difficulty levels.

These examples suggest that the adapters can encode procedures rather than task-specific guidance. The spreadsheet adapter, for example, transfers from tabular sales data to numerical values embedded in an image. The shared behavior is not the input modality but the discipline of extracting, checking, computing, and formatting. Similarly, the ORCID adapter transfers from publication records to Wikipedia revisions because both tasks require complete pagination and verified counting.

An adapter can also become useful even when it does not repair its source task. The first ORCID adapter fails its own adapter-guided retry, yet later produces 14 successful retries in the most permissive routing condition. Success on the source evaluation is, therefore, not a complete measure of whether the learned procedure will be useful elsewhere.

Cross-Category Transfer on Claw-Eval

The Claw-Eval experiment in § 4.4 provides a cleaner category shift. We freeze a library of three adapters learned from English operations (ops) tasks and evaluate it on 24 unseen workflow tasks in the original benchmark. The base model solves 18/24 tasks. On the six initially encountered failures, retrieved operations adapters solve three, increasing final accuracy to 21/24 (87.5%).

The successful transfers involve related coordination procedures despite the source and target belonging to different benchmark categories. Table 15 summarizes the three recovered workflows.

Source operations lessonTarget workflowShared procedureGrader score change
Scheduled-task managementWeekly meeting trackingCollect status across multiple records, identify missing or incomplete actions, and produce a structured progress report.0.413 → 0.946
Month-end reconciliationTask backtrackingReconcile evidence across emails, task lists, and meeting notes; identify discrepancies and report status, blockers, and next actions.0.674 → 0.894
Scheduled-task managementMulti-project progress reportingAggregate task status across several projects, identify risks, and organize the results into separate actionable reports.0.586 → 0.890

Table 15. Qualitative cross-category transfer from Claw-Eval operations tasks to unseen workflows. Scores are assigned by the Claw-Eval grader. No workflow adapter is trained before evaluation.

The scheduled-task adapter transfers to two workflows because all three tasks require auditing distributed state, identifying incomplete work, and producing a structured report. The reconciliation adapter similarly transfers beyond finance: Its useful behavior is gathering corresponding records from several systems, resolving inconsistencies, and summarizing the resulting status.

Interpretation. Together, these examples support the view that modular lesson adapters can preserve helpful procedural lessons and make them available in new contexts. The strongest cases are those in which the source and target share an identifiable workflow, even when their topics, modalities, difficulty levels, or benchmark categories differ.

Qualitative Examples of Failure-Conditioned Self-Direction

The examples generated during reflection do not simply reproduce the failed task, nor are they full, expensive rollouts. Instead, they express a reusable corrective procedure that addresses the underlying failure across varied situations. Next, we trace one task from each primary benchmark for which the base execution failed and the adapter-guided retry succeeded. Excerpts are shortened for readability but are drawn directly from the saved run artifacts.

GAIA: Structured extraction from audio.

Task. The agent was asked to transcribe an attached strawberry-pie recipe and return only the filling ingredients as an alphabetized, comma-separated list without measurements.

Failure. The base agent returned generic ingredient names such as “lemon juice” and “vanilla extract,” omitting the required qualifiers “freshly squeezed” and “pure,” and introduced extraneous formatting. The answer, therefore, did not match the required list and was recorded as incorrect.

Generated lesson. Self-reflection produced examples covering a general audio-to-structured-data procedure: Transcribe the recording, isolate the requested section, exclude irrelevant categories, remove quantities, normalize and sort the extracted items, and verify the required output format. One example asks the agent to extract only the dry ingredients from a baking recording while excluding measurements and returning an alphabetized list.

Outcome. The resulting adapter returned the exact expected ingredient list and recovered the task.

Claw-Eval: Completing evidence-grounded research.

Task. The agent was asked to evaluate a migration from Redis to Valkey, covering the Redis license change, Valkey’s governance, technical compatibility, cloud support, migration experiences, and project health.

Failure. The base execution spent its execution repeatedly searching and fetching sources but ended without synthesizing the requested report.

Generated lesson. The reflective examples taught a more robust research workflow: Broaden queries when search returns no results, pivot to authoritative URLs when retrieval fails, cross-check technical claims, map collected evidence to every requested section, and reserve sufficient time for synthesis. For example, one generated instruction asks what to do when an initial technical search returns no results; its response recommends reformulating the query, trying authoritative sources directly, and avoiding unsupported conclusions.

Outcome. The adapter-guided retry completed the requested technical evaluation and passed the Claw-Eval verifier.

Terminal-Bench 2.1: Verifying a multi-service deployment.

Task. The agent had to configure a Git server over SSH, deploy the main and dev branches through a post-receive hook, and serve both through distinct HTTPS endpoints.

Failure. The base execution exhausted its step budget without establishing a working end-to-end deployment. The subsequent test encountered an invalid repository state—including “remote HEAD refers to nonexistent ref”—and failed.

Generated lesson. Self-reflection produced examples emphasizing observable verification rather than assumed success: Inspect effective SSH and Nginx configurations, confirm canonical ports, validate the bare repository with git ls-remote, instrument the deployment hook, and reproduce the complete clone-commit-push-fetch workflow from a clean directory. One example explicitly instructs the agent to reproduce the complete end-to-end workflow and verify the returned page contents against the task requirements before declaring completion.

Outcome. The adapter-guided retry correctly deployed both branches and the complete evaluator test passed.

Together, these cases illustrate that Self-Direction extracts different forms of procedural knowledge from different failures: precise information extraction on GAIA, evidence-grounded task completion on Claw-Eval, and systematic end-to-end verification on Terminal-Bench 2.1.

Benefits of SVD Initialization

Initializing matrix AA with SVD and keeping it frozen offers two benefits: It further reduces the number of trainable parameters in an already lightweight adapter and anchors adaptation in a high-energy subspace of the pretrained model (Ren et al., 2026). Initializing matrix BB to zero makes the adapter an exact no-op before training. Freezing the base model confines learning to a small, failure-specific set of adapter parameters. Only the adapter’s BB matrices are trained, adding trainable parameters equivalent to at most approximately 0.02% of the base model’s parameter count. The failure type also determines where the repair is applied: Planning and budget failures target attention projections, whereas incorrect-answer failures target MLP projections.

In our final configuration, AℓA_\ell is initialized from a rank-rr high-energy right-singular subspace of the frozen base weight, Bi,ℓB_{i,\ell} is initialized to zero, and AℓA_\ell remains frozen. Only Bi,ℓB_{i,\ell} is optimized:

Di={(uj,vj)}j=1Ni,ϕi⋆=arg⁡min⁡ϕi 1Ni∑j=1Ni[−log⁡pθ,ϕi(vj∣uj)],θ fixed.D_i = \{(u_j, v_j)\}_{j=1}^{N_i}, \qquad\phi_i^\star= \underset{\phi_i}{\arg\min}\ \frac{1}{N_i}\sum_{j=1}^{N_i}\left[-\log p_{\theta,\phi_i}(v_j \mid u_j)\right], \qquad\theta\ \text{fixed}.

Here, ϕi\phi_i denotes the trainable parameters of the new adapter. For each of the NiN_i corrective examples, uju_j denotes a training instruction and vjv_j its desired procedural response. pθ,ϕi(vj∣uj)p_{\theta,\phi_i}(v_j \mid u_j) is the probability the adapted model assigns to response vjv_j given instruction uju_j.

SVD provides a shared coordinate system for repair. For a base weight matrix WW, lesson adapter ii induces the update

Wi=W+ΔWi,ΔWi=BiA,W_i = W + \Delta W_i, \qquad\Delta W_i = B_i A,

where AA is initialized from a rank-16 slice of the base weight’s high-energy spectral band and remains fixed during training. Only BiB_i is learned from the reflective examples for failure ii. The selected subspaces capture approximately 16–22 times as much base-weight energy as random subspaces of the same dimension. Thus, different lesson adapters are trained within a compact set of input features that are already prominent in the pretrained model.

Importantly, the learned update does not simply amplify the corresponding base weights. Although its input directions are inherited from the base model, its output directions are largely new. One interpretation is that the adapter recognizes familiar pretrained features but learns to route them toward behavior that would have prevented the observed failure.

References

  1. [1]Lakshya A. Agrawal, Shangyin Tan, Dilara Soylu, Noah Ziems, Rishi Khare, Krista Opsahl-Ong, Arnav Singhvi, Herumb Shandilya, Michael J. Ryan, Meng Jiang, Christopher Potts, Koushik Sen, Alexandros G. Dimakis, Ion Stoica, Dan Klein, Matei Zaharia, and Omar Khattab. GEPA: Reflective prompt evolution can outperform reinforcement learning. In Proceedings of the International Conference on Learning Representations, 2026. Oral. arXiv:2507.19457.arxiv.org/abs/2507.19457
  2. [2]Ekin Akyürek, Mehul Damani, Adam Zweiger, Linlu Qiu, Han Guo, Jyothish Pari, Yoon Kim, and Jacob Andreas. The surprising effectiveness of test-time training for few-shot learning. In Proceedings of the International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pages 942–963. PMLR, 2025.arxiv.org/abs/2411.07279
  3. [3]Shengnan An, Zexiong Ma, Zeqi Lin, Nanning Zheng, Jian-Guang Lou, and Weizhu Chen. Learning from mistakes makes LLM better reasoner. March 2024. arXiv:2310.20689 [cs.CL].arxiv.org/abs/2310.20689
  4. [4]Anthropic, Jun 2026. https://claude.com/blog/complete-guide-to-building-skills-for-claude.
  5. [5]Seungju Back, Dongwoo Lee, Naun Kang, Taehee Lee, S. K. Hong, Youngjune Gwon, and Sungjin Ahn. Understanding LoRA as knowledge memory: An empirical analysis. In Proceedings of the International Conference on Machine Learning, June 2026.arxiv.org/abs/2603.01097
  6. [6]Chaithanya Bandi, Razvan-Gabriel Dumitru, Ben Hertzberg, Divyansh Agarwal, Geobio Boo, Tejas Polakam, Sami Hassaan, Jeff Da, HiJae Kim, Vipul Gupta, et al. MCP-Atlas: A large-scale benchmark for tool-use competency with real MCP servers, 2026. arXiv:2602.00933 [cs.SE].arxiv.org/abs/2602.00933
  7. [7]Bradley Brown, Jordan Juravsky, Ryan Ehrlich, Ronald Clark, Quoc V. Le, Christopher Ré, and Azalia Mirhoseini. Large language monkeys: Scaling inference compute with repeated sampling. arXiv preprint arXiv:2407.21787, 2024.arxiv.org/abs/2407.21787
  8. [8]Tingyan Chen, Shuo Lu, Kang Zhao, Weicheng Meng, Hanlin Teng, Tianhao Li, Chao Li, Xule Liu, Jian Liang, Zhihong Zhang, et al. HarnessX: A composable, adaptive, and evolvable agent harness foundry. arXiv preprint arXiv:2606.14249, 2026.arxiv.org/abs/2606.14249
  9. [9]Gen Dong, Yanjie Gao, Liqun Li, Tianyin Xu, Yu Hua, and Fan Yang. Agent skills can be harmful: An empirical study of skill-induced failures in LLM agents. arXiv preprint arXiv:2608.11888, 2026.arxiv.org/abs/2608.11888
  10. [10]Gonzalo Gonzalez-Pumariega, Saaket Agashe, Jiachen Yang, Ang Li, and Xin Eric Wang. On the reliability of computer use agents. arXiv preprint arXiv:2604.17849, 2026.
  11. [12]Caglar Gulcehre, Tom Le Paine, Srivatsan Srinivasan, Ksenia Konyushkova, Lotte Weerts, Abhishek Sharma, Aditya Siddhant, Alex Ahern, Miaosen Wang, Chenjie Gu, Wolfgang Macherey, Arnaud Doucet, Orhan Firat, and Nando de Freitas. Reinforced self-training (ReST) for language modeling. arXiv preprint arXiv: 2308.08998, 2023.arxiv.org/abs/2308.08998
  12. [13]Sharut Gupta, Phillip Isola, Stefanie Jegelka, David Lopez-Paz, Kartik Ahuja, Mark Ibrahim, and Mohammad Pezeshki. ReasonCache: Teaching LLMs to reason without weight updates. arXiv preprint arXiv:2602.02366, 2026.arxiv.org/abs/2602.02366
  13. [14]Moritz Hardt and Yu Sun. Test-time training on nearest neighbors for large language models. In Proceedings of the International Conference on Learning Representations, 2024.arxiv.org/abs/2305.18466
  14. [15]Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. In Proceedings of the International Conference on Learning Representations, October 2022.arxiv.org/abs/2106.09685
  15. [16]Shengran Hu, Cong Lu, and Jeff Clune. Automated design of agentic systems. In Proceedings of the International Conference on Learning Representations, 2025.arxiv.org/abs/2408.08435
  16. [17]Pengcheng Jiang, Zhiyi Shi, Kelly Hong, Xueqiang Xu, Jiashuo Sun, Jimeng Sun, Hammad Bashir, and Jiawei Han. Harness-1: Reinforcement learning for search agents with state-externalizing harnesses. arXiv preprint arXiv:2606.02373, 2026.arxiv.org/abs/2606.02373
  17. [18]Seth Karten, Alex L. Zhang, Kevin Thomas, Sebastian Müller, and Prime Intellect Team. Prime agent: A self-improving RLM harness. Prime Intellect Blog, August 2026. https://www.primeintellect.ai/blog/prime-agent.arxiv.org/abs/2608.23552
  18. [19]Yoonho Lee, Roshen Nair, Qizheng Zhang, Kangwook Lee, Omar Khattab, and Chelsea Finn. Meta-harness: End-to-end optimization of model harnesses. arXiv preprint arXiv:2603.28052, 2026.arxiv.org/abs/2603.28052

Paper details

vlnc:W_sah8mnzs
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 10

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents