SMITH:面向大语言模型智能体的工具创建与使用联合优化
原题SMITH: Joint Optimization of Tool Creation and Use for Large Language Model Agents
读前速览
SMITH 是一个强化学习框架,联合训练单一 LLM 策略同时编写和调用工具,让 4B 的 Qwen3 模型在留出任务和域外任务上击败了远更大的工具编写者和推理时脚手架。
将工具编写者与工具使用者解耦,消除了唯一能告诉编写者其 schema 不可用的信号。
现有系统(LATM、CRAFT、TroVE、KTCE)提示冻结的 LLM 在推理时合成工具,而由另一个更弱的模型调用它们;模糊的 schema 会导致错误调用,但梯度从未回流到编写者。SMITH 通过让同一策略编写并随后调用每个工具来闭合这一循环。
将格式、执行和评判奖励保持为独立轴,使每种失败模式贡献各自的梯度,而非被平均掉。
格式错误的代码/schema 对会以零奖励终止 rollout;评估奖励仅从通过评估模型真实工具调用得到的答案中计算;评判奖励直接惩罚语法错误,并在 schema/代码不匹配时将分数减半。将这些合并为单一标量会模糊不同的纠正信号。
用 SMITH 训练的 4B 模型在真正留出的任务上超越了远更大的工具编写者和精心设计的推理时脚手架。
SMITH 在未见任务上达到 79.9 宏平均,而 Qwen3-30B-A3B 上的 LATM 为 74.1,CRAFT 为 76.5,同时输出 token 数比标准思维链少约 32 倍。ReTool 等蒸馏基线在已见任务上领先(92.2),但在未见任务上下降近 30 分,表明对演示者分布过拟合。
RL 训练的 4B 编写者所写的工具编码了可复用的解决方案,可在模型规模间双向迁移。
将其与冻结的 LFM2.5-350M 消费者配对,留出准确率从 11.6 提升到 42.9,与未训练的 Qwen3-30B-A3B 编写者的 41.5 相当。反之,将 SMITH 的工具与更强的 Qwen3-30B-A3B 消费者配对,也击败了同一 30B 模型为自己编写工具,将任务加权总分从 70.2 提升到 76.6。
联合训练,而非专家构建者加专家使用者,才是有效成分。
消融实验显示,单独训练的 30B-A3B 构建者与单独训练的 4B 工具使用专家配对(解耦创建/使用)在未见 RG 上得分为 58.9,低于仅训练工具创建的单一模型(68.8)。只有完整目标,在单一策略中解耦执行和评判奖励,才能达到最佳综合得分。
完整摘要
SMITH(Schema-grounded Multi-task Iterative Tool Honing,基于模式的多任务迭代工具打磨)针对现有工具创建系统的一个结构性缺陷:冻结的 LLM 在推理时编写工具,而另一个更弱的模型使用它们,因此编写者永远无法得知其模式是否真正可调用。SMITH 改为在两种交错的 rollout 类型上训练单一策略——构建(从四个示例中推断出可复用的 Python 函数及 JSON schema,并在十六个更难的留出问题上验证)和使用(仅凭 schema 从工具池中调用工具,带两个干扰项,五轮内完成)。三条奖励轴保持独立,使每种失败模式获得各自的梯度:格式奖励针对格式良好的代码/schema 对,基于执行的评估奖励来自必须实际调用工具的评估模型,LLM 评判奖励针对代码正确性和 schema 质量。评估者和评判者会定期与策略重新同步,以打破自我评判的循环。在 13 个 Reasoning-Gym 程序化任务上用 DAPO 训练后,4B 的 Qwen3 在未见任务上达到 79.9 的宏平均,领先于未训练的 30B-A3B 工具编写者,且输出 token 数比思维链少约 32 倍。工具可跨规模迁移:冻结的 350M 消费者模型从 11.6 提升到 42.9 准确率,与八十倍大的编写者相当,且该方案无需修改即可提升 Qwen3-8B 和 Granite-3.3-8B。
目录 · 17 节
已被 NeurIPS 2026 接收(海报展示)Accepted to NeurIPS 2026 (Poster)
SMITH:基于模式的多任务迭代式工具精炼SMITH: Schema-grounded Multi-task Iterative Tool Honing
- 谭志睿1,2Zhi Rui Tam1,2
- Chieh-Yen Lin1Chieh-Yen Lin1
- Yun-Nung (Vivian) Chen2
- 孙少华¹,²Shao-Hua Sun1,2
- 李宏毅2Hung-yi Lee2
1Appier AI 研究 2国立台湾大学1Appier AI Research 2National Taiwan University
摘要Abstract
工具增强型语言模型受限于人类愿意编写的 API;现有的工具创建系统通过在推理时提示一个冻结的 LLM 来弥补这一点,但这使得编写工具的模型与使用工具的模型彼此脱节,也没有信号表明它生成的模式确实是它能够调用的模式。我们提出 SMITH(基于模式的多任务迭代工具打磨),一种在单一策略中联合训练工具创建和工具使用的强化学习框架。每次 rollout 要么是构建任务(根据少量示例编写工具),要么是使用任务(针对一个留出问题调用工具池中的工具)。三个独立的奖励维度分别捕捉模式、代码和结果方面的失败,使每种失败模式都能各自贡献梯度。使用 SMITH 在 13 个配有精确验证器的程序推理任务上训练的 4B Qwen3,在留出任务上达到 79.9 的宏平均准确率,在所有评估方法中表现最佳,也领先于未经训练的 30B-A3B 工具编写模型。它在 TabMWP-Hard 上也达到 40.4,在域外 GQA 上达到 42.6(比同一骨干模型上表现最佳的推理时基线高 7.6),且未使用任何视觉或表格训练数据。当由冻结的 350M 学生模型调用时,我们的 4B 模型编写的工具,效果可与规模大一个数量级的编写模型所生成的工具相媲美。同样的训练方案也能直接提升 Qwen3-8B 和 Granite-3.3-8B 的表现。Tool-augmented language models are bounded by the APIs humans bothered to write; existing tool-creation systems patch this by prompting a frozen LLM at inference time, leaving the model that writes a tool decoupled from the one that uses it, with no signal that the schemas it produces are schemas it can actually invoke. We propose SMITH (Schema-grounded Multi-task Iterative Tool Honing), a reinforcement learning framework that jointly trains tool creation and tool use inside a single policy. Each rollout is either a build task (write a tool from a few examples) or a use task (invoke a pooled tool on a held-out question). Three separate reward axes catch schema, code, and outcome failures independently, so each failure mode contributes its own gradient. A 4B Qwen3 trained with SMITH on 13 procedural reasoning tasks with exact verifiers reaches 79.9 macro-average accuracy on held-out tasks, the best across all evaluated methods and ahead of an untrained 30B-A3B tool-writer. It also reaches 40.4 on TabMWP-Hard and 42.6 on out-of-domain GQA (+7.6 over the best same-backbone inference-time baseline), without any visual or tabular training data. When invoked by a frozen 350M student, tools written by our 4B match those produced by a writer an order of magnitude larger. The same recipe also lifts Qwen3-8B and Granite-3.3-8B without modification.
为什么工具创建与工具使用需要协同训练Why tool creation and tool use need to be trained together
工具增强型大语言模型的能力,只取决于别人已经为它们编写的工具:计算器、搜索 API、Python 沙箱。当不存在合适的工具时,智能体就会陷入困境。近期的研究(LATM、CRAFT、TroVE、KTCE)让模型能够即时合成新工具,但几乎总是由强大的模型编写工具,再由另一个较弱的模型使用它。编写工具的模型始终无法得知,它设计的接口是否真的易于调用。Tool-augmented LLMs are only as capable as the tools someone already wrote for them: a calculator, a search API, a Python sandbox. When the right tool doesn't exist, the agent is stuck. Recent work (LATM, CRAFT, TroVE, KTCE) lets a model synthesize new tools on the fly, but almost always with a powerful model writing the tool and a separate, weaker model using it. The writer never finds out whether its interface was actually easy to call.
- 大型冻结 LLM 在推理时编写工具Large frozen LLM writes a tool at inference time
- 另一个能力较弱的模型试图调用它A different, weaker model tries to invoke it
- 模式不明确 → 调用错误 → 答案错误Ambiguous schema → wrong call → wrong answer
- 没有梯度:写入方永远不会知道其架构验证失败了。No gradient: the writer never learns its schema failed
- 相同的策略会编写该工具(代码 + JSON 架构)Same policy writes the tool (code + JSON schema)
- 同一策略稍后仅凭 schema 就会调用它。Same policy invokes it later from the schema alone
- 奖励根据该次使用是否成功来计算。Reward is computed from whether that use succeeded
- 梯度直接回传给工具编写者Gradient flows straight back to the tool writer
这带来了论文必须解决的两个具体训练问题。奖励分解:工具可能因代码错误、schema 错误、两者彼此不一致,或工具在技术上正确但设计不佳而失败。每种情况都需要不同的纠正信号。循环评估:评估工具质量需要一个评判者,但让模型根据自身实时权重进行评判并不可靠,而冻结的外部评判者又无法随着策略一起改进。This creates two concrete training problems the paper has to solve. Reward decomposition: a tool can fail because its code is wrong, its schema is wrong, the two disagree with each other, or the tool is technically correct but poorly designed. Each needs a different corrective signal. Circular evaluation: scoring tool quality needs a judge, but a model judging its own live weights is unreliable, and a frozen external judge never improves alongside the policy.
SMITH:基于模式的多任务迭代式工具优化SMITH: Schema-grounded Multi-task Iterative Tool Honing
SMITH 是一个多任务 RL 框架,使用 DAPO(GRPO 的 clip-higher 变体)进行训练,每个批次都会混合两种 rollout 类型:构建和使用。两者都在同一个策略中进行优化,因此工具创建和工具使用产生的梯度会在每一步更新同一组权重。SMITH is a multi-task RL framework, trained with DAPO (a clip-higher variant of GRPO), that mixes two rollout types into every batch: build and use. Both are optimized inside the same policy, so gradients from tool creation and tool consumption update the same weights every step.
任务 1 构建:编写工具Task 1Build: write the tool
策略会看到 N = 4 组问答对,必须推断出它们背后通用的流程,然后将其表述为一对 OpenAI 兼容的(Python 函数、JSON Schema)。随后,使用该工具处理 K = 16 个留出的测试问题,这些问题的难度高于构建工具所依据的示例;模型在生成时无法看到标准答案。只会对简单归纳示例进行模式匹配的工具得分接近于零;只有真正可复用的抽象才能经受住考验。The policy sees N = 4 question–answer pairs and must infer the general procedure behind them, then express it as an OpenAI-compatible (Python function, JSON schema) pair. The tool is then run against K = 16 held-out questions drawn from a harder difficulty band than the examples it was built from; the model never sees the ground-truth answers at generation time. A tool that only pattern-matches the easy induction examples scores near zero; only a genuinely reusable abstraction survives.
逐步讲解一个示例Walk through an example
4 个上下文示例(简单难度)4 in-context examples (easy band)
- 问:42 的二进制形式中有多少个 1?答:3Q: How many 1-bits in the binary form of 42? A: 3
- 问:255 的二进制形式中有多少个 1?答:8Q: How many 1-bits in the binary form of 255? A: 8
- ……还有 2 个… 2 more
策略编写的工具Tool the policy writes
def solve(question: str) -> str:
n = int(re.search(r"\d+", question).group())
return str(bin(n).count("1"))
{
"name": "solve",
"description": "Counts the 1-bits in the
binary form of the integer named in
the question.",
"parameters": {
"type": "object",
"properties": {
"question": { "type": "string" }
},
"required": ["question"]
}
}
16 道留出(难度更高)题目中答对 13 道 → 获准进入工具池13 / 16 held-out (harder) questions correct → admitted to the tool pool
任务 2使用:调用该工具Task 2Use: call the tool
策略会收到一个目标问题和一条工具池条目:其中包含一个匹配的领域工具,以及两个来自无关类别的干扰工具,迫使它识别正确的 schema。它最多有 T = 5 轮来调用工具并作答;效率惩罚会促使它避免耗尽轮次预算。如果工具池中还没有该类别的工具,模型必须先根据相同的上下文示例构建一个工具。The policy receives a target question and a tool pool entry: one matching domain tool plus two distractor tools from unrelated categories, forcing it to identify the right schema. It has up to T = 5 turns to call the tool and answer; an efficiency penalty discourages burning through the turn budget. If no pool tool exists yet for the category, the model must build one first from the same in-context examples.
试试看:选择合适的工具Try it: pick the right tool
目标问题Target question
92,401 的二进制表示中有多少个 1?“How many 1-bits are in the binary form of 92,401?”
池条目——每个模式都命名为 solve(question);只有描述能区分它们Pool entry — every schema is named solve(question); only the description tells them apart
三个奖励维度,刻意保持彼此独立Three reward axes, kept separate on purpose
SMITH 并未将所有内容压缩成一个分数,而是将格式、执行情况和评审反馈作为相互独立的维度输入 DAPO,因此每种失败模式都能获得各自的梯度,而不会被平均掉。Rather than collapsing everything into one score, SMITH keeps format, execution, and judge feedback as independent axes fed to DAPO, so each failure mode gets its own gradient instead of being averaged away.
格式奖励Format reward
检查响应是否恰好包含一个 Python 代码块和一个 JSON 代码块,且两者中的函数名称和参数确实匹配。格式错误的一对会导致 rollout 终止,并在所有维度上获得零奖励。Checks the response contains exactly one Python block and one JSON block whose function name and parameters actually match. A malformed pair terminates the rollout with zero reward on every axis.
$$r^{\mathrm{fmt}} \in \{0,\ 0.5\}$$
评估奖励Evaluation reward
该工具会交给评估模型,由它调用该工具来回答每个留出问题。只有通过真实工具调用得到的答案才算数。模型不能靠在文本中推理出答案来走捷径。The tool is handed to an evaluator model, which must call it to answer each held-out question. Only answers that came through a real tool call count. A model can't shortcut this by reasoning the answer out in text.
$$r^{\mathrm{eval}} = \frac{1}{|\mathcal{T}|}\sum_{j=1}^{|\mathcal{T}|} \mathbf{1}\!\left[\pi^{\mathrm{eval}}(q_j \mid \mathcal{C}, \mathcal{S}) \approx a_j\right]$$
评审奖励Judge reward
LLM 评审器会对代码正确性、模式质量和整体质量进行评分,这些评分与执行奖励分开作为独立维度保留,不会合并其中。语法错误会直接扣分;模式与代码不匹配则会使分数减半。An LLM judge scores code correctness, schema quality, and overall quality, kept as a separate axis from execution reward, not folded in. A syntax error is penalized directly; a schema/code mismatch halves the score.
$$r^{\mathrm{judge}} = \begin{cases}-0.5 & \text{syntax error}\\ 0.5\, s_{\mathrm{overall}} & \text{schema}\neq\text{code}\\ s_{\mathrm{overall}} & \text{otherwise}\end{cases}$$
打破自我评判的循环依赖。评估器 \(\pi^{\mathrm{eval}}\) 和裁判 \(\pi^{\mathrm{judge}}\) 都从与策略相同的基础检查点启动,随后定期与最新的策略权重重新同步。这样,评估器就能与策略一同改进,同时避免因依据仍在实时更新的权重进行评分而产生的不稳定性。Breaking the circularity of self-judging. The evaluator \(\pi^{\mathrm{eval}}\) and judge \(\pi^{\mathrm{judge}}\) both start from the same base checkpoint as the policy, then are periodically re-synced to the latest policy weights. This lets the evaluator improve alongside the policy without the instability of scoring against live, still-updating weights.
使用任务的正确性,但会受到效率惩罚Use-task correctness, with an efficiency penalty
令 \(c \in \{0,1\}\) 表示最终答案是否符合真实答案。奖励会乘以效率系数 \(\eta(\rho)\) 进行缩放,该系数会随着回合比例 \(\rho = \min(n/T, 1)\) 的增大而衰减,并设有下限 \(\eta_{\min}=0.3\),确保即使达到回合上限,策略也不会对正确性漠不关心(\(\eta_{\mathrm{mid}} = 0.7\)):Let \(c \in \{0,1\}\) mark whether the final answer matches ground truth. The reward is scaled by an efficiency multiplier \(\eta(\rho)\) that decays as the turn fraction \(\rho = \min(n/T, 1)\) grows, with a floor \(\eta_{\min}=0.3\) so the policy is never indifferent to correctness even at the turn limit (\(\eta_{\mathrm{mid}} = 0.7\)):
$$ r^{\mathrm{correct}} = 2c\,\eta(\rho), \qquad \eta(\rho) = \begin{cases} 1 - 2(1-\eta_{\mathrm{mid}})\rho & \rho \le 0.5 \\[2pt] \max\!\bigl(\eta_{\min},\ \eta_{\mathrm{mid}}\,(1-2(\rho-0.5))^2\bigr) & \rho > 0.5 \end{cases} $$
Every training batch is split evenly, \(\mathcal{B} = \mathcal{B}_{\mathrm{build}} \sqcup \mathcal{B}_{\mathrm{use}}\) with \(|\mathcal{B}_{\mathrm{build}}| = |\mathcal{B}_{\mathrm{use}}| = B/2\), and DAPO accumulates both losses in a single backward pass: \(\mathcal{L} = \mathcal{L}_{\mathrm{DAPO}}(\mathcal{B}_{\mathrm{build}}) + \mathcal{L}_{\mathrm{DAPO}} (\mathcal{B}_{\mathrm{use}})\). Build and use gradients therefore update the same parameters \(\theta\) every step. Any tool with \(r^{\mathrm{eval}} > 0\) is pushed into a shared Tool Pool for reuse by future use-task rollouts. This is the "iterative honing" in SMITH's name.
实验设置Experimental setup
SMITH 在 Reasoning-Gym 的 13 个程序化任务类别上进行训练,涵盖算术、算法、代数、游戏和逻辑推理。选择这些任务类别,是因为其答案精确且可自动验证,并且每类任务都呈现出难度课程。工具通过简单示例诱导生成,但在同一任务系列中最难的难度档位上进行评分,从而有意将工具编写质量与实例难度区分开来。SMITH is trained on 13 procedural task categories from Reasoning-Gym, spanning arithmetic, algorithms, algebra, games, and logical reasoning, chosen because their answers are exact and automatically verifiable and each exposes a difficulty curriculum. Tools are induced on easy examples but graded on the hardest band of the same task family, deliberately separating tool-writing quality from instance difficulty.
主要骨干模型为 Qwen3-4B-Instruct,使用 LoRA(r = 64,α = 128)进行微调,并通过 DAPO 完成 60 个梯度步骤;构建与使用阶段的 rollout 按 1:1 混合。为检验该方案在不同模型家族中的普适性,也将其原样应用于 Qwen3-8B 和 Granite-3.3-8B。基线尽可能采用相同的 Qwen3-4B-Instruct 骨干模型:推理时工具编写方法 LATM、CRAFT、TroVE 和 KTCE;蒸馏基线 ReTool(基于 Qwen-32B 的轨迹)和 LATM(从 GPT-4.1 蒸馏);以及一个有意设置的规模扩展探针——在 Qwen3-30B-A3B 上运行 LATM。迁移效果通过 TabMWP-Hard(强化版表格推理基准)和 GQA(视觉问答)进行评估,这两个基准均未在训练中出现;此外,还使用外部指定的函数调用基准 BFCL v4 进行评估。The primary backbone is Qwen3-4B-Instruct, fine-tuned with LoRA (r = 64, α = 128) using DAPO for 60 gradient steps, build/use rollouts mixed 1:1. The recipe is also applied unmodified to Qwen3-8B and Granite-3.3-8B to test generality across model families. Baselines share the Qwen3-4B-Instruct backbone wherever possible: inference-time tool writers LATM, CRAFT, TroVE, and KTCE; distillation baselines ReTool (from Qwen-32B traces) and LATM (distilled from GPT-4.1); and a deliberate scaling probe, LATM on Qwen3-30B-A3B. Transfer is measured on TabMWP-Hard (a strengthened tabular-reasoning benchmark) and GQA (visual question answering), neither seen during training, and on BFCL v4, an externally specified function-calling benchmark.
结果Results
Reasoning-Gym 上的主要结果Main results on Reasoning-Gym
SMITH 是唯一一种在真正留出的任务上表现领先、同时使用 token 最少的方法。与蒸馏相比,使用 SMITH 的 RL 目标训练的 4B 模型,比从大得多的预言模型蒸馏而来的 4B 模型泛化得更可靠:ReTool 在已见任务上领先(92.2),但在未见任务上骤降近 30 分,这表明它过拟合了示范者的分布,而非学会了可迁移的构建并使用策略。与更复杂的推理时脚手架(CRAFT、TroVE、KTCE)以及更大的工具编写模型(Qwen3-30B-A3B)相比,SMITH 在未见任务上依然胜出,输出 token 数约为标准思维链的 1/32。SMITH is the only method that leads on genuinely held-out tasks while also using the fewest tokens. Against distillation, a 4B model trained with SMITH's RL objective generalizes more reliably than 4B models distilled from far larger oracles: ReTool leads on seen tasks (92.2) but drops nearly 30 points on unseen ones, a sign of overfitting to the demonstrator's distribution rather than learning a transferable build-and-use policy. Against more elaborate inference-time scaffolds (CRAFT, TroVE, KTCE) and a bigger tool-writer (Qwen3-30B-A3B), SMITH still wins on unseen tasks, using roughly 32× fewer output tokens than standard chain-of-thought.
| Method | Seen
Avg |
Unseen RG | I/O tokens | |||||
|---|---|---|---|---|---|---|---|---|
| Logic | Game | Algebra | Arith | Algo | Avg | |||
| Standard CoT | 58.0 | 49.9 | 60.3 | 56.8 | 62.7 | 48.6 | 55.7 | 173 / 3,206 |
| LATM* [Cai et al.] | 77.6 | 53.9 | 55.5 | 38.6 | 53.0 | 90.2 | 58.3 | 607 / 174 |
| LATM* – Qwen3-30B-A3B | 74.0 | 68.7 | 64.2 | 97.3 | 56.5 | 84.0 | 74.1 | 659 / 405 |
| CRAFT [Yuan et al.] | 74.1±0.7 | 27.4±1.3 | 89.5±0.0 | 94.2±1.2 | 76.6±1.1 | 95.0±0.0 | 76.5±0.4 | 1,226 / 418 |
| TroVE [Wang et al.] | 52.6±0.4 | 60.7±2.4 | 10.6±1.3 | 51.2±3.5 | 59.8±0.8 | 97.0±0.0 | 55.9±0.6 | 347 / 575 |
| KTCE [Ma et al.] | 61.0±1.5 | 60.2±1.5 | 79.8±1.6 | 70.6±0.3 | 45.6±0.4 | 69.3±1.8 | 65.1±0.2 | 319 / 404 |
| ReTool (distill Qwen-32B) | 92.2±0.8 | 50.3±2.3 | 55.0±0.8 | 48.7±0.6 | 79.8±2.7 | 82.4±0.1 | 63.2±0.4 | 1,707 / 633 |
| LATM (distill GPT-4.1) | 81.7±4.4 | 37.6±15.2 | 58.1±12.2 | 91.3±7.7 | 51.6±10.4 | 93.2±5.9 | 65.8±4.1 | 638 / 207 |
| SMITH | 85.2±2.7 | 74.2±0.6 | 63.7±1.1 | 97.9±2.6 | 70.6±2.1 | 93.0±0.4 | 79.9±2.2 | 664 / 100 |
工具在不同规模的模型间迁移Tools transfer across model scale
SMITH 的工具编码的究竟是真正可复用的解决方案,还是只有作者自己才懂的私人约定?我们从两个方向进行测试:将经过 RL 训练的 4B 工具生成模型,分别与规模小得多和大得多的工具使用模型配对。Do SMITH's tools encode a genuinely reusable solution, or a private convention only the writer understands? We test both directions: pairing the RL-trained 4B writer with a much smaller consumer, and with a much larger one.
将经过强化学习训练的 4B 编写器提供的工具与冻结的 LFM2.5-350M 消费者配对后,其留出集准确率从 11.6 提升至 42.9,达到大 80 倍的工具编写器(未经训练的 Qwen3-30B-A3B,准确率为 41.5)的水平。Pairing tools from the RL-trained 4B writer with a frozen LFM2.5-350M consumer lifts its held-out accuracy from 11.6 to 42.9, matching a tool-writer eighty times larger (Qwen3-30B-A3B, untrained, at 41.5).
工具编写来源变化时 LFM2.5-350M 的 RG(未见)准确率;编写器本身从未使用 LFM2.5 的输出进行微调。RG (Unseen) accuracy of LFM2.5-350M as the tool-writing source changes; the writer itself is never fine-tuned on LFM2.5's outputs.
反过来也是如此。将由 SMITH 的 4B 模型编写的工具与强得多的 Qwen3-30B-A3B 使用者配对,在所有任务组上的表现都优于让同一个 30B 模型为自己编写工具(LATM*),其中 TabMWP-Hard 上的提升最为显著(0.7 → 38.8),使按任务加权的总分从 70.2 提高到 76.6。更强大的工具使用者,并不意味着它更适合使用自己编写的工具。无论如何,SMITH 的 4B 编写者仍然是更好的工具来源。The reverse direction also holds. Pairing SMITH's 4B-written tools with a much stronger Qwen3-30B-A3B consumer beats that same 30B model writing tools for itself (LATM*) on every task group, most sharply on TabMWP-Hard (0.7 → 38.8), lifting the task-weighted overall score from 70.2 to 76.6. A bigger tool user doesn't make its own self-written tool preferable. SMITH's 4B writer remains the better source of tools either way.
域外泛化Out-of-domain generalization
无论是 TabMWP-Hard(表格推理)还是 GQA(视觉问答),都未出现在 SMITH 的训练数据中。SMITH 在 TabMWP-Hard 上大幅领先,并且是唯一一个在任一列中夺得榜首的 4B 非蒸馏方法。与 GPT-4.1 蒸馏版 LATM 相比,SMITH 在 GQA 上的差距,是未从更强大的预言机蒸馏视觉原语所付出的代价,这一点是公认的。Neither TabMWP-Hard (tabular reasoning) nor GQA (visual question answering) appears anywhere in SMITH's training data. SMITH leads TabMWP-Hard outright and is the only 4B, non-distilled method to top either column. The GQA gap to GPT-4.1-distilled LATM is the acknowledged cost of not distilling visual primitives from a stronger oracle.
| Task | CoT | LATM | LATM* (30B) | CRAFT | TroVE | KTCE | ReTool | LATM (distill) | SMITH |
|---|---|---|---|---|---|---|---|---|---|
| TabMWP-Hard | 7.2 | 19.7 | 0.7 | 30.0 | 36.4 | 27.2 | 3.0 | 7.1 | 40.4 |
| GQA | 11.5 | 35.0 | 29.8 | 21.9 | 21.4 | 0.0 | 26.1 | 56.0 | 42.6 |
跨骨干网络扩展Scaling across backbones
同一套 RL 配方不作任何修改,应用于所有测试过的主干模型后都能带来提升,包括起点基线弱得多的 Granite-3.3-8B。一个 Self-Judge 变体(由 Qwen3-8B 评判自身的 rollout,而非使用外部的 30B-A3B 评判器)进一步将留出集 RG 提升至 85.9,但代价是 OOD GQA 表现下降;这表明,较小的自评判器能力较弱,但在分布内数据上的偏差也更小。The same RL recipe, applied unmodified, improves every backbone tested, including Granite-3.3-8B, which starts from a much weaker base. A Self-Judge variant (Qwen3-8B judging its own rollouts instead of an external 30B-A3B judge) pushes held-out RG even higher (85.9) but trades off OOD GQA, suggesting a smaller self-judge is weaker but less biased on in-distribution data.
| Method | RG (Seen) | RG (Unseen) | TabMWP | GQA |
|---|---|---|---|---|
| Qwen3-8B (baseline) | 72.6 | 72.2 | 42.4 | 17.3 |
| SMITH: Qwen3-8B | 79.4 | 81.7 | 56.7 | 28.7 |
| SMITH: Self-Judge | 74.7 | 85.9 | 54.5 | 16.3 |
| Granite-3.3-8B (baseline) | 31.2 | 22.0 | 3.9 | 7.8 |
| SMITH: Granite-3.3-8B | 39.1 | 28.5 | 4.5 | 11.7 |
泛化到外部工具调用Generalization to external tool-calling
SMITH 从未使用 BFCL v4 的 schema、多轮轨迹或评判器进行训练,因此这里的提升体现的是学到的工具使用先验,而非针对基准测试的拟合。它提升了两种 Qwen 主干模型在 BFCL 上的总体准确率,其中 Qwen3-8B 的提升最为显著。SMITH is never trained on BFCL v4's schemas, multi-turn traces, or judges, so a gain here isolates a learned tool-use prior rather than benchmark-specific fitting. It lifts BFCL overall accuracy on both Qwen backbones, most sharply on Qwen3-8B.
| Qwen3-4B-Instruct | Qwen3-8B | Granite-3.3-8B | ||||
|---|---|---|---|---|---|---|
| Metric | Base | SMITH | Base | SMITH | Base | SMITH |
| BFCL v4 | 45.1 | 48.6 | 43.3 | 55.8 | 36.3 | 38.7 |
消融实验:究竟是什么带来了性能提升?Ablation: what's actually driving the gain?
我们旨在区分,真正起作用的因素是否是联合训练,而不仅仅是同时拥有专门负责构建的模型和专门负责使用工具的模型。将分别训练的 30B-A3B 构建模型与分别训练的 4B 工具使用专用模型配对(解耦式创建/使用),其表现并不优于仅针对工具创建进行训练的单一模型(RG Unseen 得分为 58.9,而非 68.8)。只有采用完整目标函数,在同一策略中将执行奖励和评判奖励作为彼此独立的维度,并形成闭环,才能达到最佳综合得分。We isolate whether joint training, rather than simply having a specialist builder and a specialist user, is the active ingredient. Pairing a separately-trained 30B-A3B builder with a separately-trained 4B tool-use specialist (Decoupled Create/Use) does not beat a single model trained on tool creation alone (58.9 vs. 68.8 RG Unseen). Only the full objective, which keeps execution reward and judge reward as disentangled axes and closes the loop in one policy, reaches the best aggregate score.
| Method | πeval | Tool use? | RG (Seen) | RG (Unseen) | TabMWP | GQA |
|---|---|---|---|---|---|---|
| Qwen3-4B-Instruct (base) | n/a | n/a | 61.9 | 47.0 | 19.7 | 20.9 |
| Tool Create | 30B-A3B | No | 77.4 | 59.4 | 15.6 | 37.0 |
| Tool Create | 4B | No | 73.9 | 68.8 | 17.7 | 35.8 |
| Decoupled Create/Use | 30B-A3B | Yes | 76.4 | 58.9 | 13.9 | 35.0 |
| SMITH: No Sync | 4B | Yes | 80.3 | 66.9 | 25.8 | 24.6 |
| SMITH: No LLM Judge | self | Yes | 82.6 | 67.8 | 18.3 | 42.6 |
| SMITH: K = 1 | self | Yes | 78.6 | 73.9 | 46.8 | 32.3 |
| SMITH: Full | self | Yes | 86.6 | 78.3 | 40.4 | 42.6 |
仅创建工具就能显著提升分布内表现,但在分布外 GQA 上表现不佳;若将构建与使用耦合起来且不区分奖励,虽能提高分布内准确率,却会损害对留出数据的迁移能力。只有将过程质量(格式、评审)与结果正确性(执行、使用)作为独立的奖励维度,才能兼顾两者。Tool creation alone yields a strong in-distribution bump but underperforms on OOD GQA; coupling build and use without disentangled rewards lifts in-distribution accuracy but hurts held-out transfer. Only keeping process quality (format, judge) and outcome correctness (execution, use) as separate reward axes gets both.
结论Conclusion
SMITH 联合训练一个语言模型,使其能够创建和使用可复用工具,从而打通工具编写者与使用者之间的反馈闭环,让策略直接根据自身的执行结果进行优化。在 13 项 Reasoning-Gym 任务上训练后,4B 模型在所有评估方法中取得了最高的留出集准确率,在 TabMWP-Hard 上表现领先;它编写的工具还能迁移到训练期间从未见过的 350M 学生模型上,效果媲美由大一个数量级的模型编写的工具。同一套方法无需修改即可提升 Qwen3-8B 和 Granite-3.3-8B 的表现:在一个经过训练的策略中耦合工具的创建与使用,是一条可扩展的泛化路径,无需更大的冻结教师模型、更复杂的脚手架或域外监督。SMITH jointly trains a single language model to create and use reusable tools, closing the feedback loop between tool writer and tool user so the policy is optimized directly on its own execution outcomes. Trained on 13 Reasoning-Gym tasks, the 4B model attains the highest held-out accuracy among all evaluated methods, leads TabMWP-Hard, and writes tools that transfer to a 350M student never seen during training, matching tools from a writer an order of magnitude larger. The same recipe lifts Qwen3-8B and Granite-3.3-8B without modification: coupling creation and use inside one trained policy is a scalable path to generalization, without a larger frozen teacher, a more elaborate scaffold, or out-of-domain supervision.
BibTeXBibTeX
@inproceedings{tam2026smith,
title = {Joint Optimization of Tool Creation and Use for Large Language Model Agents},
author = {Tam, Zhi Rui and Lin, Chieh-Yen and Chen, Yun-Nung and Sun, Shao-Hua and Lee, Hung-yi},
booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
year = {2026},
eprint = {2608.24571},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2608.24571}
}