Learn Before
Mechanism of Tool Invocation and Result Substitution
The process of tool use by an LLM involves generating a specially formatted string, such as {tool: calculator, expression: 10 * 4 * 2}, which acts as a trigger for an external tool like a mathematical interpreter. Once the tool computes the result (e.g., '80'), this output replaces the original tool-invocation string. This substitution updates the model's working context, enabling the result to be directly referenced and utilized in the subsequent token predictions that form the next steps of the reasoning process.
0
1
Tags
Ch.3 Prompting - Foundations of Large Language Models
Foundations of Large Language Models
Foundations of Large Language Models Course
Computing Sciences
Related
Triggering an External Calculator with Calculation Annotation
Mechanism of Tool Invocation and Result Substitution
A user wants a language model to solve a word problem by showing its work and then providing a final answer. The model should format its calculations using
≪...≫so an external tool can execute them accurately, and use####to mark the final answer. Review the model's response below and identify the primary error in its formatting.Problem: A farmer has 3 fields, and each field produces 150 bushels of corn. If the farmer sells 200 bushels, how many are left?
Model's Response: First, I need to find the total production. ≪There are 3 fields, so 3 * 150 = 450 bushels total≫. Then, the farmer sells 200 bushels. The remaining amount is ≪450 - 200≫. So the final answer is 250.
Applying Calculation Annotation Formatting
A developer is designing a system where a Large Language Model solves math word problems. The system must ensure arithmetic accuracy by offloading calculations to an external tool and must also present the final answer in a clearly identifiable way. Which of the following model outputs best applies a formatting strategy to achieve both of these goals?
Learn After
An AI assistant is tasked with solving a multi-step problem: 'Calculate the area of a rectangle with a width of 10 and a length of 4, and then multiply the result by 2.' The assistant's internal process is as follows:
- It first generates the string:
{tool: calculator, expression: '10 * 4'}. - An external system intercepts this string, computes the expression, and obtains the result '40'.
- The system then updates the assistant's working context before the assistant generates its next thought.
Based on the standard mechanism for this process, what is the most likely subsequent action the assistant will take to complete the problem?
- It first generates the string:
Analysis of LLM Context Modification
A large language model needs to answer the question, 'What is 5 times 12?'. To do this, it uses an external calculation tool. Arrange the following steps in the correct chronological order to show how the model generates the final answer.