用微调让小模型学会用工具,省去提示词里的工具说明。
Internalizing Tool Knowledge in Small Language Models via QLoRA Fine-Tuning

- 用8位QLoRA微调小模型,把工具知识存进参数里。
- 不给工具描述也能用,输入长度减少82.6%,评分更高。
- 小模型推理更快更省内存,适合资源受限场景。
大型语言模型越来越多地被用作智能体系统中的规划组件,但当前的工具使用流程通常需要在每个提示中包含完整的工具模式,造成大量标记开销,限制了小型模型的实际应用。本文研究通过参数高效微调,将工具使用知识内化到小型语言模型中,实现在推理时无需显式工具描述的结构化规划。以AssetOpsBench为基准,我们在约1,700个工具使用样本(涵盖工具知识、问题到计划映射和执行轨迹)上,对Gemma 4 E4B和Qwen3-4B使用8位QLoRA进行微调。在无描述推理条件下评估模型,即提示中完全省略工具目录。微调后的模型优于接收完整工具描述的有知基线,输入长度减少82.6%,同时提升结构化与LLM评分。最佳的Gemma实验达到AT-F1 0.65和总体评分3.88,优于基线的0.47和2.88。Qwen3-4B在使用62%更少内存且运行速度快2.5倍的同时,获得3.78的高分,但在通用多选题任务上表现出更强的灾难性遗忘。消融实验表明,LoRA秩控制质量与保留之间的权衡,r=32时规划质量最高,较小秩更能保持通用知识。结果表明,对于固定工具目录,QLoRA微调可将工具知识从提示上下文转移到模型权重,显著降低推理开销,同时保持或提升工具规划质量。
原文摘要 · Abstract (English)
Large language models are increasingly used as planning components in agentic systems, but current tool-use pipelines often require full tool schemas to be included in every prompt, creating substantial token overhead and limiting the practicality of smaller models. This paper investigates whether tool-use knowledge can be internalized into small language models through parameter-efficient fine-tuning, enabling structured planning without explicit tool descriptions at inference time. Using AssetOpsBench as the primary benchmark, we fine-tune Gemma 4 E4B and Qwen3-4B with 8-bit QLoRA on approximately 1,700 tool-use examples spanning tool knowledge, question-to-plan mappings, and execution-style traces. We evaluate the resulting models under description-free inference, where the prompt omits the tool catalog entirely. The fine-tuned models outperform an informed unfine-tuned baseline that receives full tool descriptions, reducing input length by 82.6\% while improving structural and LLM-judge planning scores. In the best Gemma run, the model achieves an AT-F1 of 0.65 and an overall judge score of 3.88, compared with 0.47 and 2.88 for the informed baseline. Qwen3-4B achieves a strong overall judge score of 3.78 while using 62\% less memory and running 2.5$\times$ faster than Gemma, though it also exhibits greater catastrophic forgetting on general multiple-choice benchmarks. Additional ablations show that LoRA rank controls a quality--retention trade-off, with $r=32$ maximizing planning quality and smaller ranks preserving more general knowledge. These results suggest that, for fixed tool catalogs, QLoRA fine-tuning can shift tool knowledge from prompt context into model weights, substantially reducing inference overhead while maintaining or improving tool-planning quality.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。