打开文档导航

LLM-Tool Compiler:把 tool fusion 收窄成 AST batch pass

Primary source: An LLM-Tool Compiler for Fused Parallel Function Calling

一句话

论文用 LLM 生成 fused tools 并让 dispatcher选择它们;Pysolate可以吸收相同调用的 batch fusion,但 legality不能交给 GPT,也不能用 restart掩盖已经发生的 effect。

原工作做了什么

LLM-Tool Compiler根据用户请求和工具集合识别可以合并的操作,生成 composite/fused function,再让另一个 LLM 选择和调用。实验报告 latency、success rate 和 correctness ratio,部分任务存在轻微 performance degradation。

系统的 compiler 名称覆盖了 tool synthesis、tool presentation、dispatch 和 execution多个部分。只有已确定调用序列的 fusion 与 AST pass直接对应。

可以吸收的 pass

典型 rewrite 是:

values = [workspace.read_text(path) for path in paths]

变成:

values = __pysolate_batch_read_text__(paths)

Host capability adapter必须声明并验证:

ordered map(single_call, args) == batch_call(args)

合同还需要数量、输入/输出字节、per-item outcome、source-order error、freshness、Plan、privacy 和 workspace root。

Correctness 与副作用

论文用任务级指标检验 fused tools是否工作,不提供对原 call sequence 的程序等价证明。它的错误处理主要通过 reset/restart恢复。对有副作用工具,restart可能重复已经完成的操作。

Batch API 还会引入 partial success:原顺序程序在第一个错误后停止,batch server却可能已经处理后续项目。把多个 calls压成一个 receipt也会丢失 logical occurrence、budget和approval信息。

Pysolate 结论

capability_batch_fusion 是可做的真实 pass,但 V1 只允许 pure operations或 exact frozen-root reads。一个 physical batch仍要展开成原程序的 ordered logical events和逐项 receipts。普通 writes除非 adapter提供真实 atomic transaction和等价异常合同,否则拒绝 fusion。