SKILL-DISCO: Distilling and Compiling Agent Traces into Reusable Procedural Skills¶
🕒 Published (v1): 2026-06-25 07:02 UTC · Source: Arxiv · link
Why this paper was selected
Compiles agent execution traces into reusable typed skills; directly cuts inference cost
Ask a follow-up
Open an assistant pre-loaded with this paper's context.
💬 Ask ChatGPT✦ Ask Claude
TL;DR¶
SKILL-DISCO is a distillation-and-compilation framework that extracts reusable procedural skills from successful agent traces by formalizing them as Parameterized Finite-State Machine (PFSM) subgraphs. Skills are distilled via trace normalization, subgoal extraction, and clustering, then compiled into verified, callable Python functions. On ALFWorld and WebArena, it raises success rates and cuts agent turns, and skills induced by a strong model transfer to weaker models with large gains.
Problem¶
LLM agents repeatedly solve structurally similar tasks from scratch, re-discovering the same low-level action patterns each time. Existing workflow/skill-reuse methods either operate on natural-language summaries (not executable) or synthesize skills directly from individual traces without an explicit notion of shared structure, producing fragmented, trace-specific libraries with no formal grounding for what makes a skill reusable across instances.
Method¶
SKILL-DISCO targets FSM-defined scenarios—environments with finite states \(S\), actions \(A\), and a deterministic transition function \(\delta: S \times A \to S\)—where successful traces are paths in an unknown transition graph \(G^* = (V^*, E^*)\).
Formalization: Reusable skills are defined as PFSM subgraphs: a Parameterized FSM \(\tilde{M} = (\tilde{S}, \tilde{A}, \Theta, \tilde{\delta}, \tilde{S}_0, \tilde{S}_\text{goal})\) abstracts concrete states/actions into parameterized equivalents, so traces with different objects or lengths can instantiate the same control-flow pattern. A skill \(K_j\) is a PFSM subgraph that matches (via parameter binding, \(K_j \preceq \tilde{G}_i\)) multiple lifted trace graphs.
Distillation phase (3 stages): 1. Trace Normalization — an LLM converts raw agent logs into Python-like intermediate programs with explicit loops, branches, and typed symbolic variables. 2. Subgoal-Level Operation Extraction — each normalized program is segmented into multi-step operators \(o = (\nu, \sigma, u, c)\) (identifier, summary, primitive sequence \(|u| \geq 2\), code fragment), discarding unit-length (primitive) fragments. 3. Procedural Skill Consolidation — operators sharing the same parameterized control-flow structure are clustered. Each cluster's reusability score \(r_k \approx \frac{1}{N}\sum_{i=1}^N \mathbb{I}[K_k \preceq \tilde{G}_i]\) filters for high-coverage candidates.
Compilation phase (2 stages): 4. Skill Specification — each cluster is augmented with a typed signature, natural-language description, pre/postconditions, side effects, and metadata (confidence score, expected primitive steps per call). 5. Synthesis & Verification — GPT synthesizes Python implementations; a held-out verification loop checks runtime correctness, postcondition satisfaction, and action savings, re-synthesizing with feedback for up to \(R\) retries and discarding failures.
The resulting skill library exposes documented signatures; agents (ReAct or CodeAct) select and invoke skills alongside primitive actions.
Key Contributions¶
- Explicit scoping of procedural skill discovery to FSM-defined scenarios, where reusable skills have well-defined transition semantics.
- Formalization of procedural skills as reusable PFSM subgraphs under parameter binding, providing structural targets rather than trace-specific routines.
- The SKILL-DISCO distillation-and-compilation pipeline that approximates PFSM-based skill discovery from raw traces and produces verified, callable Python skills.
- Demonstration of cross-model procedural knowledge transfer: a library induced by GPT-4o benefits smaller models (Qwen3.5-9B, Qwen3.5-4B) with large SR gains and no re-induction cost.
Results¶
ALFWorld (134 unseen tasks, CodeAct base = 96.3% SR): - SKILL-DISCO + CodeAct: 99.3% SR (+3.1%), avg. turns 3.2 (−11.3%) - SKILL-DISCO + ReAct: 92.4% SR (+12.7%), avg. turns 8.8 (−54.5%) - Outperforms AWMoffline (54.5%) and ASIoffline (47.0%) by large margins
WebArena (406 held-out tasks, ReAct base = 23.9% SR): - SKILL-DISCO + ReAct: 29.1% SR (+21.6%), avg. turns 5.1 (−13.1%) - SKILL-DISCO + CodeAct: 22.9% SR (+14.8%), avg. turns 8.5 (−22.0%) - Surpasses ASIoffline (24.6%) by 4.5 absolute points on WebArena
Cross-model transfer (same GPT-4o-induced library): - Qwen3.5-9B on ALFWorld: 54.5% → 98.5% (+80.8%), turns −68.2% - Qwen3.5-4B on WebArena: 10.1% → 18.7% (+85.3%) - Qwen3.5-9B (98.5%) surpasses its GPT-4o inducer (96.3%) on ALFWorld
Skill compactness vs. ASIoffline: - 5 skills vs. 110 on ALFWorld; 20 vs. 146 on WebArena - Avg. primitives per call: 5.6 vs. 0.2 (ALFWorld); 2.8 vs. 2.5 (WebArena) - Execution error rate: 0.0% vs. 75.3% on ALFWorld; 21.5% vs. 33.9% on WebArena
Limitations¶
- Explicitly scoped to FSM-defined scenarios with finite, deterministic transition dynamics; applicability to open-ended or stochastic environments is not addressed.
- The lifting function \(\varphi: \tau_i \mapsto \tilde{G}_i\) is approximated via LLM-driven stages with no formal correctness guarantees; clustering quality depends on LLM abstraction fidelity.
- Skill induction requires a corpus of pre-collected successful traces; performance in low-data or cold-start settings is not evaluated.
- Verification is against held-out tasks within the same distribution; out-of-distribution robustness is untested.
- WebArena GPT-4o-mini gains 0.0% SR improvement with skills (18.0% → 18.0%), suggesting benefits are not universal.
Relevance to Agentic AI / LLM Agents¶
SKILL-DISCO directly addresses the experience-reuse problem in LLM agent systems by providing a principled formalism (PFSM subgraphs) for what a "reusable skill" is, which prior work left implicit. The compilation step—turning discovered structures into verified, callable Python—is a concrete step toward reliable agent tool libraries that survive execution rather than being purely textual heuristics. The cross-model transfer result is particularly notable for multi-agent and efficiency-focused work: a strong model can compile a skill library that weaker, cheaper models invoke at inference time, decoupling skill induction cost from deployment cost. This connects to broader threads on agent memory, experience accumulation, and hierarchical action abstraction.