Search papers, labs, and topics across Lattice.
This paper introduces Skill-as-Pseudocode (SaP), a method that automatically converts markdown skill libraries into typed pseudocode to enhance the performance of LLM agents. By extracting typed contracts from procedural passages and applying a four-check deterministic verifier, SaP provides agents with clear signatures and concrete templates for skill invocation, addressing the confusion often caused by free-form prose. The approach significantly outperforms the Graph-of-Skills baseline in the ALFWorld environment, achieving a higher win rate while reducing input tokens and LLM calls per game.
LLM agents can achieve a remarkable 82 wins out of 402 games by leveraging structured pseudocode, transforming how they interact with skill libraries.
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.