SQL Queries with Fine Tuned Llama 2 7 Billion Model

We learned how we can easily fine-tune Llama2 7 Billion Parameters to generate SQL Queries for our enterprise DB. we first try 0-shot and few shot prompting before deciding to fine-tune. And the results were amazing.

Task at hand - SQL Query generation for natural language questions.

Model used - Llama2 7B params‍


Few Shot Prompting


Trying 0 shot prompting -Result - Not satisfactory at all
‍‍
Trying 2 shot promptingResult - Not satisfactory at all


Finetuning Llama 2 7Billion Parameter Model


Dataset used
I ran for very very few epochs - Epoch 0.01/1 to check if the accuracy of the model was improving.
And got amazing results :)
Amazing right?

You can use this colab notebook to replicate the results :)