Latest giant language fashions (LLMs) are extremely succesful in most language technology duties. Nevertheless, since they function based mostly on next-token prediction, they typically battle with precisely performing mathematical operations. Moreover, attributable to their information cut-off, they could lack the data wanted to reply some queries precisely.
One strategy to alleviate these points is thru perform calling. Perform calling permits LLMs to reliably hook up with exterior instruments. It allows interplay with exterior APIs. For instance, retrieving data from the Web and performing mathematical operations will be completed by perform calling by interfacing the LLM with an internet search engine and a calculator.
On this article, we are going to see the best way to fine-tune LLMs for perform calling. I exploit xLAM, a dataset of 60k entries of perform calling launched by Salesforce for fine-tuning Llama 3. We’ll see the best way to format the dataset and the way we will exploit the fine-tuned adapters for perform calling.
I additionally made this pocket book implementing the code described on this article for fine-tuning, and a few examples of inference: