AI-Assisted SQL Authoring at Industry Scale

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Maddila, Chandra, Ghorbani, Negar, Jabre, Kosay, Murali, Vijayaraghavan, Kim, Edwin, Thakkar, Parth, Laptev, Nikolay Pavlovich, Harman, Olivia, Hsu, Diana, Abreu, Rui, Rigby, Peter C.
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913439078678528
author Maddila, Chandra
Ghorbani, Negar
Jabre, Kosay
Murali, Vijayaraghavan
Kim, Edwin
Thakkar, Parth
Laptev, Nikolay Pavlovich
Harman, Olivia
Hsu, Diana
Abreu, Rui
Rigby, Peter C.
author_facet Maddila, Chandra
Ghorbani, Negar
Jabre, Kosay
Murali, Vijayaraghavan
Kim, Edwin
Thakkar, Parth
Laptev, Nikolay Pavlovich
Harman, Olivia
Hsu, Diana
Abreu, Rui
Rigby, Peter C.
contents SqlCompose brings generative AI into the data analytics domain. SQL is declarative, has formal table schemas, and is often written in a non-linear manner. We address each of these challenges and develop a set of models that shows the importance of each problem. We first develop an internal SQL benchmark to perform offline tests at Meta. We evaluate how well the Public Llama model performs. We attain a BLEU score of 53% and 24% for single- and multi-line predictions, respectively. This performance is consistent with prior works on imperative languages. We then fine-tune Llama on our internal data and database schemas. SqlComposeSA substantially outperforms Llama by 16 percentage points on BLEU score. SQL is often written with multiple sub queries and in a non-sequential manner. We develop SqlComposeFIM which is aware of the context before and after the line(s) that need to be completed. This fill-in-the-middle model outperform SqlComposeFIM by 35 percentage points. We also measure how often the models get the correct table names, and SqlComposeFIM is able to do this 75% of the time. Aside from our scientific research, we also roll out SqlComposeFIM at Meta. SqlCompose is used on a weekly basis by over 10k users including data scientists and software engineers, less than 1% of users have disabled SqlCompose. We use the feedback from users to improve SqlCompose. Interesting positive themes include completing tedious or repetitive SQL clauses, suggesting boilerplate coding, and help in eliminate the need to remember difficult SQL syntax. The most significant negative themes was table and column name hallucinations, which has been reduced with the release of SqlComposeFIM. The SqlCompose models consistently outperform public and internal LLMs, despite being smaller (7 bn and 13 bn), which provides early indications that smaller specialist models can outperform larger general purpose models.
format Preprint
id arxiv_https___arxiv_org_abs_2407_13280
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle AI-Assisted SQL Authoring at Industry Scale
Maddila, Chandra
Ghorbani, Negar
Jabre, Kosay
Murali, Vijayaraghavan
Kim, Edwin
Thakkar, Parth
Laptev, Nikolay Pavlovich
Harman, Olivia
Hsu, Diana
Abreu, Rui
Rigby, Peter C.
Software Engineering
Databases
SqlCompose brings generative AI into the data analytics domain. SQL is declarative, has formal table schemas, and is often written in a non-linear manner. We address each of these challenges and develop a set of models that shows the importance of each problem. We first develop an internal SQL benchmark to perform offline tests at Meta. We evaluate how well the Public Llama model performs. We attain a BLEU score of 53% and 24% for single- and multi-line predictions, respectively. This performance is consistent with prior works on imperative languages. We then fine-tune Llama on our internal data and database schemas. SqlComposeSA substantially outperforms Llama by 16 percentage points on BLEU score. SQL is often written with multiple sub queries and in a non-sequential manner. We develop SqlComposeFIM which is aware of the context before and after the line(s) that need to be completed. This fill-in-the-middle model outperform SqlComposeFIM by 35 percentage points. We also measure how often the models get the correct table names, and SqlComposeFIM is able to do this 75% of the time. Aside from our scientific research, we also roll out SqlComposeFIM at Meta. SqlCompose is used on a weekly basis by over 10k users including data scientists and software engineers, less than 1% of users have disabled SqlCompose. We use the feedback from users to improve SqlCompose. Interesting positive themes include completing tedious or repetitive SQL clauses, suggesting boilerplate coding, and help in eliminate the need to remember difficult SQL syntax. The most significant negative themes was table and column name hallucinations, which has been reduced with the release of SqlComposeFIM. The SqlCompose models consistently outperform public and internal LLMs, despite being smaller (7 bn and 13 bn), which provides early indications that smaller specialist models can outperform larger general purpose models.
title AI-Assisted SQL Authoring at Industry Scale
topic Software Engineering
Databases
url https://arxiv.org/abs/2407.13280