ElemedexA pocket encyclopedia of AI architectures

Glossary (TM) › Use: prompts, sampling, systems

TM164

Tool use (function calling)

Also: function calling, API calls

In Spanish: Uso de herramientas (llamadas a funciones)

A language model's ability to request, by writing specially formatted text, that an external program do something (calculate, search, run code), and to use the result.

Language models are, paradoxically, bad at things a calculator does effortlessly: exact arithmetic or factual lookup (Alammar & Grootendorst, 2024, p. 218; Schick et al., 2023). The obvious fix is to give them tools. The mechanism is simple: the model only produces text, so it is trained or instructed in the system prompt that, when it needs a tool, it should write a call in a fixed format (for instance, a function name and its arguments). The program wrapped around it detects the call, executes it and pastes the result into the context; the model keeps writing from there.

Calculator(400 / 1400) → 0.29

Toolformer showed that a model can learn on its own when to call which tool (a calculator, a question-answering system, a search engine, a translator, a calendar), which arguments to pass and how to use the response, in a self-supervised way and with just a handful of demonstrations per tool (Schick et al., 2023). Chaining many calls with intermediate reasoning is what defines an agent.

Millière & Buckner (2024b) note that this builds hybrid neurosymbolic systems, in which language or code serves as a universal interface between connectionist and symbolic components; with a code interpreter or Wolfram Alpha, for example, performance on hard math improves considerably (2024b, sec. 3.1). Mahowald et al. (2024) read it in the light of neuroscience: language and formal reasoning are distinct capacities, and it makes sense for them to rely on separate mechanisms. It is a point in the debate that Santelli (2026) takes up: for some critics, an LLM's need for tools proves that growing networks is not enough; for others, it is no more surprising than a person doing better with an abacus, since the "processor" is still the grown network. The underlying question is where to draw the boundary of the cognitive system: is the calculator part of the agent's mind or an external instrument?

Sources

  • Alammar, J., & Grootendorst, M. (2024). Hands-on large language models: Language understanding and generation. O’Reilly Media. §
  • Mahowald, K., Ivanova, A. A., Blank, I. A., Kanwisher, N., Tenenbaum, J. B., & Fedorenko, E. (2024). Dissociating language and thought in large language models. Trends in Cognitive Sciences, 28(6), 517–540. https://doi.org/10.1016/j.tics.2024.01.011 §
  • Millière, R., & Buckner, C. (2024b). A philosophical introduction to language models—Part II: The way forward (arXiv:2405.03207). arXiv. https://doi.org/10.48550/arXiv.2405.03207 §
  • Santelli, M. (2026, August 25). El futuro de la IA: Entre doomers y hyperos. 421.news. https://www.421.news/es/ia-doomers-hyperos/ §
  • Schick, T., Dwivedi-Yu, J., Dessì, R., Raileanu, R., Lomeli, M., Hambro, E., Zettlemoyer, L., Cancedda, N., & Scialom, T. (2023). Toolformer: Language models can teach themselves to use tools. In Advances in Neural Information Processing Systems (Vol. 36, pp. 68539–68551). Curran Associates. https://doi.org/10.52202/075280-2997 §