Optimizing Agent Execution through Just-in-Time Skill Compilation
Abstract
Agent skills describe procedures that an LLM agent unfolds at run time into sequences of reasoning steps, tool calls, and observations. Much of this work recurs across runs, yet writing the procedure back into a skill as text still leaves the agent to carry it out step by step. We present a just-in-time compiler for skills that treats execution traces as profiling information, compiles recurring deterministic segments into parameterized scripts, and delivers them as an ordinary skill. Our central observation is that savings depend on the handoff: a script helps only if the agent calls it where it applies and trusts what it returns. The compiler therefore records each script's assumptions and tests them on subsequent seen inputs; a runtime interface discloses these assumptions on demand and returns a checkable execution summary. We evaluate on 20 SkillLearnBench tasks and a 100-task SpreadsheetBench subset, using held-out inputs. On SkillLearnBench our system raises correctness from 60% to 80% and lowers median delivery cost by 37.7% relative to bare agents. On SpreadsheetBench, it raises correctness from 72% to 78% and reduces median delivery cost by 24.7% relative to static compilation.
est. 32% chance this paper gets accepted at ICLR 2027.
What do you think this paper will get?
All positions stay anonymous.