As large language models (LLMs) increasingly operate as agents, their procedural knowledge is stored in reusable skill packages that are loaded at inference time. However, as these libraries grow, a key challenge emerges: how to expose the smallest sufficient executable context under limited context budgets. Existing systems often struggle to reuse routines below the whole-skill level, preserve procedural contracts during compression, and keep compressed routines executable and expandable.
To address this, researchers at Hugging Face propose SkillZip, an execution-aware procedural abstraction framework that performs contract-preserving compression over section-level graphs. SkillZip rewrites recurring contract-valid motifs into reversible ported macros while preserving boundary signatures, dependency closure, verifier reachability, and source-level expansion. At inference time, it hydrates a compact, dependency-closed context and expands macros only when required.
The framework also includes ReZip, a component that integrates new skills and revises risky macros using execution evidence. This allows the compressed library to evolve as skills change, addressing the challenge of updating compressed libraries over time.
In experiments on technical and embodied agent benchmarks, SkillZip consistently outperformed the strongest baseline by up to 12.2 points, achieving a 3.46x compression ratio with 99.2% dependency preservation and 98.7% verifier reachability. Scaling analyses further confirmed robust retrieval across skill libraries ranging from 200 to 100,000 skills.