Trace2Skill: Distill Trajectory-Local Lessons into Transferable Agent Skills

Jingwei Ni, Yihao Liu, Xinpeng Liu, Yutao Sun, Mengyu Zhou, Pengyu Cheng, Dexin Wang, Erchao Zhao, Xiaoxi Jiang, Guanjun JiangarXiv 2026

TL;DR

Trace2Skill is an automated framework that distills large pools of LLM agent execution trajectories into a unified, static skill directory. By performing parallel inductive reasoning over agent experiences, it creates highly portable Standard Operating Procedures (SOPs) that significantly boost agent performance and seamlessly transfer across model scales, families, and out-of-distribution tasks without requiring test-time retrieval.

What Problem Does This Paper Address?

LLM agents excel at general tasks but frequently stumble in specialized, tool-heavy workflows—such as complex spreadsheet editing or multi-modal document analysis. To bridge this gap, developers use "skills": structured documents containing procedural guidelines and operational guardrails. However, manually authoring these skills does not scale, and generating them purely from an LLM's internal parametric knowledge misses subtle, real-world operational pitfalls.

While recent approaches attempt to learn from agent experience, they typically suffer from two main flaws:

  1. They store raw trajectories as episodic memories to retrieve at test time, which fragments knowledge and adds latency.
  2. They update skills sequentially as new data arrives, which is computationally slow and highly sensitive to the order of updates.

Methods

Trace2Skill Pipeline Overview

Trace2Skill introduces a three-stage pipeline to convert raw execution traces into a single, clean skill directory:

  1. Trajectory Generation: A frozen agent runs a set of training tasks to collect a corpus of successful and failed execution trajectories.
  2. Parallel Patch Proposal: Asymmetric analyst sub-agents inspect individual trajectories in parallel. A success analyst ($A^+$) extracts reusable behavior patterns, while an interactive error analyst ($A^-$) uses a ReAct loop to inspect artifacts, pinpoint root causes, and validate fixes to propose precise "skill patches."
  3. Patch Consolidation: Instead of sequential updates, Trace2Skill uses a hierarchical merge operator to synthesize all patches simultaneously. It filters out idiosyncratic quirks and deduplicates overlapping insights, performing inductive generalization to output a single, static skill file.
Sequential vs Parallel Distillation

The framework supports two modes: Skill Deepening (improving an existing human-written skill) and Skill Creation (building a skill from scratch using a weak parametric draft).

Datasets

The authors evaluate Trace2Skill across multiple challenging domains:

  • Spreadsheets: SpreadsheetBench-Verified (split into 200 evolution and 200 test tasks). Out-of-distribution (OOD) transfer is tested on WikiTableQuestions and HiTab.
  • Math Reasoning: 400 DAPO questions for training, evaluated on 100 held-out DAPO questions and the highly competitive AIME 2026 dataset.
  • Visual QA: DocVQA (50 examples for evolution, 5,299 for testing).
  • Document Workflows: VRDU Registration Forms (PDF extraction), TSBench (PPTX editing), and OfficeBench (DOCX editing).

Key Insights and Ideas

  • Parallel Beats Sequential: Consolidating patches hierarchically in parallel is not only dramatically faster (e.g., 3 minutes vs. 60 minutes for sequential updates) but also yields more robust skills by avoiding order-dependent biases.
  • Static Skills Outperform Retrieval: A single consolidated skill directory consistently beats test-time episodic retrieval methods (like ReasoningBank). Synthesizing lessons into a unified SOP prevents the agent from getting distracted by isolated, noisy memories.
  • Interactive Analysis is Crucial: Single-call LLM log readers are highly prone to false positives. Giving the error analyst agentive capabilities—allowing it to interactively inspect file artifacts and validate candidate fixes—is essential for finding true root causes.
Agentic vs Single-Call Error Analysis
  • Combinatorial Patch Value: Individual patches often exhibit complex interactions. A patch that fixes one task might cause a regression in another. Trace2Skill's holistic consolidation handles these combinatorial effects better than greedy local selection.
Greedy Selective Patch Aggregation

Key Results

  • Remarkable Portability: Skills distilled from smaller models transfer remarkably well to larger ones. For instance, skills evolved from Qwen3.5-35B trajectories improved a larger Qwen3.5-122B agent by up to 57.65 percentage points on WikiTableQuestions.
  • Cross-Family Generalization: Evolved skills are model-agnostic. Models like Gemma-4-31B-it and GPT-5.5-high self-improve using their own traces and successfully run Qwen3.5-authored skills.
Cross-Family Generalization
  • Broad Domain Success: Trace2Skill achieved significant gains across all tested document workflows, improving PDF extraction pass rates by 8.4 pp, PPTX editing by 16.3 pp, and DOCX editing by 7.8 pp.

Limitations and Future Work

While full patch aggregation works exceptionally well out of the box, optimizing patch selection via methods like Bayesian Optimization (BO) remains computationally expensive. BO requires materializing and evaluating a new skill directory for every candidate subset, which scales poorly as the number of patches grows. The authors highlight the need for more efficient combinatorial patch selection algorithms in future work.

Summary updated

BibTeX
@misc{ni2026trace,
  author = {Jingwei Ni and Yihao Liu and Xinpeng Liu and Yutao Sun and Mengyu Zhou and Pengyu Cheng and Dexin Wang and Erchao Zhao and Xiaoxi Jiang and Guanjun Jiang},
  title = {{Trace2Skill: Distill Trajectory-Local Lessons into Transferable Agent Skills}},
  year = {2026},
  eprint = {2603.25158},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.25158},
}
Figure