Tool calling data preparation
Before the training can start, you need to upload all the necessary ingredients to start the training job. For this example, we will focus on closed book tool calling on a pizza-making dataset, where given the recipe and the current state, the model needs to respond with the appropriate next action to complete the pizza. To train a model for this purpose, we will need the following:
Job description
Describes the work you expect the model to perform; you can think of it as an LLM prompt that would help the model solve your task. In practice for a tool calling problem, we expect two components: task_description
that describes the main task and tools
, a list of JSON Schemas describing the available tools and their parameters (the tool schemas should follow the OpenAI format).
The expected format is a JSON blob, and for Pizza Making, we should have the following:
Test/train data
We need a training dataset to fine-tune the model for your specific task and a test dataset to evaluate its performance after fine-tuning. The more diverse and bigger the datasets, the better, but for the training stage we need only a few dozen examples (weāll generate much more based on the examples you provide).
The expected format is CSV or JSON-lines with the following columns
question
should contain the pizza recipe and the current state of preparationanswer
is the tool call to be invoked according to the provided schema
The data for the closed-book pizza making task should look like this:
JSONL format
answer
field should contain a string representing a JSON object, not an actual JSON object (note the escaped double quotes).CSV format
Unstructured dataset
The unstructured dataset is used to guide the teacher model in generating diverse, domain-specific data. It can be documentation, unlabelled examples, or even industry literature that contains such information.
For the closed book tool calling problem we will use assorted pizza recipes. We can generate new questions based on the information in those passages and then answer them.
The expected format is CSV or JSON lines with a single column (context
). For the pizza making task it should look like this:
JSONL format
CSV format