Function-calling models learn to interleave ordinary text generation with structured calls to external tools when it improves their answer.
call(tool) triggered when a_i(t) > threshold
a_i(t+1) = a_i(t)(1-decay) + input(t)
- Tool nodes — candidate functions/APIs the model can decide to invoke (search, calculator, code exec...).
- API connectivity — how densely the reasoning graph links a query to relevant tool nodes.
- Call trigger rate — how often external input pushes a node's activation upward.
- Confidence threshold — the activation level a node must cross before the model actually emits a tool call.
This is the mechanism behind Toolformer-style training: the model learns, from self-supervised examples, when inserting an API call improves its own next-token prediction.