[论文解读] Machine Learning as a Tool (MLAT): A Framework for Integrating Statistical ML Models as Callable Tools within LLM Agent Workflows
MLAT 将预训练的统计 ML 模型作为可在 LLM 代理工作流中调用的工具进行暴露,从而在结构化输出中实现带有情境、基于推理的预测;通过双代理 Gemini 设置下的小数据 regime 的 PitchCraft 定价进行演示。
We introduce Machine Learning as a Tool (MLAT), a design pattern in which pre-trained statistical machine learning models are exposed as callable tools within large language model (LLM) agent workflows. This allows an orchestrating agent to invoke quantitative predictions when needed and reason about their outputs in context. Unlike conventional pipelines that treat ML inference as a static preprocessing step, MLAT positions the model as a first-class tool alongside web search, database queries, and APIs, enabling the LLM to decide when and how to use it based on conversational context. To validate MLAT, we present PitchCraft, a pilot production system that converts discovery call recordings into professional proposals with ML-predicted pricing. The system uses two agents: a Research Agent that gathers prospect intelligence via parallel tool calls, and a Draft Agent that invokes an XGBoost pricing model as a tool call and generates a complete proposal through structured outputs. The pricing model, trained on 70 examples combining real and human-verified synthetic data, achieves R^2 = 0.807 on held-out data with a mean absolute error of 3688 USD. The system reduces proposal generation time from multiple hours to under 10 minutes. We describe the MLAT framework, structured output architecture, training methodology under extreme data scarcity, and sensitivity analysis demonstrating meaningful learned relationships. MLAT generalizes to domains requiring quantitative estimation combined with contextual reasoning.
研究动机与目标
- 形式化 MLAT 设计模式:在 LLM 代理注册表中将预训练的 ML 模型暴露为工具。
- 在类生产系统(PitchCraft)中实现端到端的 MLAT,以 ML 预测定价来生成提案。
- 展示结构化输出解析如何通过 JSON 模式桥接 LLM 推理与 ML 特征向量。
- 在极端数据稀缺下使用真实+合成数据集进行分组感知验证来评估 MLAT。
提出的方法
- 将 MLAT 定义为由代理控制的工具调用模式,LLM 从结构化上下文提取特征向量并调用训练好的 ML 模型以获取预测。
- 将 ML 模型注册为无状态的 REST 端点工具,并使用受模式约束的提取与输出模式来桥接 LLM 推理与 ML 输入。
- 利用 Gemini 的 JSON 模式约束实现可靠的结构化输出解析和研究代理与起草代理之间的代理间契约。
- 在小型数据集(N=70)上训练一个 XGBoost 回归模型,包含 40 条真实记录和 30 条合成记录,采用分组感知交叉验证与特征工程(8 个特征,tech_stack 的独热编码)。
- 进行敏感性分析和基于交叉验证的性能评估,以验证学习到的经济关系。

实验结果
研究问题
- RQ1在 LLM 代理工作流中暴露 trained ML 模型 作为工具,是否能改善情境决策和预测的可解释性?
- RQ2在低数据且带合成增强的情形下,MLAT 模式在预测准确性与泛化方面表现如何?
- RQ3结构化输出解析是否能实现可靠的特征提取和研究代理与起草代理之间的通信?
- RQ4MLAT 对真实世界任务(如在类生产情境下的提案生成与定价)有何影响?
主要发现
| Metric | Training Set | Test Set | Cross-Validation |
|---|---|---|---|
| R^2 | 0.937 | 0.807 | 0.816±0.060 |
| MAE | 2,328 | 3,688 | 3,898±629 |
| RMSE | 2,874 | 4,720 | — |
| Relative MAE | 14.3% | 22.6% | 23.9% |
- XGBoost 定价模型在保留测试数据上的 R^2=0.807,MAE=3,688,RMSE=4,720,样本量为 70 的 regime 下。
- 交叉验证 R^2 为 0.816(±0.060),在小数据和合成增强条件下仍表现出可靠的泛化能力。
- 完整的 PitchCraft 流程将提案创建时间从 3 小时以上缩短至不足 10 分钟,且提案到线索的速度提升 12–18 倍。
- 敏感性分析显示在更高的痛感严重程度和集成复杂度下价格呈经济上合理的上升,表明学到的是有意义的关系而非记忆。
- 相较于岭回归,XGBoost 的 CV R^2 更高(0.816±0.060 对 0.565±0.180),证实非线性特征交互的重要性。

更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。