PLCLMay 27

Skill-as-Pseudocode: Refactoring Skill Libraries to Pseudocode for LLM Agents

arXiv:2605.2795586.5h-index: 35
Predicted impact top 3% in PL · last 90 daysOriginality Incremental advance
AI Analysis

For LLM agents using skill libraries, SaP provides a practical method to improve task success and efficiency by replacing free-form prose with typed pseudocode.

Skill-as-Pseudocode (SaP) converts markdown skill libraries into typed pseudocode, reducing agent confusion and re-retrieval loops. On ALFWorld unseen split, SaP wins 82/402 games vs 47/402 for Graph-of-Skills (p=8.2e-5), with 22.8% fewer tokens and 14.5% fewer LLM calls.

Markdown skill libraries for LLM agents ship as free-form prose, forcing the agent to re-derive both the input schema and the concrete invocation syntax on every retrieval. We observe that this often produces a "confused -> re-retrieve -> still confused" loop in which the agent issues a partially-correct action, receives uninformative environment feedback, and re-retrieves the same prose. We propose Skill-as-Pseudocode (SaP), an automatic conversion of markdown skill libraries into typed pseudocode with deterministic quality control. For each cluster of similar procedural passages drawn from one or more skills, SaP extracts a typed contract and filters it through a four-check deterministic verifier (coverage, binding, replacement, risk). Promoted contracts are inlined into a rewritten skill skeleton together with restored concrete action templates, giving the agent two complementary signals: a typed signature for what the skill does and a concrete template for how to invoke it. On the 134-game ALFWorld unseen split with gpt-4o-mini, pooled across three seeds, SaP wins 82/402 paired games versus 47/402 for the Graph-of-Skills (GoS) baseline (pooled McNemar p = 8.2e-5), at -22.8 +/- 6.4% input tokens and -14.5 +/- 4.1% LLM calls per game.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes