arXiv(opens in a new tab)cs.AIOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.26995

SPEM: Structure-Aware Procedural Memory for Efficient Skill Use in LLM Agents

Ran Zhou, Zehui Kong, Fanyu Lin, Jiaheng Liu, Zhen Zhang, Yuxiang Ren

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

LLM-based agents increasingly rely on reusable skills. However, scaling skill libraries makes efficient and accurate skill use difficult. Full skill loading incurs high token and runtime overhead. In contrast, flat semantic retrieval treats skills as independent text entries, ignoring dependencies, execution order, state transitions, and data-flow constraints. We propose SPEM, a lightweight structure-aware procedural memory framework for efficient skill use in LLM-based agents. SPEM maintains Atomic Skill Memory for individual skills and Skill-DAG Memory for reusable compositions derived from successful executions. For a new task, SPEM reuses high-confidence Skill-DAG templates when available. Otherwise, it retrieves atomic skills and invokes Skill-GNN for state- and structure-aware skill selection. Successful executions are written back as new Skill-DAGs, allowing procedural memory to accumulate over time. Experiments on ALFWorld and SkillsBench show that SPEM achieves the best overall effectiveness–efficiency trade-off, reaching 87.1% ALFWorld success and 38.38% SkillsBench reward while reducing token and runtime costs against strong baselines.

Introduction

Large language model (LLM) agents are increasingly used as executable systems. They call tools, reuse skills, and interact with complex environments. In software engineering, data analysis, web automation, and embodied tasks, agents rely on reusable skills, such as file parsing, preprocessing, and API calling (Schick et al. 2023; Mialon et al. 2023; Yao et al. 2023). As skill libraries scale to hundreds or thousands of candidates, the central challenge changes. It shifts from whether useful skills exist to how an agent can retrieve, organize, and reuse the required skills efficiently (Patil et al. 2023; Qin et al. 2024; Shi et al. 2025).

Existing approaches face four limitations under large-scale skill libraries. First, loading all skill descriptions is infeasible due to high token cost, context bloat, and runtime overhead, with important details often lost in long contexts (Liu et al. 2024a). Second, flat retrieval optimizes semantic relevance but ignores structural dependencies like prerequisites, order, state transitions, and data flow across skills (Lewis et al. 2020; Karpukhin et al. 2020). Third, successful compositions are not stored as reusable procedural memory. Even when dependency-aware plans are built, they are discarded after execution. This forces agents to re-derive similar workflows (Yao et al. 2023; Shinn et al. 2023). Finally, as agent systems are deployed more frequently and model capabilities continue to improve, efficiency becomes a primary concern. Repeated model invocations for retrieval, planning, and reorganization incur unnecessary token consumption, latency, and computational overhead. These limitations call for a framework that can retrieve skills compactly, organize them structurally, and accumulate reusable procedural memory over time.

We therefore study efficient skill use under large-scale skill libraries. Our goal is to improve task success while reducing token cost, runtime overhead, and repeated skill organization. To this end, we propose SPEM, a lightweight structure-aware procedural memory framework. SPEM maintains two complementary memory layers. Atomic Skill Memory represents individual executable skills with their semantic, interface, and feedback signals. Skill-DAG Memory stores reusable skill compositions distilled from successful executions. Given a new task, SPEM first retrieves relevant procedural memory and reuses a high-confidence Skill-DAG template when available. Otherwise, or when the current guidance becomes insufficient, Skill-GNN constructs a task-conditioned candidate graph. It then performs state-aware skill selection over retrieved atomic skills. After execution, successful trajectories are compressed into Skill-DAGs and written back to memory for future reuse.

We evaluate SPEM on SkillsBench and ALFWorld (Li et al. 2026b; Shridhar et al. 2021). SkillsBench tests large-scale skill retrieval and technical task execution. ALFWorld evaluates long-horizon dependencies, structured skill use, and cross-task reuse in interactive environments. We compare SPEM with full skill loading, flat vector retrieval, and graph-based skill selection baselines.

Our contributions are fourfold:

• We propose SPEM, a dual-layer procedural memory framework that combines Atomic Skill Memory for fine-grained skill access with Skill-DAG Memory for reusable procedural structures.

• We design a Skill-GNN module for state-aware skill selection over task-conditioned candidate graphs.

• We introduce trajectory-DAG extraction to distill suc-

∗^{*}Corresponding author.

cessful executions into reusable Skill-DAG templates and update procedural memory through execution feedback.

• We evaluate SPEM on ALFWorld and SkillsBench, achieving 87.1% ALFWorld success and 38.38% SkillsBench reward while reducing token and runtime costs over strong structure-aware baselines.

References (30)