A large-scale language model ``Gorilla'' specialized for generating code that calls APIs, capable of following API updates in real time & open source model training data has been released



Even with a high-performance model like GPT-4, there is a high probability that wrong code will be generated when API call code is generated. ' Gorilla ' has been fine-tuned to specialize in generating code that calls APIs, and not only can it generate highly accurate calling codes, but it can also update APIs when used together with an information retriever. It is a model with an amazing function that can follow in real time.

Gorilla

https://shishirpatil.github.io/gorilla/

In Gorilla's training, AI created a set of 16,450 instructions and APIs based on 1,645 API call codes collected from three sources: 'Torch Hub', 'TensorFlow Hub', and 'HuggingFace'. It is said that fine tuning was performed with the 16,450 instruction set. It is stated that during inference, the information searcher can be used to supplement the related API from the API database to prevent hallucinations and improve accuracy.



When I tried three tests to generate API call code, ``GPT-4'', ``Claude'' and ``Gorilla'', GPT-4 saw hallucinations and Claude chose the wrong library. On the other hand, Gorilla was able to write the appropriate calling code with the appropriate library.



At the time of writing the article, Gorilla has three versions, '

LLaMA version', ' MPT version', and ' Falcon version', for each base that was fine-tuned. Of these, the MPT version and the Falcon version are released under the Apache 2.0 license , and model training data can be downloaded, and commercial use is also possible.

◆ I tried using the demo
A demo that can be executed immediately was also prepared, so I will try using it immediately. Click 'Open in Colab' next to the message 'Try Gorilla in 60s'.



The test code will open in Google Colaboratory, so click 'Copy to Drive'.



Now you can edit the file. The demo version is hosted at the Sky lab at California State University, Berkeley. Because it is for research, commercial use is NG and a big caution is written. Click the play mark just below this note to run it.



You are now ready to go. You can check Gorilla's response by running the 'get_gorilla_response' function. Click 'Code' on the screen to add a code block, display the result of the get_gorilla_response function, and click the play button on the left to execute it. The prompt was written in English, saying, 'I want to change English to Japanese.'



I got a reply within 10 seconds. The model 'facebook/m2m100_1.2B' is specified, and how to use it is explained. I thought that the code would be generated directly from

the comparison image with GPT-4 and Claude , but the reply was only a commentary, so it seems that a human will write based on this commentary. is. In addition, I checked the M2M100 document and it was probably a correct description.

in Review,   Software, Posted by log1d_ts