Multi-Pass LLM Compilation for HTN Domain Authoring
Éric Jacopin ⋅ Koichi Takahashi
Abstract
Generating a Hierarchical Task Network (HTN) planning domain from a repository of Model Context Protocol (MCP) servers requires an author to produce primitive actions with correct preconditions and effects, methods with flat-tuple decompositions, initial-state scenarios, and -- crucially -- an action-to-tool binding layer with execution-time data-flow templates. Asking a language model to do this in a single prompt conflates structural and data-flow concerns, especially on the template-variable construct (\verb|${context.X}|) whose Python surface form disagrees with its run-time semantics. We present \textsc{htn-creator}, a compiler-style multi-pass LLM skill that separates structure, data flow and binding into three gated passes connected by validated intermediate representations. On a \emph{bio-robot} fixture with $N{=}3$ independent runs across six configurations (v1/v2 skill $\times$ Sonnet/Haiku $\times$ with/without skill), the v2 skill reaches 100\,\% output-quality pass rate on both Sonnet and Haiku against $\approx$48\,\% without any skill scaffolding. Haiku matches Sonnet on output quality but executes the multi-pass structure less consistently ($\sigma{=}24\,\%$ vs $\sigma{=}3.5\,\%$), and with-skill runs consume fewer tokens than without-skill runs despite producing higher-quality output.
Chat is not available.
Successful Page Load