Source-linked AI summary

SkillLens: Adaptive Multi-Granularity Skill Reuse for Cost-Efficient LLM Agents

Yongliang Miao, Ziyang Yu, Liang Zhao, Bowen Zhu, Hasibul Haque

arXiv:2605.08386v1cs.AI

TL;DR

Existing skill-based LLM agents often reuse retrieved skills as flat blocks, making partial reuse costly and potentially noisy. SkillLens uses hierarchical retrieval, verifier-guided mixed-granularity adaptation, and dual-registry evolution. Across MuLocbench and ALFWorld, it improves performance over strong skill-based baselines, including raising ALFWorld success from 45.00% to 51.31%.

  • Problem

    Existing skill systems treat retrieved skills as flat, single-resolution blocks, making partial reuse difficult when only some components match a task.

    Source: §1 · p. 2
  • Method

    SkillLens organizes skills hierarchically, expands retrieved seeds with degree-corrected random walk, and routes units through ACCEPT, DECOMPOSE, REWRITE, or SKIP while evolving both registries.

    Source: §1 · p. 2, §3.1 · p. 3, §3.3 · p. 5
  • Results

    SkillLens improves both benchmarks, with up to a 6.31-point MuLocbench Acc@1 gain and ALFWorld success increasing from 45.00% to 51.31%.

    Source: §1 · p. 2, §4.2 · p. 7
  • Takeaways & Limitations

    Mixed-granularity adaptation lets agents reuse compatible subskills and locally modify mismatched components instead of accepting or discarding whole skills.

    Source: §1 · p. 2, §5 · p. 9

    The theoretical guarantee depends on retrieval calibration, submodularity, random-walk marginal-gain estimation, and verifier approximation assumptions.

    Source: §3.4 · p. 6

Abstract

from arXiv · show

Skill libraries have become a practical way for LLM agents to reuse procedural experience across tasks. However, existing systems typically treat skills as flat, single-resolution prompt blocks. This creates a tension between relevance and cost: injecting coarse skills can introduce irrelevant or misleading context, while rewriting entire skills is expensive and often unnecessary. We propose SkillLens, a hierarchical skill-evolution framework that organizes skills into a four-layer graph of policies, strategies, procedures, and primitives, and retrieves them at mixed granularity. Given a task, SkillLens first retrieves semantically relevant skill seeds, expands them through degree-corrected random walk over the skill graph, and then uses a verifier to decide whether each visited unit should be accepted, decomposed, rewritten, or skipped. This enables the agent to reuse compatible subskills directly while adapting only locally mismatched components. To improve the system over time, SkillLens further refines multi-granularity skills and verifier in order to improve its routing decisions. We provide theoretical analysis showing that mixed-granularity adaptation incurs sublinear cost under sparse mismatch assumptions and that the evolutionary update rule monotonically improves the validation objective until a local optimum. Across MuLocbench and ALFWorld, SkillLens consistently improves over strong skill-based baselines, achieving up to a 6.31 percentage-point Acc@1 gain for bug localization and raising agent success rate from 45.00% to 51.31%.

1 Introduction

SkillLens addresses the flat, single-resolution reuse of retrieved skills by selecting and adapting useful subunits at mixed granularities. It combines hierarchical retrieval, verifier-guided routing, and dual-registry evolution, improving efficiency and benchmark performance.

1 Introduction

  • Skill libraries reuse procedural experience, but existing systems commonly retrieve and insert skills as atomic prompt blocks.This spans episodic memories, executable skill libraries, distilled manuals, and newer evolving memory systems.Source: §1 · pp. 1–2
  • Flat reuse forces agents to accept noisy partially relevant skills or discard them and re-solve tasks from scratch.The same limitation causes repeated rediscovery of cross-issue regularities in repository-grounded agent pipelines.Source: §1 · p. 2
  • The framework treats skill reuse as resolution selection, allowing compatible subskills to transfer while adapting only locally mismatched components.Its hierarchy serves as an operational decomposition interface rather than assuming skills are inherently trees.Source: §1 · p. 2
  • SkillLens retrieves skill seeds, expands them through a skill graph, and routes units to ACCEPT, DECOMPOSE, REWRITE, or SKIP.The final context contains accepted and locally rewritten units rather than a full retrieved skill block.Source: §1 · p. 2
  • SkillLens evolves both procedural skills and verifier routing knowledge, improving what is stored and how retrieved experience is reused.The contributions include sublinear adaptation cost under sparse mismatch assumptions and monotone improvement of the evolution objective.Source: §1 · p. 2
  • SkillLens improves MuLocbench Acc@1 by up to 6.31 points and raises ALFWorld success rate from 45.00% to 51.31%.These results support gains in both repository-level localization and long-horizon interactive tasks.Source: §1 · p. 2

2 Related Work

Prior work externalizes agent experience through memories, skills, and routing systems, but generally consumes retrieved units at one resolution. SkillLens extends these lines with hierarchical procedural objects and dual-registry routing evolution.

Skill libraries as procedural memory

  • Procedural-memory systems store reflections, executable skills, distilled insights, or reusable procedures to extend agents without retraining.Examples include ReAct [28], Toolformer [16], CodeAct [22], Self-Refine [11], Reflexion [17], Voyager, SkillAct, ExpeL [34], AutoManual [3], and Skill-Pro [12].Source: §2 · p. 2
  • Most skill libraries still retrieve and insert a skill as a flat unit, making partial reuse difficult.SkillLens instead represents skills as hierarchical procedural objects and constructs contexts from selected sub-units.Source: §2 · p. 2

Evolving agent memory and skill systems

  • Memory and skill-evolution systems revise stored knowledge through interactions, failures, or verification while keeping the base model fixed.AutoSkill [27], EvoSkill [1], and EvoSkills [30] mainly optimize skill content, leaving reuse decisions implicit or coarse-grained.Source: §2 · p. 3
  • SkillLens addresses coarse reuse decisions with a dual-registry design that evolves procedural content and verifier-side routing knowledge.The two registries jointly determine how retrieved skills are adapted over time.Source: §2 · p. 3

Skill routing and context construction

  • Routing research shows that selecting useful context is difficult in large, noisy skill collections, but most systems still consume selected context at a single resolution.SkillLens constructs mixed-granularity contexts in response to token and computation budgets.Source: §2 · p. 3

3 Methodology

SkillLens formulates skill reuse as resolution-aware context construction over a four-layer skill graph, combining hierarchical retrieval, verifier-guided local adaptation, and coupled registry evolution. Its analysis establishes sublinear adaptation cost under sparse decomposition and monotone convergence of evolutionary updates to a local optimum.

3.1 Problem Formulation

  • A four-layer graph organizes skills as policies, strategies, procedures, and primitives, while the objective balances task correctness against inference, retrieval, and registry-refinement cost.The frozen agent uses a development split for registry evolution rather than gradient-based parameter updates.Source: §3.1 · pp. 3–4

3.2 Hierarchical Skill Graph and Mixed-Granularity Adaptation

  • SkillLens retrieves candidate seeds, expands them with degree-corrected random walk, and recursively routes partially relevant subtrees to ACCEPT, DECOMPOSE, REWRITE, or SKIP.Only accepted or locally rewritten units form the final context, with cost scaling by visited and rewritten units rather than the full retrieved tree.Source: §3.2 · pp. 4–5

3.3 Dual-Registry Evolutionary Refinement

  • The dual-registry evolution procedure builds gap reports from failed trajectories, proposes edits to verifier and agent registries, and commits the candidate maximizing the evolution objective, retaining the current pair as fallback.Verifier-side routing edits induce agent-side procedural edits through the writer, so both registries co-evolve from the same error signal.Source: §3.3 · pp. 5–6

3.4 Theoretical Analysis

  • Under sparse decomposition, adaptation cost is sublinear in retrieved-tree size, while fallback-preserving updates produce a non-decreasing objective sequence converging to a local optimum.The sublinear-cost result assumes branching factor b, logarithmic depth, and decomposition fraction ρ < 1/b; the convergence result does not claim global optimality.Source: §3.4 · p. 6

4 Experiment

SkillLens is evaluated on repository localization and text-environment control using hierarchical skill retrieval, verifier-guided adaptation, and iterative evolution. It achieves the strongest overall results, while ablations show that graph propagation and selective rewriting improve quality with lower cost.

4.1 Experimental Setup

  • SkillLens is evaluated with Codex GPT-5.2, a GPT-5-mini verifier, text-embedding-3-small retrieval, MuLocbench, and ALFWorld under matched baseline conditions.The evolution split generates gap reports, validation selects the best refined system, and one final test evaluation is performed.Source: §4.1 · pp. 6–7

4.2 Main Results

  • SkillLens reaches the strongest overall performance on both benchmarks, with MuLocbench Acc@1 of 61.13%, 59.26%, and 43.68% at file, module, and function levels, and ALFWorld success of 51.31%.On ALFWorld, this improves over Vanilla by 6.31 percentage points and over AutoSkill and EvoSkill by 4.17 percentage points.Source: §4.2 · p. 7, Table 1 · p. 7, Table 2 · p. 7
  • Performance gains increase with task difficulty, reaching a 6.31-point MuLocbench improvement at function level and outperforming all baselines on ALFWorld Heat at 50.00% and Pick2 at 54.17%.The paper attributes the pattern to the value of selecting, decomposing, and locally adapting partial skills for fine-grained or compositional tasks.Source: §4.2 · p. 7
  • Dual-registry evolution and mixed-granularity adaptation improve both retrieval precision and long-horizon completion, raising function-level Precision@1 from 37.37% to 43.68% and ALFWorld success from 45.00% to 51.31%.The verifier routes subunits locally, while the agent and verifier registries are co-optimized.Source: §4.2 · p. 8

4.3 Ablation Studies

  • Degree-corrected random walk improves all localization granularities, with the largest relative module-level Acc@1 gain of 5.19 points and largest absolute function-level Acc@1 gain of 7.37 points.The gains indicate better candidate ranking and retrieval of structurally reachable units without degrading precision.Source: §4.3 · pp. 8–9
  • Selective drill-down rewriting improves coverage while using 4,718.54 seconds and 16.41M tokens, versus 6,161.83 seconds and 115.51M tokens for Rewrite-all.It preserves compatible subskills and selectively rewrites mismatched child units.Source: §4.3 · p. 9

4.4 Computational Cost Analysis

  • Increasing the initial skill ratio from 25% to 100% raises retrieval time from 18.28 to 58.72 minutes, while main-agent token usage rises more moderately from 3.17M to 3.89M.Evolution time is non-monotonic, reflecting parallel execution, triggered refinement steps, and runtime variation.Source: §4.4 · p. 9, Figure 2 · p. 9

5 Conclusion

SkillLens addresses the limitations of flat skill reuse by constructing hierarchical, task-specific contexts at appropriate resolutions. Experiments show stronger gains on fine-grained and compositional tasks, with future work targeting broader settings and skill compression.

  • SkillLens replaces flat prompt-block reuse with hierarchical, task-specific skill contexts that adapt retrieved skills at appropriate resolutions.The framework targets noise, wasted reusable structure, and unnecessary rewriting caused by all-or-nothing reuse.Source: §5 · p. 9
  • Across MuLocbench and ALFWorld, SkillLens outperforms strong evolving-skill baselines, with larger gains on fine-grained and compositional tasks.Future work will extend the framework to multimodal tool use, web navigation, multi-agent settings, and skill compression.Source: §5 · p. 9

A Implementation Details

The experiments evaluate repository localization and text-environment control with separate datasets, metrics, splits, and isolated execution environments.

  • MuLocbench uses 36 training repositories and 10 test repositories, evaluating ranked file, module, and function candidates with accuracy, recall, and precision.The task measures repository-localization performance for issue resolution.Source: A Implementation Details · p. 13
  • ALFWorld evaluates full-episode rollouts of at most 50 steps using overall episode success rate and per-subtask success breakdowns.Source: A Implementation Details · p. 13
  • Evaluations run in isolated repository sandboxes or independent TextWorld/ALFWorld instances, using train for evolution and valid-seen for evaluation.Source: A Implementation Details · p. 13

B.1 Proof of Proposition 1 (Sublinear cost of adaptation)

The proof bounds adaptive skill traversal by the visited frontier and its ancestors, yielding sublinear adaptation cost relative to flat full-skill injection.

B.1 Proof of Proposition 1 (Sublinear cost of adaptation)

  • ACCEPT or SKIP terminates exploration of a subtree, so the visited set consists of the adaptive frontier and its ancestors.At depth d, the expected frontier size is bounded by (ρb)^d.Source: §B.1 · p. 13
  • Cadapt = O(Nvis + Nrw) is independent of n in expectation and bounded by O(log n) in the worst case.The worst-case bound applies as ρb → 1, where the tree depth satisfies D = O(log n).Source: §B.1 · p. 13
  • Adaptive cost is o(n), contrasting with the Θ(n) token cost of flat full-skill injection.Source: §B.1 · p. 13

B.2 Proof of Proposition 2 (Monotone improvement and convergence to a local optimum)

The evolution update is monotone because it retains the previous registry-verifier pair, and it converges to a local optimum under single atomic edits.

B.2 Proof of Proposition 2 (Monotone improvement and convergence to a local optimum)

  • J(t+1) ≥ J(t) because the update candidate set includes the previous pair.With J bounded above and C bounded below, the monotone objective sequence converges.Source: §B.2 · p. 13
  • The limiting system is a fixed point with no strictly improving atomic edit, hence a local optimum under the induced neighborhood.The gap J* − J† may remain non-zero because the search does not perform a global sweep over all skill-pair configurations.Source: §B.2 · p. 13

B.3 Proof of Proposition 3 (Composed approximation guarantee)

The composed approximation guarantee analyzes retrieval, random-walk expansion, and verifier-driven rewriting as additive blocks approximating the surrogate objective JQ.

B.3 Proof of Proposition 3 (Composed approximation guarantee)

  • The three algorithmic stages approximate JQ block-by-block, with additive error composition under assumptions (a)–(d).The resulting procedure is objective-consistent for the tractable surrogate rather than an exact optimizer of the unobservable correctness metric M.Source: §B.3 · pp. 13–14
  • Top-K embedding retrieval reduces to selecting up to K units by singleton relevance, with calibration error bounded by ϵret.Source: §B.3 · p. 13
  • Degree-corrected random-walk expansion inherits a (1 − 1/e) submodular guarantee up to ϵrwr under the stated assumptions.The bound follows from noisy-greedy analysis when the random-walk score approximates true marginal gain.Source: §B.3 · p. 13
  • Verifier-driven rewriting is additive over routed nodes and achieves the ideal local-action result when ϵver = 0.Otherwise, its guarantee degrades linearly with the number of routed nodes as |bR|ϵver.Source: §B.3 · p. 14

C.1 MuLocbench Example: YOLOv5 Root-Path Failure

The YOLOv5 example shows SkillLens narrowing a Torch Hub path-root failure to the relevant loader path and recommending guarded root normalization.

C.1 MuLocbench Example: YOLOv5 Root-Path Failure

  • The error indicates that the cached repository root is outside the user’s current working directory, implicating ROOT.relative_to(Path.cwd()).The observed failure is a mismatch between the cached Torch Hub checkout and the caller’s working directory.Source: §C.1 · p. 14
  • The reported Torch Hub command makes the Hub loading path the primary search path rather than standalone training or inference scripts.The initial retrieved skill nevertheless broadened localization to several additional files with similar root-handling logic.Source: §C.1 · pp. 14–15
  • SkillLens localizes the issue to YOLOv5’s root-path conversion logic, prioritizing models/yolo.py on the failing import path.Other files are secondary locations only if they reuse the same fragile pattern.Source: §C.1 · p. 15
  • The recommended fix catches ValueError and preserves an absolute ROOT when the repository is loaded from an external cache.Relative paths remain usable when the repository lies under Path.cwd().Source: §C.1 · pp. 14–15
  • For external-loader failures, localization should trace the actual entry path before expanding to modules with similar path-handling code.The policy prioritizes root construction, normalization, and assumptions that absolute paths lie inside the caller’s working directory.Source: §C.1 · pp. 14–15

C.2 ALFWorld Example: Mixed-Granularity Skill Reuse

The ALFWorld example shows SkillLens preserving reusable acquisition and placement steps while locally adapting a mismatched state-transformation procedure. For cooling an apple, it replaces sink-based cleaning with refrigerator-based cooling and constructs a task-specific sequence.

  • The retrieved “Clean object then place” skill locates and picks up the apple, cleans it in the sink, and places it on the dining table.Source: §C.2 · pp. 15–16
  • SkillLens separates object-state-and-placement tasks into finding and picking up the object, transforming its state with the correct appliance, and placing it at the destination.Source: §C.2 · pp. 15–16
  • For the cooled-apple task, the resulting procedure searches likely locations, retrieves the apple, cools it in the refrigerator, and places it on the dining table.Source: §C.2 · p. 16
  • The system preserves locating, picking, navigation, and placement units while rewriting only the mismatched cleaning step as cooling the apple in the refrigerator.Source: §C.2 · p. 16
  • The example generalizes the routing rule: preserve shared procedures when object and destination match, but rewrite the state transformation according to the requested operation.Source: §C.2 · pp. 16–17
Loading 2605.08386v1…