TL;DR
RASO optimizes agent skills (natural-language how-to docs) by retrieving sections from a public skill corpus and rewriting them for the target tool environment via Cross-Harness Adaptation, both when building the first skill and when fixing failures seen in rollouts.
Why It Matters
If you build LLM agents, you’ve probably written a skill.md or system prompt that tells the agent how to use your spreadsheet tools, your file system, your scoring rules. Getting that document right is slow: today’s skill optimization methods run the agent on training tasks, watch it fail, and have another LLM edit the doc, repeat. Each loop costs real rollouts (and real dollars).
Meanwhile, people have published millions of these skill docs on the open web (the paper points to GitSkills as a corpus). The obvious move, just retrieve a relevant one, mostly doesn’t work: a skill written for satellite imagery in numpy won’t translate to a spreadsheet task in Excel. The paper reports that on SpreadsheetBench, 92.9% of retrieved skills come from a mismatched Agent harness. The baseline SkillRouter, which retrieves and reuses directly, sometimes performs worse than giving the agent no skill at all.
So the field has two camps that don’t talk: optimize-from-your-own-rollouts (e.g. TextGrad, GEPA, SkillOpt, WikiSkill) and retrieve-from-corpus. RASO’s pitch is to use retrieval throughout optimization, but translate what you retrieve into the target environment’s vocabulary first.
How It Works
The core trick is treating a retrieved skill as procedural inspiration, not drop-in text. An adaptation agent reads the retrieved section plus a description of your task T and your harness H (available tools, file access, observation format, scoring rule), then emits a short “lesson” that strips source-specific nouns, drops steps whose tools don’t exist in your harness, and preserves tool/parameter claims only if your harness description confirms them. That lesson, not the raw retrieved text, flows into the skill document.
Retrieval itself is section-level, not document-level: skill docs are split by markdown headings, indexed, and queried with BM25, pulling top-K=5 sections per query. Section-level is important because a long doc might have one relevant subsection buried in otherwise irrelevant content.
Two stages share this retrieve-then-adapt pipeline:
•
RASI (initialization, no rollouts): a query-generation agent reads T and H and emits requirement-query pairs. Each requirement is some concrete thing the skill will need to handle (e.g. “multi-turn budget management”). Lessons are generated, then a skill-initializer agent assembles them into s_0.
•
RASU (update, with rollouts): run the current skill on a minibatch, look at failed trajectories, generate a textual gradient (what went wrong, in words) and a retrieval query per failure mode. Adapt the retrieved sections. The skill-updater agent merges current skill + gradients + lessons into a candidate, which is accepted only if it beats the current skill on validation.
s = RASI(task_desc, harness_desc, corpus) # no rollouts
for epoch in range(2):
for batch in minibatches(train):
trajs = run_agent(s, batch)
failures = [t for t in trajs if t.reward < 1]
queries, gradients = gen_queries(s, failures)
sections = [bm25(q, corpus, K=5) for q in queries]
lessons = [adapt(c, task_desc, harness_desc, sec)
for c, sec in zip(gradients, sections)]
s_new = update_skill(s, gradients, lessons)
if val_score(s_new) > val_score(s): s = s_new
What They Found
Evaluated on four benchmarks (OfficeQA, SpreadsheetBench, ALFWorld, WebShop) with two models (GPT-5.6-Luna and Qwen-3.5-9B). All numbers are task-success-style scores on held-out test splits.
•
Initialization alone matters. With zero rollouts, RASI beats retrieval-free LLM initialization (RFSI) on every benchmark/model combo, e.g. 45.74 vs 40.11 on OfficeQA with GPT-5.6-Luna, 23.27 vs 12.54 on WebShop with Qwen-3.5-9B. Naive retrieval (SkillRouter) is often below no-skill, confirming the mismatch problem.
•
Full RASO beats rollout-based optimizers. Against the strongest competitor per cell: +3.49 on OfficeQA, +6.31 on SpreadsheetBench, +1.49 on ALFWorld, +1.07 on WebShop (GPT-5.6-Luna). Qwen gains are larger on the hardest benchmarks: +7.47 on ALFWorld, +11.30 on WebShop.
•
Ablations. Removing adaptation (retrieve but don’t rewrite) drops SpreadsheetBench by ~7.7 points in RASI and ~5.5 in RASU. Both stages contribute independently and compose: RFSI+RFSU gets 40.70 on OfficeQA, adding RASI pulls it to 45.93, adding RASU pulls it to 47.56, both together to 49.03.
•
Retrieval size. K=5 is the sweet spot; K=10 slightly hurts, consistent with noise from marginal sections.
•
Corpus size. Even 1% of the corpus beats no retrieval, and gains keep growing with size, especially on SpreadsheetBench.
•
Cost. RASO uses the same rollout count as TextGrad/WikiSkill and fewer than GEPA/SkillOpt, and is cheapest in dollars on three of four benchmarks (e.g. $10.28 vs $41.03 for TextGrad on WebShop).
The authors attribute the gain to the adaptation step (shown by ablation), not to any specific retrieved document (shown by the corpus-size curve: diverse small subsets already help).
What’s Useful
•
If you maintain a prompt or skill document for an agent and currently iterate by hand or with pure rollout-based optimizers, adding a retrieval+adaptation step at init is cheap (no rollouts) and the paper shows it provides a materially better starting point. The main thing you need is a corpus of other people’s skill docs; GitSkills exists for this.
•
If you already run a rollout-based optimizer, the ablations suggest that swapping the update step for RASU gives extra lift on top of a better init, so the two stages are worth adopting together rather than one at a time.
•
The adaptation step is the load-bearing piece. If you prototype this yourself, don’t skip the “rewrite retrieved text in terms of my tools and strip anything my harness doesn’t support” prompt. Direct reuse (SkillRouter-style) was worse than no skill on several benchmarks here.
•
Worth testing before committing: whether your target domain has enough neighbor-domain skill docs in whatever corpus you can access. The paper’s blocklist procedure (exclude whole repos matching benchmark keywords) is a reasonable template to avoid accidental test contamination when the corpus is public.
•
The paper doesn’t release code in the supplied text, and doesn’t specify prompts for the adaptation or query-generation agents beyond the three adaptation principles listed. You’d be reimplementing from the described pipeline.
Caveats
•
All four benchmarks are agent-task benchmarks with well-defined scoring; it’s unclear how adaptation quality holds up for open-ended tasks where “correctness within the target harness” isn’t checkable.
•
The adaptation agent is itself an LLM call per retrieved query, which the cost table shows is cheap relative to rollouts but adds latency to initialization. For very large K or very large query sets this would change.
•
The models used (GPT-5.6-Luna, Qwen-3.5-9B) are described in the paper as 2026-era; the specific capability profile may differ from models you have. Qwen results on WebShop in particular jump from 13.43 to 24.73, which is a large relative gain but still a low absolute score.
•
The corpus-contamination guard is keyword-based at the repository level. The authors call it conservative, but there’s no evaluation of residual leakage, so some portion of the gain could in principle come from near-benchmark skills that evaded the filter.
•
All update methods were run for 2 epochs with a fixed minibatch; the paper doesn’t show what happens if rollout-based baselines are given a larger budget, so the comparison is at matched budget rather than matched final-performance.