If you had asked me a year or two ago, I would have been seriously concerned about the future of classical ML work in the machine learning field, because we were getting so deep in a paradigm of using LLMs to handle things, whether they did a good job or not. However, it turns out that agentic AI needs classical ML much more than we probably thought.如果是一两年前你问我,我会非常担心传统机器学习在机器学习领域的前景,因为我们当时太沉迷于使用大语言模型(LLM)来处理一切事务,无论效果如何。然而事实证明,智能体 AI 对传统机器学习的需求远比我们想象的要大。
For a quick recap in case readers are unfamiliar:如果读者不太了解,这里先简单回顾一下:
- An AI Agent means combining LLMs and other software tooling together to create workflows with minimal or no human intervention, orchestrating any number of models or tools.AI 智能体是指将大语言模型与其他软件工具结合起来,通过编排各种模型或工具,在极少甚至无需人工干预的情况下实现工作流自动化。
- The LLM is usually the interface between human users and all the other software tools, including tasks like translating human prompts to computer language. The LLM also interprets tool outputs and chooses which tools to call at appropriate moments.大语言模型通常作为人类用户与所有其他软件工具之间的接口,负责将人类提示词转换为计算机语言等任务。此外,大语言模型还会解读工具的输出,并决定在何时调用合适的工具。
- This enables much more functionality than an LLM by itself, because as I’ve talked about here many times, an LLM is just a token generating model, predicting the next word or phrase in a passage based on its context.这使得它比单纯的大语言模型具备更强大的功能。正如我多次提到过的,大语言模型本质上只是一个标记生成模型,它根据上下文预测一段内容中的下一个词或短语。
- Aside from autonomous agents, combining an LLM interface with other tools is required to do a huge number of the things we think colloquially of LLM chatbots doing. ChatGPT, Gemini, and Claude do this kind of thing, chaining together the LLM interface with things like data retrieval, web search, mathematics calculators, etc.除了自主智能体之外,将大语言模型接口与其他工具结合,也是实现我们日常所理解的“大语言模型聊天机器人”功能的必要条件。ChatGPT、Gemini 和 Claude 都是这样做的,它们将大语言模型接口与数据检索、网络搜索、数学计算器等功能串联起来。
As you can see, a key aspect of the whole agentic AI ecosystem is tooling — your agent needs to have access to tools in order to effectively complete tasks outside of the core LLM functions. 如你所见,整个智能体 AI 生态系统的关键在于“工具”——你的智能体必须能够访问各种工具,才能有效完成核心大语言模型功能之外的任务。
These tools can take all kinds of forms- a lot of them today in the business setting are data retrieval and organizing tools, graph databases, RAG knowledge bases, query construction and validation, and so on.这些工具形式多样,在商业环境中,常见的有数据检索与整理工具、图数据库、RAG(检索增强生成)知识库、查询构建与验证工具等等。
Why Classical ML为何选择传统机器学习
However, I want to remind you that classical ML models can also be really valuable tools for your agent. Take it a step further than just calling rudimentary tooling, and give your AI agent models to use! For example, consider an agent designed for real estate analysis. If you want to find out the appropriate market price for a property, give your agent the address. It can use one API retrieval tool to retrieve details about the property, then pass those formatted details to a regression model that generates a price estimate.我想提醒你,传统机器学习模型同样可以成为智能体非常有价值的工具。不妨更进一步,不要只调用基础工具,给你的 AI 智能体配备模型来使用!例如,设想一个专门用于房地产分析的智能体。如果你想了解房产的合理市场价格,只需给智能体提供地址。它可以使用 API 检索工具获取房产详情,然后将这些格式化后的数据传给回归模型,从而生成价格估算。
Of course, you could theoretically ask the LLM to just estimate the values itself. However, this is questionable and even risky for a number of reasons.当然,理论上你也可以直接让大语言模型进行估值。然而,由于多种原因,这种做法既不可靠,甚至存在风险。
- Accuracy: An LLM is particularly bad for any task where you need to calculate a meaningful number — it’s guessing, not making an empirical evidence based calculation. A well trained classical ML model is going to be vastly more accurate and trustworthy.准确性:大语言模型在任何需要计算精确数值的任务上都表现得很差——它是在猜测,而不是进行基于实证的计算。训练有素的传统机器学习模型会准确且可靠得多。
- Interpretability: You have minimal interpretability and explainability from the LLM guessing. We know that LLMs tend to be a black box, and this severely restricts your ability to assess the path that it took to get to the estimate you received. With a classical ML model you can identify the decisions made to get to your inference, and validate these against your subject matter expertise.可解释性:对于大语言模型的猜测,你几乎无法进行解释和追溯。我们知道大语言模型往往是“黑盒”,这严重限制了你评估其得出估算结果路径的能力。而使用传统机器学习模型,你可以识别得出推断结果所依据的决策,并结合你的专业知识进行验证。
- Cost: Running an LLM gets expensive very fast (see my articles from the last several months about token costs). If you have a lot of cases to run on, the token prices will become meaningful quickly. Running a classifier or a regression model is incredibly lightweight and cheap, even at high volumes. Additionally, in an LLM you don’t control the cost of each call, and token usage and spend can increase — we’re seeing that across the tech industry already.成本:运行大语言模型的成本上升非常快(请参阅我过去几个月关于 Token 成本的文章)。如果你有大量的案例需要处理,Token 费用很快就会变得非常可观。相比之下,运行分类器或回归模型非常轻量且经济,即使在高并发情况下也是如此。此外,大语言模型的调用成本不可控,Token 使用量和支出可能会失控——我们在整个科技行业中已经看到了这一点。
- Precision: You don’t control the training or tuning of the LLM (unless you’re fine tuning a foundation model). You might trust the generic LLM to do the job, but you’re taking a big risk, and as mentioned above, validating the work is exceedingly difficult. On the other side, fine tuning a foundation model could be effective, but it requires much more data and more specialized skill than just training a regression or a classifier, while still leaving you with interpretability problems.精度:你无法控制大语言模型的训练或调优(除非你微调基础模型)。你或许会信任通用大语言模型能完成工作,但这冒着巨大的风险,而且如上所述,验证其工作成果极其困难。另一方面,微调基础模型虽然有效,但它需要更多的数据和更专业的技能,且仍然无法解决可解释性问题。
- Control of your data: Your data may be leaving your controlled environment and being accessed by a third party LLM model provider, which can create risk.数据控制:你的数据可能会离开受控环境,被第三方大语言模型提供商访问,这会带来风险。
- Control of infrastructure: With an LLM, you don’t have any authority over infrastructure management, so third party downtime creates risk to your business.基础设施控制:使用大语言模型时,你对基础设施管理没有任何权限,因此第三方的停机故障会给你的业务带来风险。
Of course, constructing a classical model does require different skills than just setting an LLM on a task. You need to understand your data well, be prepared to complete feature engineering with subject matter expertise, and you need to have sufficient compute and data to train the model. If you have no labeled data, you’ll be limited to unsupervised learning or perhaps bootstrapping your own labels. Fortunately, there’s a wealth of content out there about how to build these models, as well as how to evaluate them rigorously and monitor after deployment.当然,构建传统模型确实需要与单纯给大语言模型下任务不同的技能。你需要深入了解数据,准备好利用专业知识进行特征工程,并且需要足够的计算资源和数据来训练模型。如果你没有标注数据,就只能局限于无监督学习,或者尝试自举(bootstrapping)生成标签。幸运的是,市面上有很多关于如何构建这些模型,以及如何进行严格评估和部署后监控的丰富资源。
Hooking up your model to your agent将模型接入你的智能体
You might be convinced to give this a try, but before you start, there are a few architectural choices to consider as well. How will your model and your agent interact?你可能已经准备好尝试一下了,但在开始之前,还有一些架构选择需要考虑。你的模型和智能体将如何交互?
Direct Calls直接调用
Perhaps the quickest way to get running is just by letting the agent have the model as a tool to call directly. This is the form of my real estate research tool example: the agent can hit a model for just in time inference based on a prompt. To set this up, your AI agent must be equipped to format its requests to the classical model correctly. Your agent must understand what this model is for, when to call it and when to use something else. This means clearly documenting the model’s purpose and capabilities, but if you’re already building agentic AI this is a familiar task.最快上手的方式或许就是让智能体将模型作为工具直接调用。这正是前述房地产研究工具案例的形式:智能体可以根据提示词调用模型进行即时推断。为此,你的 AI 智能体必须具备正确格式化请求的能力。它必须理解该模型的用途、何时调用以及何时使用其他工具。这意味着你需要清晰地记录模型的功能和用途,如果你已经在构建智能体 AI,这应该是你熟悉的任务。
On the output, your model response needs to be structured in such a way that the AI agent can process it effectively. Simply returning a numeric result may not do the job, because the agent will need contextual information to interpret it and make the best use of it. For my models, I often use f-strings to construct text descriptions as part of the inference, indicating, for example, what the most important features from the model were, what the probability of the result is, and so on. Just returning a probability limits the ability of your agent to interpret the output and produce a helpful response for the end user.在输出端,模型响应的结构需要便于 AI 智能体有效处理。仅返回一个数值结果可能不够,因为智能体需要上下文信息来解读并充分利用它。对于我的模型,我通常使用 f-string 来构建文本描述作为推断结果的一部分,例如指出模型中最重要的特征是什么、结果的概率是多少等等。仅仅返回一个概率值,会限制智能体解读输出并为最终用户提供有用响应的能力。
Database Access数据库访问
Another option is to make the model not a direct tool of the agent, but a provider of context data. You can pre-calculate the inferences by running your classical ML model as a scheduled job, and store these inferences in whatever data storage solution your agent has access to. Instead of the agent making an initial inference call directly to a model API, it’s writing a query and passing it to your database.另一种选择是,不让模型成为智能体的直接调用工具,而是作为上下文数据的提供者。你可以通过定时任务运行传统机器学习模型来预先计算推断结果,并将这些结果存储在智能体可访问的任何数据存储解决方案中。这样,智能体就不需要直接向模型 API 发起初始推断调用,而是编写查询语句并将其发送给数据库。
If you have a finite set of cases that you could potentially need the inference completed for, this can be a good solution. For example, if you have 500 individuals in your database, and your agent is meant to retrieve financial health information about them, you could use a credit scoring model and pre-calculate their creditworthiness for the agent to retrieve at runtime along with any other data it collects. Depending on your model infrastructure, this may reduce latency and repetition, by effectively caching results.如果你需要完成推断的案例集是有限的,这可能是一个很好的解决方案。例如,如果你的数据库中有 500 个人,而你的智能体旨在检索他们的财务健康信息,你可以使用信用评分模型预先计算他们的信用度,供智能体在运行时与其他数据一起检索。根据你的模型基础设施,这可以通过有效缓存结果来降低延迟并减少重复计算。
This approach creates different requirements for the call and retrieval than direct tool calling. If you’re pre-calculating the inferences and just making those available to your agent via database, your agent will need to know that these results exist. If it’s unaware of the table or the content being available, it won’t use them when appropriate. You might already have the infrastructure for telling the agent what the database contains in your prompt engineering, if your agent is calling to the database for other information, so reusing that can save you from duplicating efforts. If not, your agent may need specific tools that it can use to review the database metadata.这种方法对调用和检索的要求与直接工具调用不同。如果你是预先计算推断结果并通过数据库提供给智能体,智能体需要知道这些结果的存在。如果它不知道表结构或可用内容,就不会在适当的时候使用它们。如果你已经在提示词工程中告诉智能体数据库包含什么内容(以便它查询其他信息),那么复用这些信息可以避免重复劳动。否则,你的智能体可能需要特定的工具来查看数据库元数据。
On the results format side, requirements are similar to the direct tool access case. Having a text based description of the results is a good choice, because the agent needs to be able to interpret what it retrieves, regardless of the source.在结果格式方面,要求与直接工具调用案例类似。提供基于文本的结果描述是一个不错的选择,因为无论来源如何,智能体都需要能够解读它所检索到的内容。
Conclusion结论
Classical ML models were the cutting edge capabilities across many different industries for over a decade before LLMs came on the scene, giving people insights into data that they could not have otherwise achieved. This power shouldn’t be discarded, but instead can be combined with the capacities of LLMs. We can take advantage of the LLM’s strengths, converting human language into computer language, stringing together different tool calls, and retrieving results from those tools, and still use classical models within this framework to do the work for which an LLM is not appropriate.在大语言模型出现之前的十多年里,传统机器学习模型一直是各行各业的前沿技术,为人们提供了无法通过其他方式获得的数据洞察。这种力量不应被丢弃,而应与大语言模型的能力相结合。我们可以利用大语言模型的优势,将人类语言转换为计算机语言、串联不同的工具调用并检索结果,同时在这一框架内使用传统模型来处理那些不适合大语言模型的任务。
The barrier to entry is the skill set of creating high quality classical ML models, which is unfortunately not as glamorous as some of the AI-related work these days. It’s worth the effort, though, because of the advantages: accuracy, precision, interpretability, cost, and control. I recommend that practitioners brush up on their skills with tools like XGBoost, LightGBM, and scikit-learn, to see these results for yourselves.进入该领域的门槛在于创建高质量传统机器学习模型的技能,遗憾的是,这在当今 AI 领域并不像其他工作那样引人注目。但它非常值得投入,因为其优势明显:准确性、精度、可解释性、成本和可控性。我建议从业者重温 XGBoost、LightGBM 和 scikit-learn 等工具的技能,亲自验证这些成果。
Read more of my work at www.stephaniekirmer.com.阅读我的更多作品:www.stephaniekirmer.com。
Further Reading延伸阅读
https://arxiv.org/pdf/2602.14295https://arxiv.org/pdf/2602.14295
https://github.com/Tejas-TA/predikithttps://github.com/Tejas-TA/predikit
https://arxiv.org/pdf/2506.20430https://arxiv.org/pdf/2506.20430
Python Package Introduction – xgboost 3.3.0 documentation
This document gives a basic walkthrough of the xgboost package for Python. The Python package is consisted of 3…xgboost.readthedocs.ioPython 包介绍 – xgboost 3.3.0 文档。本文档提供了 xgboost Python 包的基本演练。Python 包由 3 个部分组成…xgboost.readthedocs.io
Python-package Introduction – LightGBM 4.6.0.99 documentation
This document gives a basic walk-through of LightGBM Python-package. List of other helpful links The preferred way to…lightgbm.readthedocs.ioPython 包介绍 – LightGBM 4.6.0.99 文档。本文档提供了 LightGBM Python 包的基本演练。其他有用链接列表。首选方式是…lightgbm.readthedocs.io
Tutorials |
CatBoost is well covered with educational materials for both novice and advanced machine learners and data scientists…catboost.ai教程 | CatBoost 拥有涵盖初学者和高级机器学习者及数据科学家的丰富教学资料…catboost.ai
Getting Started
Scikit-learn is an open source machine learning library that supports supervised and unsupervised learning. It also…scikit-learn.org入门指南。Scikit-learn 是一个支持监督和无监督学习的开源机器学习库。它还…scikit-learn.org
Learn Intermediate Machine Learning Tutorials
Handle missing values, non-numeric values, data leakage, and more.www.kaggle.com学习中级机器学习教程。处理缺失值、非数值、数据泄漏等问题。www.kaggle.com
towardsdatascience.com/tool-calling-explained-how-ai-agents-decide-what-to-do-next/towardsdatascience.com/tool-calling-explained-how-ai-agents-decide-what-to-do-next/
towardsdatascience.com/ai-agents-explained-what-is-a-react-loop-and-how-does-it-work/towardsdatascience.com/ai-agents-explained-what-is-a-react-loop-and-how-does-it-work/







