skillfed

Typed contracts + call templates: 82 vs. 47 ALFWorld wins, −23% tokens per game

Notes on Skill-as-Pseudocode: Refactoring Skill Libraries to Pseudocode for LLM Agents (arXiv:2605.27955) — Xinze Li, Yuhang Zang, Yixin Cao, Aixin Sun · May 2026

Note published · written by SkillFed’s research pipeline from the paper above · how these notes are made

AI-assisted notes · reviewed by SkillFed Frontier & other

Skill-as-Pseudocode (SaP) rewrites markdown skill libraries into typed pseudocode, so agents stop re-deriving schemas and call syntax from prose on every retrieval. The pipeline clusters similar procedural passages across a library and extracts a typed contract for each cluster. Before promotion, each contract has to clear a four-check deterministic verifier — coverage, binding, replacement, risk. Verified contracts get inlined into a rewritten skill file alongside restored concrete action templates, so one retrieval now hands the agent both a typed signature for what a skill does and syntax it can invoke directly.

On the 134-game ALFWorld unseen split with gpt-4o-mini, pooled across three seeds, SaP wins 82 of 402 paired games against 47 for the Graph-of-Skills baseline (pooled McNemar test, p = 8.2×10⁻⁵) — and does it while cutting input tokens 22.8% and LLM calls 14.5% per game. The mechanism shows up directly in action quality: the agent's next environment action after a retrieval succeeds 29.3% of the time under SaP versus 20.5% under GoS, widening to a 1.57x gap on explicit skill-lookup events. That gain depends on one design choice: an ablation that promotes contracts to standalone top-level retrieval results, instead of nesting them under their parent skill, drops reward by roughly 27%.

Key numbers

ALFWorld paired wins (SaP vs. GoS)82/402 vs. 47/402
Significance (pooled McNemar)p = 8.2×10⁻⁵
Input tokens per game−22.8% ± 6.4%
LLM calls per game−14.5% ± 4.1%
Reward drop if retrieval hierarchy is flattened−27% (22.4%→16.4%, seed 42)

Skills related to this research

Related notes

References

  1. Li, Zang, Cao & Sun, "Skill-as-Pseudocode: Refactoring Skill Libraries to Pseudocode for LLM Agents," arXiv:2605.27955 (2026).
  2. "Graph-of-Skills: Dependency-Aware Structural Retrieval for Massive Agent Skills," arXiv:2604.05333 (2026).
  3. Shridhar et al., "ALFWorld: Aligning Text and Embodied Environments for Interactive Learning," ICLR (2021).