acceptodds
Under review as a conference paper at ICLR 2027

From Traces to Programs: Learning Programmatic Skill Routing for LLM Agents

Abstract

Large Language Model (LLM) agents increasingly reuse skills distilled from prior experience, but deciding which skill to apply at each step of execution remains difficult. Existing approaches either provide all skills in context, increasing the reasoning burden during execution, or select skills by semantic similarity, conflating task relevance with applicability at the current step of execution. We introduce SCRIPT (Skill Composition and Routing via Interpretable Programmed Transitions), which represents experience as skill-level trajectories and separates local skill execution from global routing. Skills encode reusable procedures, while a coding agent learns an executable Python router from skill-level trajectories as execution unfolds. Minimum description length (MDL)-guided refinement favors compact routing programs, and a verifier evaluates each revision against cached routing decisions from prior and newly collected trajectories, without re-executing tasks. Separating skills from routing also enables failure attribution and repair. At deployment, the learned router selects skills directly without additional LLM calls. SCRIPT improves Success Rate over the strongest baseline by 21.1% on ScienceWorld and 11.5% on AppWorld while using up to 28.4 fewer learning tokens. With additional experience, verified router updates further improve task success while preserving prior routing decisions.

Primary area:
foundation or frontier models, including LLMs
Keywords:
LLM Agents, Skill Learning

Reviews

Among:
Shape:
1234this paper, Top 49%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.33 over 3 reviews, above 51% of the others.
Reviewer_JLGEOpenReview ↗
Rating
3(+1)
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

The paper studies skill construction, reuse, and the programmatic routing problem for skills, and proposes SCRIPT (Skill Composition and Routing via Interpretable Programmed Transitions). The paper reformulates the skill retrieval program as a planning problem using a route program. The proposed method first learns a skill library from expert trajectories. It then uses the skill library to relabel trajectories at the skill level. A coding agent generates a router program from the skill-level trajectories. At deployment, the router returns several skill-related action sequences, and the LLM decides whether to use the skill or an LLM-generated action. In failure mode, the LLM can diagnose and apply skill modification, library modification, and routing modifications to repair. The proposed method is evaluated on Science World and App World. SCRIPT is not only among the best but also uses far fewer tokens than the strongest baselines.

Critical strengths
  1. The method performs best on the training set and also generalizes well to unseen tasks. The router program's hierarchical structure and low-level skill actions enable this generalization. With the router program, the LLM also does not need to attend to the skill library or select an action from it. The LLM only needs to select the routed result to take actions; as a result, token usage will be much lower than the baselines.
Critical weaknesses
  1. The core limitation of the method is that it is not scalable. The router program is trained on tens of environments, but it is hard to imagine what it would look like if it learned from hundreds. Figure 4 shows that the method performs better with more data. I'd like to see token usage with more data to show how the method scales.
Questions for authors
  1. In deployment, the routing program will cooperate with the fallback LLM policy. I want to know how often the fallback policy is used. If the LLM fallback policy handles everything, your method reduces to an LLM agent. You need an action-distribution measurement of routing policies to justify your method.
  2. How do you get the training trajectories? Are they learned via RL, come from a teacher model, or come from human expert demonstrations? You are trying to learn a unified decision logic into a routing program. The data quality may affect your results. I would like to know whether the method is robust enough to handle mixed trajectory sources. Suppose there are 2 training data sources, A and B; you can learn the routing policies from A, B, and A plus B. Will the learned routing program change dramatically between training data sources?
  3. You provide an external anonymous code, but it only contains the README file.
  4. In section 3.3, your method (SCRIPT) minimizes the learning object with a coding agent. The program's search space is rigid and hard to optimize. Do you use an evolutionary search method like AlphaEvolve [1]?
  5. How is the router program executed? Does the LLM read the router program and observation, then execute it? For example, in Figure 2, there is a boolean function named needs_melting. Does the Science World environment provide this function? Or does an LLM read the router program and observation and give feedback? How is the boolean function implemented and executed? I ask because the created function may introduce additional computational overhead not reflected in token usage.
  6. Does one environment use a shared router program? If so, scaling may be hard. In the learning stage, the coding LLM will take many more tokens to construct the router program.

[1] Novikov, Alexander, et al. "AlphaEvolve: A coding agent for scientific and algorithmic discovery." arXiv preprint arXiv:2506.13131 (2025).

7 comments
AuthorsOpenReview ↗

Official Comment I

We thank the reviewer for the thoughtful review and for recognizing that SCRIPT generalizes well to unseen tasks and uses far fewer tokens than the baselines. Because the scalability analysis in W1 builds on how the router is learned, we first answer Q4 and Q5 on router generation and execution, and then address W1 and the remaining questions.

Q4. Details of the code router

We have revised Section 3.3 to clarify how SCRIPT learns the router. We first clarify that our aim is not to develop a new program search procedure. Our motivation is to formulate skill selection as a coding task with automated tests and feedback, allowing us to leverage the problem-solving capabilities of coding agents. Population-based methods such as AlphaEvolve rely on extensive LLM sampling, in part because their evaluators typically return aggregate scores for each candidate program rather than identifying which part of the program is wrong. SCRIPT’s cached verifier reports every routing error, including the predicted skill, the expected skill, and the source line that produced the prediction. This feedback helps the coding agent identify which parts of the router to inspect and revise. The agent can thus refine a single program through successive local edits, allowing SCRIPT to benefit directly from advances in coding agents. This formulation puts skill selection in a form that coding agents already handle well. The same ability to autonomously write, test, and revise code allows them tackle complex tasks, from fixing software issues (SWE-agent) to modeling interactive environments (ARC-AGI-3). We describe the program generation process below.

Training data. Every skill boundary in a trajectory yields one decision point (task, history) → skill, shown as points[i] in the diagram, and these points are the only data the coding agent receives. The objective is to write a function choose(task, history) that maximizes routing accuracy over all points with general and compact code, measured by the MDL score. A verifier runs choose on decision points and returns the MDL score, the accuracy, and each error with its gold skill, predicted skill, and source line, with no LLM call and no environment interaction. Together these form a complete workspace for an ordinary coding task, in which the agent only needs to focus on the conditions under which each skill applies and how skills are combined.

Authoring loop. In every turn the agent can write arbitrary Python code (regular expressions, frequency counts, and helper functions) or call workspace tools. It typically spends two to four turns inspecting the most common skills and their contexts to infer the shared conditions, and then writes an initial router. After every revision, the verifier runs the router on all training decision points and reports the MDL score, the routing accuracy, and a list of errors (input context, the predicted skill, the expected skill, and the source line that produced the prediction). The agent uses this feedback to edit the responsible conditions and reruns the verifier. Because verification needs only Python execution, the agent can test both complete router revisions and individual conditions as often as it wants. Over the session, the router gradually captures more of the rules that govern how skills are ordered and combined.

AuthorsOpenReview ↗

Official Comment II

WORKSPACE DATA   one point per skill boundary in a gold trajectory
  points[i] = {
    "task":    "Your task is to boil tin. ...",
    "history": [("action: go to kitchen", "observation: You move to the kitchen."), ...],
    "skill":   "heat-substance"                    # gold label = expected output
  }

INSPECT
  agent → workspace   for p in points: print(p["history"][-1], "->", p["skill"])
                      (or any Python: overview(), explain(i), Counter(...), regex tests, ...)
  workspace → agent   CONTEXT 1   ... observation: a glass cup (containing tin)   ->  heat-substance
                      CONTEXT 2   ... observation: a metal pot (containing lead)  ->  heat-substance
                      CONTEXT 3   ... observation: You move to the kitchen.       ->  acquire-thermometer
                      ...
                      ⇒ agent infers the shared condition of each skill
                        e.g. heat-substance: "the substance is in a container in hand"

DRAFT
  agent → workspace   def choose(task, history) -> skill | None
              
  workspace → agent   verifier: for each point, choose(p["task"], p["history"]) vs p["skill"]
                      (replays the data above — no LLM, no environment)
                        accuracy 0.927        MDL score
                        wrong:  gold skill          predicted          count  returned by  points
                                locate-substance    navigate-to-room   ×5     line 92      7, 20, …
                                report-result       heat-substance     ×5     line 78      9, 22, …

REPAIR
  agent → workspace   edit(old='...', new='...')   (or any Python)
  
  workspace → agent   edit applied · re-run on ALL points
                        accuracy 0.927 → 0.964   MDL score
                        wrong:  gold skill          predicted          count  returned by  points
                                report-result       heat-substance     ×5     line 78      9, 22, …

  agent → workspace   edit(old=..., new=...)          # a broader rule, to fix another group
  workspace → agent   edit applied · re-run on ALL points
   					...  

SELECT
  every version is logged; return the lowest-MDL version with accuracy ≥ 0.5, else the most accurate

(The inspect, draft, and repair stages are summarized from a logged session rather than fixed steps, and the agent decides at every turn what to run next and when to stop.)

Q5. Router execution

The router is a Python function that the interpreter runs directly. It takes the task instruction and execution history as input and returns the next skill ID or None. During router learning, the coding agent writes and revises the code, while a deterministic Python verifier runs it on cached decision points and reports any mismatches. At deployment, the learned router selects skills without an LLM call.

needs_melting in Figure 2 illustrates a helper function that the coding agent writes as part of the router. These helpers are part of the generated Python code and use string matching or regular expressions to extract relevant information from ScienceWorld’s text observations. Before using a helper in a routing rule, the coding agent checks its outputs across all cached training decision points.

W1. Scalability

To examine how programmatic routing scales with additional training data, we added an experiment covering three ScienceWorld task types (use-thermometer, measure-melting-point, and find-animal), with 636 training trajectories in total. We train SCRIPT’s skill libraries and routers using 30, 150, and all 636 trajectories, and compare SCRIPT with ACE and GoS at the 30- and 150-trajectory settings.

MethodTrajectoriesScoreLearning Input tokensLearning Output tokensLearning Time
SCRIPT3093.90.31M25k3 min
SCRIPT15092.81.08M88k8 min
SCRIPT63693.94.35M328k44 min
GoS3083.86.8M200k15 min
GoS15079.034M700k1.2 h
ACE3081.125.7M570k1.85 h
ACE15077.5279.4M1980k11.8h

The table below reports cumulative learning tokens as SCRIPT processes 636 trajectories in batches of up to 30.

Trajectories learned120240360480600636
Cumulative tokens1.01M1.51M2.37M3.28M4.25M4.68M

SCRIPT uses fewer tokens to learn from all 636 trajectories than either ACE or GoS uses to learn from 30. Meanwhile, GoS’s score drops from 83.8 to 79.0 as its training set grows from 30 to 150 trajectories.

AuthorsOpenReview ↗

Official Comment III

Four aspects of SCRIPT help explain this scaling behavior:

1. Compact, verified code vs. growing skill documents. As the skill library grows, methods that place all skills in context give the LLM longer prompts and more candidates to consider at each decision. In SCRIPT, the coding agent extracts rules shared across decision contexts, and the MDL objective favors compact programs that fit the recorded decisions. At test time, the router selects skills by executing a deterministic Python function without an LLM call.

2. Offline verification vs. repeated environment rollouts. Evaluating policy revisions through task rollouts requires repeated LLM calls and environment interactions. SCRIPT executes each router revision on cached decision points and compares its predictions with the demonstrated skill IDs. The coding agent can therefore test every edit against the full cache without additional LLM calls or environment rollouts during verification.

3. Parallel skill induction vs. sequential accumulation. ACE updates its playbook sequentially as it processes training trajectories. SCRIPT can induce skills from different groups of trajectories in parallel and verify the router offline. In our runs, SCRIPT learned from 636 trajectories in 44 minutes, while ACE took 11.8h to process 150 trajectories.

4. Shared rules across additional examples. SCRIPT turns skill selection into a coding task with automated tests and feedback, letting the coding agent use its ability to find patterns in data, express them as code, and refine them through testing. For common skills, the agent compares their decision contexts with those of easily confused skills to identify when each applies. For rare skills, it inspects the available examples to find the conditions for using them. A single rule can cover many decision points, so additional examples that follow a known pattern require no code changes. When new examples reveal a gap, the agent can revise the relevant rule and test the edit against all cached decisions.

Q1. Fallback usage

Learned skills handle most of the execution actions. On ScienceWorld, the fallback policy accounts for 11.1% of execution on Seen tasks and 17.9% on Unseen tasks, decreasing to 13.8% after evolution (Table 7 in Appendix A.5).

Q2. Source of training trajectories

Following ACE, Trace2Skill, and GoS, we use the gold trajectories provided with each benchmark, so all of these methods learn from identical experience.

To test robustness to the trajectory source, we keep the number of training trajectories per task type fixed and replace half of the gold trajectories with successful trajectories collected by a ReAct agent with the same backbone.

ScoreSuccess Rate(%)
Gold87.6880.49
Gold + ReAct88.2778.04

Replacing half of the gold trajectories with ReAct trajectories changes Score by +0.59 and Success Rate by −2.45 points, indicating that SCRIPT is robust to the trajectory source.

Q3. Code

The full code is now available at the anonymous link.

Q6. Router organization

We organize the routing programs according to the structure of each benchmark. In ScienceWorld, we learn one router per task type because different task types involve distinct goals and skills. In AppWorld, we learn a single router shared across all scenarios because they use the same set of apps and APIs. As discussed in our response to W1, the scaling results show that router learning remains practical as the number of training trajectories grows.

Thank you again for your thoughtful feedback. We hope the additional results and clarifications address your concerns.

Reviewer_ehCvOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper presents SCRIPT, a method for programmatic skill routing. The method turns trajectories into executable code skills, then learns a code-based skill router based on the skill-based trajectories. A verifier verifies the program through cached routing decisions. At test time, SCRIPT constructs the context for the code-based router to select the skills. A failure-attribution loop maps failures into three repair types: add skill, modify skill, or modify router. SCRIPT shows a good Success Rate improvement of 21.1% and 11.5% over the strongest baseline, with much lower learning and execution token cost.

Critical strengths
  1. The problem that the paper studies is timely and important. Skill and skill selection for agents is of interest to many researchers in this area. Using a program as a router instead of semantic-based approaches for skill selection is interesting and, to me, appears novel.

  2. The system appears to be self-contained, and the method puts great effort into validating and correcting the system both when building it and when testing it. The idea of using cached routing to do offline verification is interesting.

Critical weaknesses
  1. The central method requires further explanation. It appears to me that the main method for code-based skill routing is structured in a single paragraph: 'Routing program, deterministic verifier, and MDL-guided refinement'. It's difficult to understand how exactly the code agent writes and refines the program based on the skill-based trajectory given. Because the agent is actually refining the program instead of doing real gradient-based learning, it's also difficult to assess how the loss function is used to instruct the agent in refining the program.

  2. The gain of the method may not be easily attributed to programmatic skill routing, as the paper suggests. The system contains at least the following components: reusable executable skills, parameterized abstraction of trajectory, learned programmatic routing, and a different verification procedure. It is unclear how each component is contributing to the gains, considering the main baselines use substantially different experience representations and skill-execution mechanisms. Consequently, the improvements in Table 1 do not isolate the contribution of programmatic routing. Furthermore, it appears that in the correction of the system, 'modify skill' appears more frequently than 'modify router', so it can also be the case that the differences in the skills, instead of skill selection, contribute a lot to the gains.

Questions for authors
  1. There is a noticeable gap between the theoretical analysis and the empirical evaluation. The theoretical bound is based on trajectory-level routing disagreement, whereas the actual MDL objective and reported routing accuracy operate at the decision level. The paper does not establish a clear connection between these quantities or show how the bound explains the observed improvements in task success. Moreover, the bound appears potentially vacuous under realistic experimental settings, given the relatively small number of successful trajectories and the complexity of the learned routing programs. The authors should report the numerical tightness of the bound using actual experimental parameters and clarify its relevance to the proposed optimization objective and empirical results.

  2. While the cached routing-decision-based verification is interesting, it's not clear to me how the correction system handles unseen scenarios during test-time, since the cached routing decisions are all from offline data.

5 comments
AuthorsOpenReview ↗

Official Comment I

We thank the reviewer for the constructive feedback and for recognizing the novelty of programmatic skill routing. We address the reviewer’s comments below.

W1. Details of the code router

We have revised Section 3.3 to clarify how SCRIPT learns the router. We formulate skill selection as a coding task with automated tests and feedback, allowing us to leverage the problem-solving capabilities of coding agents.

From skill-level trajectories to training data. Every skill boundary in a trajectory yields one decision point (task, history) → skill, shown as points[i] in the diagram, and these points are the only data the coding agent receives. The objective is to write a function choose that maximizes routing accuracy over all points with general and compact code, measured by the MDL score. A verifier runs choose on decision points and returns the MDL score, the accuracy, and error list, with no LLM call and no environment interaction. Together these form a complete workspace for an ordinary coding task, in which the agent only needs to focus on the conditions under which each skill applies and how skills are combined.

Authoring loop. In every turn the agent can write arbitrary Python code (regular expressions and helper functions) or call workspace tools. It typically spends two to four turns inspecting the most common skills and their contexts to infer the shared conditions, and then writes an initial router. After every revision, the verifier runs the router on all training decision points and reports the MDL score, the routing accuracy, and a list of errors (input context, the predicted skill, the expected skill, and the source line that produced the prediction). The agent uses this feedback to edit the responsible conditions and reruns the verifier. Because verification needs only Python execution, the agent can test both complete router revisions and individual conditions as often as it wants. Over the session, the router gradually captures more of the rules that govern how skills are ordered and combined.

WORKSPACE DATA   one point per skill boundary in a gold trajectory
  points[i] = {
    "task":    "Your task is to boil tin. ...",
    "history": [("action: go to kitchen", "observation: You move to the kitchen."), ...],
    "skill":   "heat-substance"                    # gold label = expected output
  }

INSPECT
  agent → workspace   for p in points: print(p["history"][-1], "->", p["skill"])
                      (or any Python: overview(), regex tests, ...)
  workspace → agent   CONTEXT 1   ... observation: a glass cup (containing tin)   ->  heat-substance
                      CONTEXT 2   ... observation: a metal pot (containing lead)  ->  heat-substance
                      CONTEXT 3   ... observation: You move to the kitchen.       ->  acquire-thermometer
                      ...
                      ⇒ agent infers the shared condition of each skill
                        e.g. heat-substance: "the substance is in a container in hand"

DRAFT
  agent → workspace   def choose(task, history) -> skill | None
              
  workspace → agent   verifier: for each point, choose(p["task"], p["history"]) vs p["skill"]
                      (replays the data above — no LLM, no environment)
                        accuracy 0.927        MDL score
                        wrong:  gold skill          predicted          count  returned by  points
                                locate-substance    navigate-to-room   ×5     line 92      7, 20, …
                                report-result       heat-substance     ×5     line 78      9, 22, …

REPAIR
  agent → workspace   edit(old='...', new='...')   (or any Python)
  
  workspace → agent   edit applied · re-run on ALL points
                        accuracy 0.927 → 0.964   MDL score
                        wrong:  gold skill          predicted          count  returned by  points
                                report-result       heat-substance     ×5     line 78      9, 22, …

  agent → workspace   edit(old=..., new=...)          # a broader rule, to fix another group
  workspace → agent   edit applied · re-run on ALL points
   					...  

SELECT
  return the lowest-MDL version with accuracy ≥ 0.5

(The stages are summarized from a log rather than fixed steps.)

How the objective guides the agent. The MDL objective combines a code cost and an error cost. It guides both router refinement and final version selection. During refinement, the verifier reports each misrouted decision along with the predicted skill, the expected skill, and the source line that produced the prediction. This feedback helps the coding agent identify which condition to revise. The code cost penalizes case-specific fixes. This trade-off encourages the agent to find a condition that works across multiple contexts. At the end of the session, we select the lowest-MDL version with accuracy ≥ 0.5. Otherwise, we return the most accurate version.

AuthorsOpenReview ↗

Official Comment II

W2. Ablation study

Table 5 compares skill representations and routing strategies on AppWorld. Following the reviewer’s suggestion, we added four ablations on ScienceWorld to isolate the contribution of each component.

  • w/o program router. An LLM selects the next skill from the full skill library provided in its context.
  • w/o executable skills. The LLM translates text-only skill descriptions into actions at runtime.
  • w/o parameterized abstraction. Skills use raw action sequences from the training trajectories and retain instance-specific values.
  • w/o verification. The coding agent writes the router without feedback from the cached verifier.
SettingScoreSuccess (%)Scenario SR (%)Routing acc. (train)Tokens
w/o program router76.4360.3733.330.67330K
w/o executable skills81.4370.7333.33-175K
w/o parameterized abstraction83.3173.1744.44-179K
w/o verification82.3768.2933.330.79125K
SCRIPT87.6880.4950.000.88113K

Removing the program router leads to the largest drop in Success Rate (20.12 percentage points) and nearly triples execution token usage. This shows that the program router contributes substantially to both task success and token efficiency.

Modify skill and modify router. Skills specify how to execute concrete actions, while the router determines when to invoke them and how to compose them. Skill repairs are more frequent in Table 3 because the library contains many skills with many opportunities for local edits, such as adding a variant or refining usage conditions. There is a single router that is already refined during learning and therefore makes fewer errors. Router repairs are rarer but yield more. Each accepted router repair improves the score by 1.05 points, compared with 0.24 for a skill repair, and router repairs contribute 4.39 of the 6.54 points of total gain per affected task type, because a corrected routing rule changes decisions across many tasks. Furthermore, table 1 reports train-only results, where no repair is applied, so the repair frequencies in Table 3 do not bear on the gains in Table 1.

Q1. Theoretical analysis

We thank the reviewer for the question. The main contribution of the paper is the SCRIPT framework. SCRIPT formulates skill selection as a coding task in which a coding agent learns an executable router. The theoretical analysis only supports one design choice within this framework. The bound shows that, for the same agreement with recorded decisions, a shorter router has a better generalization guarantee, which is the motivation for including code length in the MDL objective. Section 3.3 describes it as an Occam-style motivation rather than a quantitative guarantee. A trajectory disagrees if any of its routing decisions differs from the demonstration, so the number of disagreeing trajectories is at most the total number of misrouted decision occurrences. Reducing decision-level errors therefore also lowers this upper bound on trajectory-level disagreement.

We agree that the bound has no numerical value as guidance until the number of training trajectories becomes very large, and under our parameters its complexity term exceeds one. This is common for program-length bounds in the small-sample regime of LLM program synthesis. Singhal et al. (2026) report a length-based accuracy lower bound for short reference programs that is zero at 100 and 200 samples, becomes nontrivial at 1,000, and exceeds 0.85 only at 10,000 samples, and they include it to show that the targets admit short descriptions rather than as a guarantee for the learned programs. Our bound plays the same motivating role. Figure 5 evaluates that design choice empirically. With MDL-guided refinement, router length decreases from 2,853 to 677 and held-out routing accuracy rises from 49.2% to 71.8%. To avoid any impression of a quantitative guarantee, we have moved the corollary to the appendix and stated this role explicitly.

Singhal, Mishra, Malach, and Galanti. “LLM Priors for ERM over Programs.” ICML 2026.

AuthorsOpenReview ↗

Official Comment III

Q2. Unseen tasks at test time

Failure attribution and repair are applied only during learning. The skill library and router are frozen at test time. The router encodes when each skill is applicable, and the MDL objective favors compact routing rules that apply across multiple contexts. During learning, the verifier checks these rules against the cached routing decisions.

Even when a task is unseen, it can contain subtasks that existing skills already handle. As execution progresses, the router uses the current context to select and compose those skills. Reusing these procedures simplifies the task and leaves the LLM fallback to handle steps where the router cannot identify an applicable skill.

The router is a deterministic program whose predictions can be checked against all cached routing decisions. When it cannot identify an applicable skill, it returns None. The fallback policy then takes one environment action based on the task goal and execution history, and the router is queried again with the updated history. For example, if the tin is in an unfamiliar room on an unseen boiling task, the router may abstain while the fallback policy searches for it. Once the updated history provides the information needed to select a skill, the router can resume skill-based execution with navigate-to-room and heat-substance.

Thank you again for your thoughtful feedback. We hope the additional results and clarifications address your concerns.

Reviewer_p7VLOpenReview ↗
Rating
2
Confidence
4
Informativeness
1
Presentation
2
Soundness
2
Read review
Paper summary

The paper presents SCRIPT - a framework for learning executable programs(skills) from agent experiences and accompanying python router policy that map context to next skills. During the policy training stage - Script first abstracts recurring action sequences from successful trajectories into executable code skills - creating a skill library as well as mapping raw trajectories to skill-level trajectories. Then a coding agent is used to generate candidate programs to predict the next skill given the past skill context - using MDL to refine the policy to predict most skill trajectories correctly and be the simplest policy to do so. During inference, the router program decides if and what next skill is to be excuted. If no steps are selected - the llm makes a single interaction step with the environment. The authors show that SCRIPT help imporve success rate over ScienceWorld and AppWorld while reducing the number of tokens used - and shwo generalizations to new tasks.

Critical strengths
  1. Novel idea: The idea of using code based router for skill selection is a neat way to implicitly cache and codify agentic interactions. Rewriting trakectories ad skill level routing decisions neatly help model the next action prediction policy as an executable code.
  2. Strong results: The paper shows good results compared to strong baselines such as ACE - outperfroming on both the rpesented benchamrls and at a much lower learning cost.
Critical weaknesses
  1. How skills are generated is under-sepcified. The paper makes clear that skills are parameterized code, but not how they are actually generated. - The Skill construction paragraph in Sec 3.2 is incomplete while the Appendix only share induction prompt's principles but not the prompt, what model was used, how large the library is and how the gold trajectories are created.
  2. How the router is found is under-specified. While the MDL objective makes it clear what is a desirable roting polict, a program-synthesis search still has to happen. Algorithm 1 only says that the coding agent proposes candidate routers each round and keeps the best one if it lowers the score, The paper does not say how many candidates are proposed per round, what the search budget is, how often candidates are accepted, whether the search backtracks or restarts, what additional context the coding agent uses with iteration.or how much the final router varies across runs.
  3. Loose yet very specific definition of skills, without comparison to code-skill methods. The paper mdels skills as procedural code snippets, the natural comparison is with prior work that turns agent experience into executable skills, such as Voyager and ASI. The paper cites both but uses neither as a baseline. ASI already reports that verified program skills outperform text skills, similar to Table 5 here.
Questions for authors

Q1. Which model performs skill induction, and what is the exact induction prompt? Q2. How large is the resulting library: number of skills, variants, and invocations per skill? Q3. Is a separate library built for each task type, or is one library shared across task types and AppWorld scenarios? Q4. How does SCRIPT's skill induction differ from ASI's program-skill induction, which also verifies skills during induction? Q5. Table 5's similarity-routing row replaces the router with retrieval but keeps SCRIPT's own skills, and it covers AppWorld only (120 vs. 145 of 168 tasks). How was it implemented: what was the query, which embedding model, and how many skills were retrieved? Q6. How is the MDL search carried out? How many candidates are proposed per round, and are they independent samples or intermediate versions from one agent session? Is the search purely greedy, or does it backtrack, restart, or keep several routers in parallel? What is the budget B, how often were candidates accepted, and does the agent see the MDL score or only the list of disagreements? How much do the final routers vary across runs?

5 comments
AuthorsOpenReview ↗

Official Comment I

We thank the reviewer for the valuable feedback and for recognizing the idea as novel and the results as strong.

W1 and Q1–Q3. Details of skill construction

We use Gemini 3 Flash for skill induction, the same backbone used across methods (Section 4.1). We now include the complete induction prompt in Appendix A.6 and have moved the key skill construction details into Section 3.2.

SCRIPT learns from the successful gold trajectories provided with each benchmark. ACE, Trace2Skill, and GoS learn from the same trajectories, so all four methods receive the same training experience.

Following the standard setting of each benchmark, in ScienceWorld, we build one skill library per task type because different task types have distinct goals and require different action sequences. In AppWorld, we build a single library shared across all scenarios because they use the same set of apps and APIs. The table reports totals for each benchmark.

BenchmarkSkillsVariantsTotal invocations
ScienceWorld841831,258
AppWorld5757935

W2 and Q6. Details of the code router

We have revised Section 3.3 to clarify how SCRIPT learns the router. We first clarify that our aim is not to develop a new program search procedure. Our motivation is to formulate skill selection as a coding task with automated tests and feedback, allowing us to leverage the problem-solving capabilities of coding agents. SCRIPT’s cached verifier reports every routing error, including the predicted skill, the expected skill, and the source line that produced the prediction. This feedback helps the coding agent identify which parts of the router to inspect and revise. The agent can thus autonomously refine a single program through successive local edits, allowing SCRIPT to benefit directly from advances in coding agents. This formulation puts skill selection in a form that coding agents already handle well.

We describe the program generation process below.

Workspace and data. Every skill boundary in a trajectory yields one decision point (task, history) → skill, shown as points[i] in the diagram, and these points are the only data the coding agent receives. The objective is to write a function choose(task, history) that maximizes routing accuracy over all points with general and compact code, measured by the MDL score. A verifier runs choose on decision points and returns the MDL score, the accuracy, and each error with its gold skill, predicted skill, and source line, with no LLM call and no environment interaction. Together these form a complete workspace for an ordinary coding task, in which the agent only needs to focus on the conditions under which each skill applies and how skills are combined.

Authoring loop. In every turn the agent can write arbitrary Python code (regular expressions, frequency counts, and helper functions) or call workspace tools. It typically spends two to four turns inspecting the most common skills and their contexts to infer the shared conditions, and then writes an initial router. After every revision, the verifier runs the router on all training decision points and reports the MDL score, the routing accuracy, and a list of errors (input context, the predicted skill, the expected skill, and the source line that produced the prediction). The agent uses this feedback to edit the responsible conditions and reruns the verifier. Because verification needs only Python execution, the agent can test both complete router revisions and individual conditions as often as it wants. Over the session, the router gradually captures more of the rules that govern how skills are ordered and combined.

AuthorsOpenReview ↗

Official Comment II

WORKSPACE DATA   one point per skill boundary in a gold trajectory
  points[i] = {
    "task":    "Your task is to boil tin. ...",
    "history": [("action: go to kitchen", "observation: You move to the kitchen."), ...],
    "skill":   "heat-substance"                    # gold label = expected output
  }

INSPECT
  agent → workspace   for p in points: print(p["history"][-1], "->", p["skill"])
                      (or any Python: overview(), explain(i), Counter(...), regex tests, ...)
  workspace → agent   CONTEXT 1   ... observation: a glass cup (containing tin)   ->  heat-substance
                      CONTEXT 2   ... observation: a metal pot (containing lead)  ->  heat-substance
                      CONTEXT 3   ... observation: You move to the kitchen.       ->  acquire-thermometer
                      ...
                      ⇒ agent infers the shared condition of each skill
                        e.g. heat-substance: "the substance is in a container in hand"

DRAFT
  agent → workspace   def choose(task, history) -> skill | None
              
  workspace → agent   verifier: for each point, choose(p["task"], p["history"]) vs p["skill"]
                      (replays the data above — no LLM, no environment)
                        accuracy 0.927        MDL score
                        wrong:  gold skill          predicted          count  returned by  points
                                locate-substance    navigate-to-room   ×5     line 92      7, 20, …
                                report-result       heat-substance     ×5     line 78      9, 22, …

REPAIR
  agent → workspace   edit(old='...', new='...')   (or any Python)
  
  workspace → agent   edit applied · re-run on ALL points
                        accuracy 0.927 → 0.964   MDL score
                        wrong:  gold skill          predicted          count  returned by  points
                                report-result       heat-substance     ×5     line 78      9, 22, …

  agent → workspace   edit(old=..., new=...)          # a broader rule, to fix another group
  workspace → agent   edit applied · re-run on ALL points
   					...  

SELECT
  every version is logged; return the lowest-MDL version with accuracy ≥ 0.5, else the most accurate

(The inspect, draft, and repair stages are summarized from a logged session rather than fixed steps, and the agent decides at every turn what to run next and when to stop.)

Search procedure. The search is therefore a single authoring session with iterative edits and best-version selection. Each edit produces one new version, and the search does not restart, or maintain parallel candidates. The session ends when the agent stops editing or reaches 14 turns, including the initial inspection turns. Every evaluated version is recorded. Among the versions with at least 0.5 training routing accuracy, we return the one with the lowest MDL score, and if no version reaches this threshold, we return the most accurate one. The threshold prevents the agent from lowering the score by deleting code while the router is still inaccurate.

Variance across runs. We ran three independent router authoring sessions on ScienceWorld from the same decision points. For each skill, we compare the sets of decision points that the three routers assign to it. 79% of skills have a pairwise Jaccard similarity of at least 0.8. Independent sessions therefore converge to largely the same routing rules. The skills below this level are mostly invoked at only a few decision points, where a single differing point already lowers the Jaccard similarity substantially.

W3 and Q4. Comparison with code-skill methods

**Difference in data format requirements. **ASI and Voyager represent skills as executable code, while ScienceWorld exposes text commands. Their original skill implementations are incompatible with ScienceWorld’s text-command interface. SCRIPT’s router selects skill IDs independently of the underlying format, allowing it to use parameterized action sequences in ScienceWorld and executable code in AppWorld. We added ASI as a baseline on AppWorld, using the same backbone and training trajectories as SCRIPT.

MethodScoreSuccess Rate (%)Scenario SR (%)Learning token (per sample)Test token (per sample)
ASI82.5760.1235.7151.8K105.1K
SCRIPT95.4286.3176.798.90K46.05K

SCRIPT outperforms ASI by 26.19 points in Success Rate and 41.08 points in Scenario Success Rate.

AuthorsOpenReview ↗

Official Comment III

Difference in method design. ASI and Voyager both represent skills as code, but they select skills in the same way as most prior work on skill selection. ASI lets the LLM choose skills, and Voyager retrieves skills by embedding similarity. SCRIPT uses an executable routing program as the skill selection policy, which is learned and verified offline, and it accepts skills in any format.

MethodSkill formatSkill selection
ASIExecutable codeLLM chooses
VoyagerExecutable codeEmbedding similarity + LLM
SCRIPTAny format (parameterized action templates in ScienceWorld and code in AppWorld)Executable program (learned and verified offline)

Executable skills specify what to do once selected, but as the skill library grows, LLM-based selection must consider more candidates in its context with more tokens, and similarity-based retrieval must separate more skills that all appear relevant to the task (ASI, Voyager). Putting the routing policy itself in code makes skill selection deterministic and verifiable (SCRIPT). A coding agent learns when to invoke and compose skills from recorded context–skill pairs, and the resulting rules can be tested offline and applied at runtime without an LLM call.

ASI induces skills online as it processes tasks sequentially, adding verified skills to its library after each successful episode. SCRIPT can process batches of successful trajectories in parallel. Within each batch, it compares multiple trajectories to identify recurring action patterns and distill them into parameterized skills that can be reused across task instances.

ASI and SCRIPT verify different components. ASI verifies newly induced skills before adding them to the library. It executes a trajectory that invokes those skills in the environment and uses LLM calls to complete the task and assess success. SCRIPT verifies the routing policy. During learning, the coding agent can run the verifier at any time to compare the router’s predictions with the demonstrated skill IDs across all cached decision points. This check requires no LLM calls or environment execution. It shows whether the learned rules reproduce the recorded decisions.

MethodWhat is validatedHowLLM callsEnvironment execution
ASIEach induced skillExecute the skill online in the environment✓✓
VoyagerEach new skillExecute the skill in the environment, then an LLM critic checks success✓✓
SCRIPTThe whole skill selection policyExecute the router offline on all cached decision points✗✗

Q5. Implementation of similarity routing

Our similarity-based routing baseline follows the retrieval approach used in GoS. We concatenate each skill’s content into a single text and embed it using text-embedding-3-large. At each routing point, we embed the task instruction and the five most recent lines of execution history with the same model, then select the skill with the highest cosine similarity to the query. Both methods use the same skill library, and neither requires an LLM call for skill selection.

The performance gap is consistent with the distinction between relevance and applicability discussed in the paper. A skill can be similar to the task and recent history even when its conditions for execution are unmet.

Thank you again for your thoughtful feedback. We hope the additional results and clarifications address your concerns.

Comments on the paper

2 comments
AuthorsOpenReview ↗

Kind reminder regarding the discussion period

Dear Reviewers,

We sincerely thank all reviewers again for your thoughtful comments and valuable suggestions, and we are grateful to those who have already engaged in the discussion. We have provided detailed responses to all concerns, along with additional experiments and clarifications, including a new ASI baseline, component ablations on ScienceWorld, and a revised description of how the router is learned.

As the discussion period is approaching its deadline, we would be very grateful if you could take another look at our responses when convenient. Any further feedback would be greatly appreciated and would help us improve our work.

Thank you again for your time and consideration.

Best regards,

Authors of Submission 40214

Dear Area Chair,

We thank you for handling our submission. Below, we summarize SCRIPT’s contribution, the additional evidence provided during rebuttal, and the discussion with reviewers.

LLM agents increasingly reuse skills distilled from experience, but selecting the appropriate skill remains difficult. Existing methods either place skills in the LLM’s context or retrieve them by semantic similarity, often confusing relevance to the task with applicability at the current step. SCRIPT formulates skill selection as a coding task. A coding agent learns an executable router from decision points extracted from trajectories. Each revision is verified offline against cached decisions without LLM calls or environment interaction, and an MDL objective favors compact, general routing rules. At deployment, the router selects skills directly without LLM inference.

On unseen tasks, SCRIPT improves Success Rate over the strongest baseline by 21.1% on ScienceWorld and 11.5% on AppWorld in relative terms, with up to a 28.4-fold reduction in learning tokens. Reviewer p7VL recognized the novelty of the idea and the strong results against baselines such as ACE. Reviewer ehCv recognized the importance of the problem, the novelty of programmatic routing, and the value of cached offline verification. Reviewer JLGE highlighted generalization to unseen tasks and substantially lower token usage.

We responded to all questions with implementation details and additional experiments:

  • We rewrote Section 3.3 to explain router learning, including the workspace, verifier feedback, search budget, and final selection rule. We also expanded the skill induction details and reported library statistics.
  • We added ASI as an AppWorld baseline, which SCRIPT exceeds by 26.19 percentage points in Success Rate, and added component ablations on ScienceWorld to isolate the contributions of routing, skill representation, parameterization, and verification.
  • We added a scaling experiment in which the number of training trajectories increases to 636, while performance remains stable. Learning from all 636 trajectories uses fewer tokens than the baselines use to learn from 30.
  • We reported fallback usage, router execution cost, and variance across independent runs.

Discussion with reviewers.

  • Reviewer JLGE confirmed that our responses resolved the concerns about fallback usage, router execution, training trajectories, and scalability.

  • Reviewer p7VL responded that the code-based router is a neat idea. The remaining concerns are new ones about the reliability of the LLM-based steps, such as using additional LLM backbones. We clarified the skill generation details, but the additional experiments could not be completed within the discussion period.

  • Reviewer ehCv acknowledged that some concerns were addressed and raised three remaining points, which we answered as follows:

    • Removing the router drops Success Rate by 20.12 points even with executable skills available, which demonstrates the effectiveness of the router.

    • Table 1 already reports results on held-out test splits with scenarios and variations absent from training.

    • The bound only motivates the code length term in MDL, whose effect is shown empirically in Figure 5.

We sincerely thank you and the reviewers for the careful evaluation and constructive discussion.

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

Related papers

Loading the map…

Discussion (0)

Sign in to comment.