K-文化的一切——从回归到 K-美妆,发送到您的邮箱订阅邮件

METAL MEDIA

SkillZip: Contract-Preserving Graph Compression for Scalable Agent Skill Libraries

arXiv:2608.056042026-08-05

让AI智能体不必每次都读完整的'技能手册',只调取所需步骤,并在压缩时保留可执行的关键约定

AI智能体依赖越来越多的程序性'技能包'来指导操作,若每次都整包加载,会浪费上下文并重复加载相互重叠的步骤。SkillZip将技能拆分为按功能分区的节点,把跨技能反复出现的流程压缩成可逆的'宏'节点,同时保留其执行约定(输入输出、执行条件、验证条件),并只在任务需要时展开相应部分。在技术型和具身智能体基准测试中,该方法比最强基线高出最多12.2个百分点,同时实现3.46倍压缩率、99.2%的依赖保留率和98.7%的验证可达率。

METAL MEDIA 解读图

SkillZip流程:从技能包到压缩后的可执行上下文

证据状态已报告实测结果

  1. Sec2Graph将技能包拆分为按角色分类的分区节点(意图、输入、前置条件、操作、验证器、输出),连接成可执行图。
  2. MotifZip寻找跨技能反复出现且边界接口、依赖关系、验证可达性一致的子图,只将这些改写为可逆的宏节点。
  3. PathHydrate查询到来时,只在固定上下文预算内展开该任务实际需要的压缩图部分。
  4. ReZip根据新加入的技能和执行成功/失败反馈持续更新压缩库,提升新流程或撤回变得有风险的宏。
这是 METAL MEDIA 制作的解读图,并非论文作者提供的原图。

他们做了什么

  1. 问题:随着技能库增长,整包检索会重复加载相互重叠的流程,纯文本压缩可能掩盖对执行至关重要的约定(输入输出、验证条件),而执行图通常在检索之后才构建,导致技能库本身从未以压缩形式被持久存储。
  2. 方法:Sec2Graph先将每个技能包拆分为按角色分类的分区节点(意图、输入、前置条件、操作、验证器、输出等),连接成可执行图;MotifZip随后在多个技能中寻找边界接口、依赖关系和验证可达性都一致的重复子图,只将这些子图改写为可逆的'宏'节点。
  3. 在查询时,PathHydrate只在固定上下文预算内展开任务实际需要的压缩图部分;ReZip则根据新加入的技能和执行反馈(成功或失败记录)持续更新压缩库,提升新出现的常用流程,或撤回变得有风险的宏。
  4. 实验在SkillsBench(技术型软件智能体基准)和ALFWorld(具身家庭智能体基准)上进行,覆盖多个大语言模型骨干模型。
  5. 结果:SkillZip在ALFWorld上比最强基线SkillDAG高出最多12.2个百分点,实现3.46倍压缩率,依赖保留率达99.2%,验证可达率达98.7%,且在技能库规模从200个扩展到10万个时检索优势依然保持;在1000个技能的库中,51.7%的任务只需不到2000个token的上下文,最常见区间为1000到1500个token。
Figure 1. Representative skill-library workflows.
Figure 1. Representative skill-library workflows.
Table 1. Main results on SkillsBench and ALFWorld. R is task reward (%) on SkillsBench or episode success rate (%) on ALFWorld. Arrows report point changes from Vector Skills. The best comparable results are in bold.
BackboneMethodSkillsBench (19)ALFWorld (40)
R↑Ret@1↑Ret@5↑MRR↑R↑Ret@1↑Ret@5↑MRR↑
MiniMax-M2.7Vanilla Skills17.2 ↑6.847.1 ↓3.6
Vector Skills10.43.610.85.850.737.968.649.2
GoS (24)18.7 ↑8.350.6 ↑47.065.5 ↑54.757.3 ↑51.554.3 ↑3.656.4 ↑18.586.4 ↑17.867.9 ↑18.7
SkillDAG (1)27.3 ↑16.966.7 ↑63.178.2 ↑67.471.3 ↑65.567.1 ↑16.457.9 ↑20.092.1 ↑23.571.1 ↑21.9
SkillZip33.3 ↑22.973.6 ↑70.092.0 ↑81.281.3 ↑75.579.3 ↑28.685.7 ↑47.898.6 ↑30.091.2 ↑42.0
gpt-5.2-codexVanilla Skills27.4 ↑5.989.3 ↓3.6
Vector Skills21.53.610.85.892.937.968.649.2
GoS (24)34.4 ↑12.950.6 ↑47.065.5 ↑54.757.3 ↑51.593.6 ↑0.756.4 ↑18.586.4 ↑17.867.9 ↑18.7
SkillDAG (1)36.8 ↑15.370.1 ↑66.575.9 ↑65.173.0 ↑67.293.6 ↑0.760.4 ↑22.585.1 ↑16.569.6 ↑20.4
SkillZip43.0 ↑21.574.7 ↑71.188.5 ↑77.781.0 ↑75.296.4 ↑3.590.7 ↑52.899.3 ↑30.795.0 ↑45.8
Figure 2. Overview of the SkillZip framework. Sec2Graph retains occurrence-specific sections and links compatible ones through canonical prototypes; MotifZip rewrites recurring contract-valid subgraphs as reversible macros; PathHydrate compiles a budgeted executable context; and ReZip updates the compressed library from new skills and execution feedback.
Figure 2. Overview of the SkillZip framework. Sec2Graph retains occurrence-specific sections and links compatible ones through canonical prototypes; MotifZip rewrites recurring contract-valid subgraphs as reversible macros; PathHydrate compiles a budgeted executable context; and ReZip updates the compressed library from new skills and execution feedback.
Table 9. Measured local structural construction cost after cached contract extraction. Values report aggregate wall-clock time for graph construction and MotifZip. LLM inference is excluded.
SkillsSection nodesGraph + MotifZip↓
1006,441274 ms
20010,309436 ms
50024,3331.06 s
1K48,8381.44 s
2K96,7392.90 s
5K240,0807.78 s
10K477,68116.1 s
100K4.77 M178 s
Figure 3. Contract-extraction quality on the annotated subset. Bars show field-level F1 and exact match; dashed lines denote macro averages.
Figure 3. Contract-extraction quality on the annotated subset. Bars show field-level F1 and exact match; dashed lines denote macro averages.
Table 10. Local retrieval and rendering cost on SkillsBench after task anchors are available. Online excludes provider inference; Rendered Tok includes fixed rendering metadata and any indivisible selected unit.
MethodOnline (ms)↓Rendered Tok↓
Vector Skills12.12,834
GoS34.62,517
SkillDAG41.23,103
SkillZip27.91,941
Figure 4. Task reward of SkillZip as the procedural-content selection budget varies on SkillsBench with MiniMax-M2.7. The dashed line marks the default 3,000-token budget.
Figure 4. Task reward of SkillZip as the procedural-content selection budget varies on SkillsBench with MiniMax-M2.7. The dashed line marks the default 3,000-token budget.
Table 11. End-to-end trajectory cost on the default 1K-skill SkillsBench setting with MiniMax-M2.7. Values are task averages. Prompt counters aggregate all agent turns; task time spans model inference, tool and container execution, and harness interaction.
MetricVanilla SkillsSkillDAGSkillZip
Total prompt↓2,429,2372,782,6961,473,532
Uncached prompt↓78,08176,88062,526
Cached prompt↓2,351,1562,705,8161,411,006
Completion↓34,59231,96320,601
Tool calls↓32.936.928.9
Task time (s)↓464.7429.7339.0
Reward↑17.227.333.3
Figure 5. Mean rendered context on the 1K-skill SkillsBench library. Whole-skill comparisons render each retrieved package in full, whereas SkillZip hydrates dependency-closed sections.
Figure 5. Mean rendered context on the 1K-skill SkillsBench library. Whole-skill comparisons render each retrieved package in full, whereas SkillZip hydrates dependency-closed sections.
Table 15. Case Study 1 – Retrieval trace for header normalization with row-count verification. Skill-level retrieval exposes overlapping packages, whereas SkillZip selects the shared operation and its required verifier path.
Retrieval unitMatching evidenceSelected contextContext consequence
Skill levelPackage-level similarity to both skill descriptionsFull Clean CSV and Pivot Table packagesIncludes the requested routine, but also exposes missing-value repair, pivot aggregation, and competing output rules.
Section levelOperation anchor (normalize headers) and verifier anchor (row count unchanged)Mingest with file/schema dependencies and the row-count verifierCloses the required dependencies and verifier path without loading unrelated downstream branches.
Figure 6. Task-level distribution of the context rendered by SkillZip. Overall, 51.7% of tasks use fewer than 2,000 tokens, and 1,000–1,500 tokens is the modal interval.
Figure 6. Task-level distribution of the context rendered by SkillZip. Overall, 51.7% of tasks use fewer than 2,000 tokens, and 1,000–1,500 tokens is the modal interval.
Table 16. Case Study 2 – Contract-aware comparison of three textually similar routines. MotifZip accepts the two CSV occurrences because their interfaces, execution requirements, and verifier boundaries agree, while keeping the workbook occurrence separate.
OccurrenceInterfaceExecutionVerificationMotifZip decision
Clean CSVCSV + delimiter → normalized tableInfer delimiter, parse rows, normalize headers, and preserve row identitySchema report and reachable row-count hookAccept into Mcsv​-​ingest
Pivot TableCSV + delimiter → normalized tableSame ingest routine; pivot aggregation starts after the macro output portSchema report; downstream total verifier remains occurrence-specificAccept into Mcsv​-​ingest
Formula-Safe WorkbookXLSX → formula-preserving workbookUse a formula-aware resource and preserve formulas during normalizationFormula-integrity and row-count verifiersReject from the CSV macro; retain separately
Reversible rewrite Mcsv​-​ingest keeps occurrence-specific source/port maps and downstream verifiers.
Figure 7. Failure attribution grouped by the earliest blocking stage.
Figure 7. Failure attribution grouped by the earliest blocking stage.
Table 17. Case Study 3 – Illustrative ReZip trace. Repeated compatible occurrences promote a residual, while execution risk triggers controlled macro demotion.
StageIncoming signalContract evidenceReZip updateResulting library state
InsertA new Merge Monthly Reports skill arrivesIngest matches Mcsv​-​ingest; the align–merge–balance subgraph is unmatchedReuse the ingest macro and buffer the residualKnown structure is compressed; novel steps remain explicit
PromoteThe merge residual recurs in later skillsPorts, dependencies, resource family, and balance verifier remain stablePromote Mperiod​-​mergeLater skills reuse one verified period-merge routine
ReviseFormula-bearing tasks repeatedly expand or fail the generic export macroFailures localize to the XLSX resource and formula-integrity verifierSplit by resource family; require full source for XLSXCSV export remains compact; workbook safeguards are restored
ReuseA future CSV or workbook query arrivesTask anchors identify the required resource and verification contractSelect the macro and hydration level by task contractCompact where stable; source-expanded where evidence indicates risk

研究结果

  • 在SkillsBench和ALFWorld上的实验中,SkillZip比最强基线SkillDAG在ALFWorld上高出最多12.2个百分点(以任务奖励或情节成功率衡量)。
  • SkillZip实现了3.46倍的压缩率,活跃存储减少71.0%,同时依赖保留率保持在99.2%,验证可达率保持在98.7%。
  • 当技能库规模从200个扩展到10万个技能时,检索性能优势依然保持稳定。
  • 在1000个技能的库中,51.7%的任务处理仅使用了不到2000个token的渲染上下文,最常见的区间是1000到1500个token。
  • SkillZip作为即插即用的程序性记忆层,在六种不同的大语言模型骨干上均可应用,无需针对特定骨干模型进行微调。

可应用场景

  • 拥有大量文档化流程(如表格清洗、结果验证、机器人操作步骤)的AI智能体系统,可参考此方法在节省上下文预算的同时避免重复加载相互重叠的流程。
  • 技能库持续扩张且不断积累执行日志的服务,可参考ReZip的思路来维护压缩后的宏:提升新出现的可复用流程,并撤回被证明有风险的宏。
  • 该框架同时在技术型编程/数据处理基准和具身家庭机器人基准上进行了测试,可为跨领域压缩方法的实验设计提供参考。

局限与待验证事项

  • 实验仅限于SkillsBench(技术型软件智能体)和ALFWorld(家庭机器人智能体)两个基准,在其他领域的表现尚未单独验证。
  • 宏的筛选与改写采用贪心策略,论文本身也说明该策略不保证在所有重叠模式上达到全局最优。
  • 部分分区角色分类和约定提取依赖模型辅助解析,论文未详细验证解析边界或角色推断错误可能对压缩质量造成的影响。
  • 论文未单独提供ReZip在长期持续运行的大规模生产环境中,对宏进行提升、拆分、退役的长期追踪实验。

为什么重要

随着技能库从几百条扩展到数万条,整包加载的成本和相互重叠流程带来的混乱会同步增加,而SkillZip提供了一种在分区级别压缩、同时不丢失保证执行安全的约定(输入输出、验证)的具体方法。这为构建大规模智能体技能库的从业者提供了同时管理上下文预算与正确性的可参考方案。

本文术语

  • 技能包 · 包含指令、脚本、参考资料和验证规则的程序性知识包,供AI智能体在推理时加载使用
  • 程序约定(procedural contract) · 定义一个流程接受什么输入输出、在什么条件下执行、以及结果如何被验证的规约
  • 宏节点(macro node) · 将反复出现的流程子图压缩为一个节点的表示方式,必要时可无损展开回原始源内容
  • 验证可达性(verifier reachability) · 从每个改变状态的操作出发,是否确实存在一条通往验证该结果的检查步骤的路径
  • 依赖保留率(dependency preservation) · 压缩后各流程之间的输入、条件、资源连接关系被保持完整的程度

论文原文摘要(英文)

Large Language Models (LLMs) increasingly act as agents whose procedural knowledge is stored in reusable skill packages and loaded at inference time. As skill libraries grow, a central challenge is to expose the smallest sufficient executable context under a limited context budget. Existing systems struggle to reuse routines below the whole-skill level, preserve procedural contracts during compression, keep compressed routines executable and expandable, and update the compressed library as skills evolve. These challenges reveal a unit mismatch: skills are retrieved as packages, compressed as text, and converted into execution graphs only after retrieval, whereas reliable reuse requires a contract-bearing procedural unit. We 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. ReZip further integrates new skills and revises risky macros using execution evidence. Comprehensive experiments1 on technical and embodied agent benchmarks show SkillZip consistently outperforms the strongest baseline by up to 12.2 points, while achieving a 3.46x compression ratio with 99.2% dependency preservation and 98.7% verifier reachability. Scaling analyses further confirm robust retrieval across skill libraries ranging from 200 to 100K skills.

作者 · Xingyu Tan

在 arXiv 阅读

最新论文

全部论文 →

METAL MEDIA 最新报道

图片来源: Xingyu Tan et al., arXiv:2608.05604, CC BY 4.0