DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
Paper · 2023 · Mohammadreza Pourreza and Davood Rafiei
Summary
Asking a database which departments spend more than average sounds simple. Turning that question into SQL requires identifying the budget field, deciding what to average, and using the result to select the departments. For questions that draw on several tables, the query also has to connect the right records. DIN-SQL investigates whether an existing language system can handle those decisions more reliably when it tackles them separately. It uses few-shot learning, in which examples in the prompt show the system how to perform a task without changing its parameters. At the time of the study, direct prompting still trailed strong systems trained specifically for text-to-SQL, especially on demanding queries.
The authors first examined CodeX Davinci’s mistakes on a random sample of 500 training questions from Spider. They left out databases represented in the prompts. The most frequent failure concerned schema linking, the process of connecting a question to relevant tables, columns, and values. Mistakes in joining tables came next. DIN-SQL responds by producing schema links before drafting SQL, then deciding whether the question needs a join or a nested query. Straightforward cases get a short generation prompt. More involved cases use NatSQL, a simplified expression of the intended query, and the nested route also works through smaller questions before assembling the answer. A final prompt reviews the draft for mistakes.
CodeX Davinci, CodeX Cushman, and GPT-4 are all included in the experiments. On Spider development questions, the authors report execution accuracy gains of at least 10% over ordinary few-shot prompting across the tested systems. Execution accuracy measures whether the generated SQL returns the reference result. On Spider’s hidden test set, GPT-4 with DIN-SQL reached 85.3% on that measure, ahead of the earlier best of 79.9%. CodeX Davinci with DIN-SQL reached 78.2%. Their respective exact set match scores, which measure agreement with the reference query’s structure, were 60% and 57%. On BIRD, GPT-4 with DIN-SQL reached 55.9% execution accuracy on the hidden test set, a new best at the time, and 50.72% on the development set.
The study shows that organizing the work at inference time can put prompting ahead of strong systems trained through fine-tuning on benchmark execution accuracy. It also shows where the approach still struggles. Schema linking remained the largest category of errors after decomposition. A direct instruction to repair the draft helped CodeX Davinci, while GPT-4 did better with a request to look for possible problems. The authors assembled fixed demonstrations for each query class and reported that processing a Spider question with GPT-4 cost roughly $0.5 and took approximately 60 seconds. They made the code, prompts, and results available through GitHub.
Deep dive: DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
DIN-SQL turns database questions into SQL by identifying relevant tables, choosing a query strategy, and reviewing the result for errors. · about 38 minutes to read
The problem and its context
A question has to fit the way the database stores its facts
The aim of a natural-language database interface is to let someone get information from a relational database by asking for it in ordinary words. The task belongs to semantic parsing, the conversion of a linguistic request into a formal expression that another system can interpret. In this case the expression is executable SQL. It must fit the meaning of the question and the particular organization of the database in which it will run.
Consider the paper’s example about employees paid more than their managers. A reader knows that each employee’s salary must be compared with the salary of that employee’s manager. The database still needs a way to identify the people and connect them through the management relationship. The SQL has to name the relevant records, express the connection, and compare the salaries on the correct sides of that connection. The wording leaves those database-specific choices implicit. A fluent rendering of the request can therefore fail as a query even if it contains a recognizable salary field and a greater-than comparison.
The schema tells the system what tables exist, what fields each table contains, and how records in different tables can refer to one another. A foreign key is a field, or part of a relationship between fields, that connects records across that structure. In a database about courses, for example, a table describing courses can hold titles, while a table describing teaching assignments can identify the instructors responsible for them. A request for titles and instructor names has to follow the relationship between those records before it can return the requested pair. A join is the SQL operation that brings matching records together. Both the choice of tables and the conditions for matching their records matter.
Some questions introduce a dependency without requiring any additional table. Selecting departments with budgets above the average requires the budget for each candidate department and an average over the relevant collection of departments. Those can come from the same field in the same table, but they describe different quantities. The query needs to preserve which budget belongs to a row and which quantity serves as the comparison threshold. SQL can express this by placing a query for the average inside an outer query for the qualifying departments.
These examples explain why the paper treats SQL as a difficult target for step-by-step prompting. SQL is largely declarative. Its clauses specify the answer to retrieve and the conditions it must satisfy. The question does not necessarily divide into independent sentences that correspond to those clauses, and the clauses constrain one another. A useful decomposition has to respect the work involved in designing a query. Sometimes that means finding the path between tables. Sometimes it means identifying a quantity that the rest of the query depends on.
How earlier systems represented questions and queries
In the paper’s account, early research often targeted particular domains. Some systems accepted controlled language, restricting the expressions users could employ. Others interpreted questions using rules. The field subsequently pursued greater independence from individual domains through supervised learning on examples drawn from varied databases and tasks. The paper discusses Seq2SQL and Spider in this part of its history.
One way to learn the translation is to encode the question and schema, then use those representations to generate the target query. An encoder converts the input into a representation that the decoder can use to make output decisions. The authors place this approach in the tradition of sequence-to-sequence learning. Their account describes several ways to build the representation. IRNet uses a bidirectional recurrent encoder, RYANSQL uses convolutional processing, and SQLova draws on BERT. These systems illustrate how the input side of text-to-SQL can change even when the overall job stays the same.
Other approaches make the structure of the database an explicit part of the encoding. The paper discusses graph-based techniques in systems such as RAT-SQL, where relationships matter to the representation of the schema and its connection to the question. It also names work on encoding tabular information and text together, including TaBERT and TaPas. These strands of earlier research already establish the importance of accounting for tables and schema relations. The question for DIN-SQL is how to make those considerations available through prompts.
The paper distinguishes two broad ways to organize generation. A sketch-based decoder starts from a query outline and predicts what belongs in its slots. This breaks a large prediction into smaller ones, with the allowable outlines defining what the decoder can express. A query that falls outside those outlines poses a generalization problem. A generation-based decoder can build an abstract syntax tree, a hierarchical representation of a query’s structure. That choice locates the construction problem in the tree and its parts. The paper also discusses earlier work on intermediate representations, which changes the form the system initially has to produce so that it resembles the information a question conveys more closely. Towards Complex Text-to-SQL in Cross-Domain Database with Intermediate Representation
Prompting changed what had to be prepared for a new task. In a zero-shot setting, an instruction describes what to produce and gives no worked demonstrations of the translation. A few-shot prompt adds examples of questions and their SQL answers. The system can use those examples during the call, with its learned parameters held fixed. The authors cite broader work on learning from examples in a prompt and discuss the appeal of getting a database interface to work without the resource demands of training a new system or fine-tuning an existing one on a large task-specific collection. Language Models are Few-Shot Learners
The earlier text-to-SQL prompting studies discussed by the authors examined zero-shot behavior. The authors saw that setting as leaving room for stronger uses of the same underlying capabilities. The immediate problem was how to use demonstrations when a question demands decisions about fields, table relationships, and possibly several levels of query structure at once. A conventional prompt can demonstrate the complete translation, but it leaves the system to recover those decisions within one generation.
Research on reasoning prompts gave the authors a way to formulate an alternative. Chain-of-thought prompting demonstrates intermediate reasoning, while least-to-most prompting works through simpler problems that help solve a larger one. The paper also discusses decomposed prompting in connection with tasks such as mathematical word problems and compositional navigation. In SQL, the main challenge is finding where such an intermediate answer helps. An independently expressible query for an average has a clear role. For many simple questions, identifying the intended field already does most of the interpretive work. Chain-of-Thought Prompting · Least-to-most prompting
The failures that shaped DIN-SQL
The authors used CodeX Davinci to find out what went wrong under basic few-shot prompting. They randomly drew 500 questions from Spider’s training partition, leaving out all databases used in the prompts. They compared the generated queries with the reference queries by running them, then manually investigated failures. Their categories distinguish a mistaken interpretation of the database from a mistaken construction of the SQL, though an individual error can have consequences for both.
The largest group concerned schema linking. A query could miss the intended table, choose the wrong column, or misidentify an entity. An example about stadium capacities shows why looking for matching words is insufficient. The schema happened to contain a column named average, and the generated query selected it. The requested average was a computation over the capacity field. The problem started with the role assigned to a word in the question, even though a real database column happened to bear that name.
Join mistakes formed the next largest group. A generated statement could leave out a table needed to connect the requested entities. It could also include the appropriate tables and match their rows on the wrong columns. More joins create more places to make either mistake. The authors therefore wanted the generation step to begin with an explicit account of the participating tables and relevant relationships.
Another group concerned GROUP BY, the construction that specifies which rows should contribute to each grouped result. A request for a count per building needs a separate group for each building. A count over the whole table answers a different question, as does a count grouped at the wrong level. The authors also saw failures involving nesting and set operations. In those cases a generated query could miss the need to compare or combine the results of separate queries, or it could choose the wrong operation for that combination.
A small group contained syntactically invalid statements. The remaining group covered errors such as an omitted WHERE clause, an extra filter, unnecessary aggregation, or a missing modifier. For instance, DISTINCT affects whether duplicate results are retained, and DESC tells SQL to sort in descending order. Incorrect use can change the returned result while leaving a statement that still runs. This part of the diagnosis motivated a separate review step for the draft, alongside the earlier stages that decide what the query should mean.
The method, step by step
What passes from one stage to the next
DIN-SQL begins with a database question and a description of its schema. It produces an initial account of which fields, values, and relationships matter. A second stage predicts the kind of SQL construction the question calls for and, where useful, identifies smaller questions to solve. A class-specific prompt generates the SQL. The final stage takes the resulting statement and asks for a review. The authors implement each module with prompting and use examples from the relevant benchmark’s training partition where demonstrations are required.
How DIN-SQL builds and reviews a query
The steps in order.
A department-budget question gives a view of the whole process. The linker can identify the department name and building as output fields and the budget as the field involved in the comparison. Planning identifies a separate question about the overall average budget. Generation writes SQL for that average and uses it inside a statement selecting the departments whose budgets exceed it. Review can then examine the draft for potential mistakes. The overall average is expressed as a query, so composing the answer does not require knowing the numerical value in advance.
The design gives the intermediate results a direct effect on the completed query. Schema links become part of later prompts. A predicted class determines which form of demonstration the generator sees. A subquestion suggests a piece of SQL that can be used in the final construction. The prompts thus distribute the decisions about a question across stages that ask for different kinds of output.
Find the database references first
The schema-linking prompt shows the system the tables and their columns, along with foreign-key relationships. For Spider the authors describe selecting ten training examples at random for this prompt. The demonstrations work through phrases in a question, explain which columns those phrases imply, identify relationships relevant to combining the tables, and collect values that may appear in conditions. This is the module in which the authors use a step-by-step cue associated with earlier work on reasoning prompts. Large language models are zero-shot reasoners
The football example in the paper illustrates the type of distinction the linker has to make. The user wants player names, filtered by preferred foot and by a range of overall ratings. The name comes from the player table. The preferred foot and rating come from the player attributes table. The demonstration picks the relationship using the shared player identifier and extracts left and the bounds 85 and 90 from the question. Later SQL generation will have to distinguish the name that is returned, the attributes tested in the filter, and the identifier that connects the records.
Linking can also recover an element with no corresponding output word in the question. In the example about cities hosting competitions, the requested city status belongs to the city table, while the records to count belong to the competition table. The host city identifier supplies the relationship. It belongs in the interpretation because it establishes which competitions to count for which city. The phrase asking for status gives no reason to return that identifier to the user.
The appendix gives an example about a course offered in Chandler during Fall 2010. Chandler supplies a location constraint, and Fall and 2010 supply separate semester and year constraints. The title is a course field, whereas the conditions describe a scheduled offering and refer to fields in the section table. The course identifier links those records. Identifying that distinction early gives generation a clearer basis for constructing both the returned field and the conditions.
The schema-link record has a specific scope. It identifies the available pieces of the query, leaving choices such as grouping, exclusion, and the placement of a comparison to later processing. In the budget example, the same budget column can supply a row-level value and the data for an average. The link alone does not specify how the two uses fit together. That information comes from the question and the structural analysis that follows.
Decide what form of query to build
The classification prompt examines the required SQL structure using the question, schema, and links. It predicts one of three classes: easy, non-nested complex, or nested complex. The classification rules give priority to identifying a nested construction. A join without a nested component leads to the non-nested route. A single-table query that can be written without either construction follows the easy route.
The easy label still permits substantial work inside a table. A demonstration asks for the department with the greatest total course credits. Course records already carry a department field and a credit field. The query can group course records by department, total their credits, then order those totals to select the department at the top. The route is easy in the architecture’s specific sense because the SQL can carry out those operations without crossing table boundaries or introducing a subquery.
The advising example calls for a different route. The request associates an instructor’s name with students in a particular department and uses student credits for ordering. The schema separates instructors, students, and advising assignments. The planner identifies those tables so that generation can write the appropriate connections. This is non-nested complexity: the hard part of the construction comes from combining records, while the overall query needs no independently formulated subquery.
A request involving both Statistics and Psychology illustrates how a single table can still lead to the nested route. The classification demonstration identifies a set operation, with a subsidiary request for the titles offered by Psychology. The relevant distinction is whether the answer requires handling separately described sets of titles. The number of tables alone would miss that distinction.
Besides naming the route, the classifier identifies tables involved in joins and proposes subquestions for the nested route. The paper points in particular to uncorrelated subqueries. Such a subquery can be formulated independently of any one row considered by the surrounding query. Computing a department-wide average is an example. Once its SQL is available, the larger statement can compare each department’s budget against the result. The prompt stage is designed to make that dependency explicit before the full query is written.
The labels are procedural decisions for generation. Spider’s own hardness levels are evaluation categories assigned according to SQL features. They serve a different purpose. For example, a grouped, ordered, single-table query can follow DIN-SQL’s easy route even though the benchmark considers more features than the presence of joins or nesting when assigning difficulty.
Generate directly when a single query is enough
The easy prompt demonstrates a mapping from the question and its schema links straight to SQL. For example, a classroom question can ask which buildings contain rooms above a capacity threshold. With the relevant table and fields identified, generation can focus on filtering rooms by capacity and selecting the building names with duplicates removed. The authors also use examples involving sorting, counting, and aggregation. The same format works whenever the required construction stays within the direct route.
The paper gives the demonstration for this route in the following form.
Eⱼ: ⟨Qⱼ, Sⱼ, Aⱼ⟩
Eⱼ is the demonstration indexed by j. Qⱼ is its question in English, Sⱼ is its set of schema links, and Aⱼ is its SQL answer. The colon introduces the contents of the demonstration. The angle brackets group the entries, and commas separate them in prompt order. The shared subscript ⱼ indicates that all entries belong to the same example.
This notation describes what goes into a demonstration. The direct prompt still has the benefit of the linker’s work. If a building is requested and capacity is the condition, the generator can draw on both linked fields while producing the appropriate SELECT and WHERE clauses. The route minimizes the amount of further reasoning that the prompt asks the system to write out. The authors’ rationale is that extra intermediate steps can be less effective on simpler cases.
Use NatSQL to prepare the joined query
The non-nested complex prompt adds NatSQL between the problem description and the executable answer. The paper motivates this through the mismatch between the form of a database question and the form of SQL. A user may refer to a course and its instructor in the same phrase. An executable statement can need a course table, a teaching table, an instructor table, and explicit conditions connecting them. Those conditions matter even when the question gives no lexical cue for each one.
The earlier SemQL representation illustrates the reasoning behind this design. The paper describes it as omitting explicit JOIN ON, FROM, and GROUP BY structures and combining the roles of WHERE and HAVING. WHERE applies conditions to rows, while HAVING can impose a condition on a group after aggregation. A question asking for courses with a specified prerequisite count conveys the count and the comparison directly. Expressing that intent first can defer the choice of SQL clause until the final construction. The authors describe NatSQL as continuing the same line of work and removing set operators from the intermediate representation. The resulting expressions can still contain SQL-like syntax, as the paper’s demonstrations show.
The non-nested demonstration has this form.
Eⱼ: ⟨Qⱼ, Sⱼ, Iⱼ, Aⱼ⟩
Eⱼ denotes example j, and Qⱼ is its English question. Sⱼ holds the schema links associated with that question. Iⱼ is its NatSQL intermediate expression, and Aⱼ is its complete SQL answer. The colon introduces the demonstration’s contents, the angle brackets enclose them, and commas show the succession of entries. The subscript ⱼ ties each entry to the same example.
In the demonstration involving an alphabetical listing of course titles and instructor names for 2008, the intermediate expression identifies the requested fields, constrains the year in the teaching records, and calls for an ordering by title. The final SQL supplies the joins connecting the course records to the teaching records, and those records to the instructors. The prompt also shows a list of the tables involved. These pieces give generation both a description of the result and information about the relational path needed to obtain it.
The prerequisite-count demonstration shows how the intermediate form can also defer a decision about grouping. The NatSQL expression expresses a count condition on prerequisite records associated with a course. In the complete SQL, the course records are joined to the prerequisite records, the rows are grouped by course, and the aggregate count determines which groups qualify. The final query places the condition in HAVING. The relation between the count and the desired answer is already present in the intermediate form, even though the final query still needs a specific join and clause arrangement.
The prompts demonstrate the transition from NatSQL to executable SQL as part of generation. The intermediate expression provides material for the next part of the answer, along with the schema and the other reasoning shown in the prompt. The construction still depends on correctly expressing the joins, filters, and grouping in the final statement.
Express the dependencies of nested queries
For nested complex problems, DIN-SQL shows the system how to write SQL for subsidiary questions, then use their solutions in the complete construction. The generation prompt draws on the subquestions proposed in classification. A subquestion may seek a single quantity, such as an average, or a collection of identifiers to include or exclude. The example gives both the subsidiary SQL and a NatSQL expression for the overall question before the final answer.
Eⱼ: ⟨Qⱼ, Sⱼ, ⟨Qⱼ₁, Aⱼ₁, …, Qⱼₖ, Aⱼₖ⟩, Iⱼ, Aⱼ⟩
Eⱼ is demonstration j. The outer entries are the full English question Qⱼ, its schema links Sⱼ, the enclosed sequence of subquestion and SQL pairs, the NatSQL expression Iⱼ, and the final SQL Aⱼ. In the inner sequence, Qⱼᵢ and Aⱼᵢ denote subquestion i of example j and the SQL for that subquestion. The subscript ⱼ₁ marks the first pair, and ⱼₖ marks the last, where k is the number of subquestions. The ellipsis … stands for any intervening pairs. The colon introduces the contents, angle brackets group the outer demonstration and the inner sequence, and commas separate their entries.
The budget case illustrates a subquery that produces a single comparison value. The prompt first gives SQL that averages departmental budgets. It then uses the average in a statement that returns the names and buildings of departments over that threshold. The approach distinguishes two tasks that use the same table: computing a quantity over the records and selecting particular records by comparing their budgets with that quantity.
A request for courses without any prerequisite illustrates a subquery that returns a collection. The subsidiary query obtains course identifiers from the prerequisite table. The main query can compare the course identifiers against that collection and return the titles associated with identifiers outside it. The subquestion concerns courses with recorded prerequisites because those are the records the completed statement needs to exclude. Stating that positive condition separately gives the exclusion a specific operand.
The same route covers set operations. In a demonstration about instructors who taught in Fall 2009 but did not teach in Spring 2010, the subsidiary instruction isolates the Spring 2010 instructors. The finished SQL constructs a result for the Fall 2009 instructors and uses EXCEPT to remove identifiers returned for Spring 2010. This shows why nesting in the route’s name covers more than a parenthesized query within a filter. The significant feature for prompting is that the final result depends on separately described query results.
A nested question can also require joining tables. The classroom example asks for the title and credits of a course taught in the largest classroom. To express the capacity condition, generation first obtains SQL for the largest capacity. To reach the course fields, it also connects the classroom to the scheduled section and the section to the course. The schema in the example distinguishes classroom records using building and room number, and the final SQL uses both to connect classrooms with sections. The subquery determines the comparison value while the joins determine which course records satisfy it.
The appendix includes some repeated examples across generation prompts, including a request for the department with the highest budget. In the nested prompt, that request is demonstrated with a closely related subsidiary question and a final statement that selects a department after sorting budgets. In the method, the class identifies the kind of prompt to use on a new question. The appendix shows that a prompt can teach the format using examples whose final SQL also appears under other routes.
Inspect the generated SQL
The final module asks for a review of the draft without furnishing worked repair examples. This is the zero-shot stage of DIN-SQL. The paper identifies issues such as redundant or missing aggregation, duplicate handling, and sort direction. These are appropriate subjects for a review of a statement whose broad construction is already in place. For instance, an answer that groups correctly and selects the intended field can still have the wrong ordering for a question about the greatest value.
The authors distinguish a generic repair prompt from a gentle inspection prompt. The generic version presents the SQL as defective and requests a fix. The gentle version asks whether any problem is present and offers guidance on clauses that merit attention. DIN-SQL defaults to the generic version for CodeX and the gentle version for GPT-4. The paper evaluates those choices separately because the premises of the two prompts can elicit different revisions from the same draft.
In this module, the draft SQL is the material to inspect. Running queries and comparing their results belongs to the evaluation procedure described by the paper. The module’s name refers to a further prompted inspection of the generated statement. Its ability to improve an answer depends on the quality of the revision it proposes.
How examples and decoding were set up
The authors draw the few-shot examples from benchmark training data. For the generation routes, the Spider demonstrations use the training database selected for the classification prompt. The appendix shows the university schema in these prompts, with course, student, and related records used to demonstrate the different outputs. The NatSQL expressions for the complex routes come from the NatSQL project’s representations for Spider training queries. Those resources provide the intermediate forms that the authors place alongside the corresponding questions and SQL.
The examples are manually assembled and fixed for each class. The adaptation at inference time is the choice of generation prompt. This setup allows a new request to take a shorter or longer route while using prearranged demonstrations appropriate to that route. It also explains how DIN-SQL uses training material despite performing the actual benchmark translation through prompting.
BIRD requires room for additional input. The authors include sample rows from each table, and the external knowledge supplied for each question follows the question as a hint. They use fewer demonstrations to fit those additions into the available input context. The division into modules remains the same kind of procedure, with a different balance of examples and information about the question’s database.
The experiments use the OpenAI API for GPT-4 and the Davinci and Cushman variants of CodeX. The authors use greedy decoding, choosing the preferred continuation at each step with temperature set to zero. The output limit is 350 tokens for self-correction and 600 tokens for the other modules. The prompts for those other modules stop at the question marker Q:, while self-correction uses a separate stop sequence. The appendix documents the prompts, and the authors release the implementation, prompts, and results on GitHub.
Experiments and results
What the benchmarks supply
Spider is a cross-domain benchmark. The paper describes 10,181 questions and 5,693 distinct complex SQL queries, spanning 200 databases and 138 domains. Each database has multiple tables. In the partition counts reported by the paper, training comprises 8,659 examples from 146 databases, development comprises 1,034 examples from 20 databases, and the hidden test set comprises 2,147 examples from 34 databases. The databases in the partitions are disjoint. A demonstration can therefore show how to interpret a schema and construct a query, while evaluation still requires applying that practice to different tables and field names.
The benchmark classifies SQL by difficulty using features that include the number of keywords, nested subqueries, column selections, and aggregation. This makes it possible to ask how performance changes as construction becomes more involved. The authors used the development set for most of their testing during development. The hidden Spider questions were accessible for evaluation through a server, so the head-to-head prompting comparisons and module studies principally use the development setting.
BIRD expands the database setting in a different direction. It has 12,751 distinct question and SQL pairs, on 95 databases with a combined size of 33.4 GB. The paper describes coverage of more than 37 professional domains, including healthcare, education, hockey, and blockchain. It also describes the SQL in BIRD as generally more intricate than in Spider. The benchmark supplies external knowledge in several forms: information for numerical reasoning, domain knowledge, synonyms, and examples that illustrate database values. BIRD
For DIN-SQL on BIRD, sample rows give the prompt some information about how table contents are actually represented. A question-specific hint supplies the external knowledge for that request. These inputs can help with a mapping that would be hard to make from the column names alone. For Spider’s reported test results the authors use the database structure without its contents. The experiment on each benchmark should be understood with the information supplied in that setting.
How the authors measure a correct answer
Spider reports execution accuracy, abbreviated EX, and exact set match accuracy, abbreviated EM. Execution accuracy is based on running the generated query and the reference query and comparing the outputs on the evaluation database instances. This choice lets an alternative SQL formulation receive credit when it returns the desired result. The metric measures the behavior of the statement as used in the benchmark.
Exact set match compares the parts of the generated query with those of the reference, treating each clause as a set. To score as a match, the prediction must agree across the compared components. The procedure disregards literal values. Its strength is that it tests agreement with the annotated construction. Its judgments can differ from execution judgments when the same result can be reached through different constructions, or when a structural match contains a different value.
BIRD reports execution accuracy as well as valid efficiency score, abbreviated VES. VES incorporates how efficiently a generated SQL statement runs when its result is correct. The requirement for a valid result means speed counts in relation to the intended answer. The time measured there concerns executing the SQL. DIN-SQL’s separate processing cost and response time concern producing the SQL through the prompted stages.
The hidden Spider test set
GPT-4 with DIN-SQL reached 85.3% execution accuracy on Spider’s hidden test set. The previous best cited by the paper was 79.9%, associated with the work on decoupling schema linking and the query skeleton. CodeX Davinci with DIN-SQL scored 78.2%, which the paper places third among officially published execution results at the time. The authors achieved these scores without putting Spider database contents into the prompt.
Execution accuracy on the Spider hidden test set
DIN-SQL with GPT-4 ranks above the previous leader on returned answers.
The numbers
| System or setting | execution accuracy % |
|---|---|
| DIN-SQL with CodeX Davinci | 78.2 |
| Previous leading result | 79.9 |
| DIN-SQL with GPT-4 (this paper) | 85.3 |
For exact set match on the same split, GPT-4 with DIN-SQL scored 60% and CodeX Davinci with DIN-SQL scored 57%. The previous best cited for that metric was 74%, from Graphix-T5. The authors characterize their structural scores as comparable to earlier work that also used no database content. The overall standings depend on what the benchmark asks the queries to agree on.
Exact set match accuracy on the Spider hidden test set
The previous structural match leader scores above both DIN-SQL configurations.
The numbers
| System or setting | exact set match accuracy % |
|---|---|
| DIN-SQL with CodeX Davinci | 57 |
| DIN-SQL with GPT-4 (this paper) | 60 |
| Previous leading result | 74 |
The authors attribute the separation between execution and structural scores to the few-shot setup. With extensive task-specific training, a system can learn recurring composition choices from annotated SQL. The paper argues that such choices may carry from training to test questions because the annotations often share writers. A prompted system with only a small collection of demonstrations has less exposure to that style. The scores establish that the output and structure measures tell different stories for DIN-SQL. The proposed explanation concerns how the systems acquired the query styles they use.
Development comparisons with direct prompting
The Spider development experiment includes zero-shot results from earlier evaluations, as well as the authors’ straightforward few-shot baseline. The latter gives the system worked English-to-SQL examples in a common prompt. For comparison with DIN-SQL, the authors put the examples used by the generation routes into that baseline. For the smaller input context of CodeX Cushman, they use 2 examples from each class, for 6 in its few-shot prompt. This makes the relevant comparison one between ways to arrange the task and use examples, with the available context determining how much can fit.
DIN-SQL improves both execution accuracy and exact set match accuracy over the simpler prompting approaches, according to the Spider development results. The paper reports that execution accuracy improves by at least 10% over its few-shot baseline for every tested system. The gain appears across the Davinci and Cushman variants of CodeX as well as GPT-4. The consistency across these systems matters to the experiment because it shows the improvement under more than one choice of generator.
The authors also compare performance by Spider difficulty. DIN-SQL improves on basic few-shot prompting in every benchmark category. The biggest improvements appear on hard and extra-hard questions, where direct few-shot prompting had more difficulty. The authors attribute improvement on easy questions to the schema links supplied to generation. This gives a more detailed account of the result than the aggregate comparison. The difficult questions benefit where the pipeline devotes more attention to construction, and the simpler questions can benefit from an improved interpretation of the fields and conditions.
BIRD and the comparison across splits
On BIRD, GPT-4 with DIN-SQL achieves 55.9% execution accuracy on the hidden test set and 50.72% execution accuracy on the development set. The paper reports the hidden score as a new leading result. The authors report that, on development questions, execution accuracy rose by 4% and the valid efficiency score improved by 9% compared with the BIRD study’s GPT-4 baseline. The latter gives evidence about the correctness and running efficiency of the produced statements together.
The benchmark comparisons establish different things. Spider supplies comparisons against earlier strong supervised systems and against direct prompting with similar demonstration material. BIRD supplies a comparison against a GPT-4 baseline under an evaluation that also values efficient query execution. The supplied hints and example rows from the tables are given to DIN-SQL when it runs on BIRD. Its scores reflect the use of that information as part of the translation process.
The authors observe that execution performance is higher on the test partition than on the development partition for both benchmarks. They offer possible explanations, including less reliance on database content or fewer cases where a question expression could plausibly denote several schema elements. The test questions were hidden, so the study leaves those explanations open. A higher test score establishes the result on that split and does not by itself identify what made the split easier for this pipeline.
What the ablations show
Removing modules from the complete system
The authors test the contribution of the modules by comparing the full configuration with versions that omit individual parts. With CodeX Davinci on Spider development data, each such omission lowers overall execution accuracy. This complements the comparison with direct prompting. The overall comparison changes the generation procedure in several respects at once, while the removal study asks whether particular parts are worth keeping in the evaluated configuration.
The total effect of a removal can include consequences downstream. A generated link can influence how the classifier describes the question and how the generator interprets it. Removing the classification step changes which prompt is used across the question distribution. Removing review changes the final treatment of whatever draft the earlier stages produce. The ablation scores consequently describe the usefulness of modules in the assembled pipeline, where the quality of one stage affects the input to another.
Schema links improve accuracy and can introduce extra structure
The paper reports that explicit schema linking benefits all the query difficulty categories in the CodeX Davinci analysis, with the smallest improvement on the hard category. A closer look at a sample of failed queries identifies a reason the improvement can vary. In an ambiguous question or schema, the linker can include additional fields that look relevant. If the generator follows those links, a draft may join a table that the requested answer never needed or return a column the user did not ask for.
Consider the difference between linking a field used as a filter and linking a field to be returned. Both can be relevant to the question. If the generator interprets relevance as a cue to include a field in the answer, it changes the selected columns. Likewise, including a plausible table gives the generator a reason to look for a connection, and the resulting join can change which rows survive into the answer. The authors’ inspection shows why the usefulness of schema linking depends on the precision of the proposed links as well as their ability to recover missing evidence.
The useful amount of decomposition changes with the question
To study classification, the authors compare class-based routing with approaches that use a common generation prompt for every question. In the version using decomposed chain-of-thought throughout, the prompt designed for the nested complex class processes the entire development workload. The configuration retains schema linking, NatSQL, and self-correction. The paper also considers giving all questions the simplest prompt, the one used for easy queries.
The two fixed procedures have different strengths. The nested-style procedure does better on Spider’s hard and extra-hard questions. The direct procedure does better on the easy category. This comparison gives a concrete grounding for the decision to route. The most elaborate prompt can help with queries whose meaning has to be assembled from subquestions or whose SQL requires substantial construction. For a question that is ready for direct translation once the fields are known, the simpler prompt can produce a better result.
The always-decomposed comparison uses several components of the full method. Its performance therefore speaks to the choice between applying a rich procedure broadly and applying it selectively. The experiment includes the effect of assigning a common prompt to a varied workload. It supports adapting the generation strategy even when a single complex prompt is capable of addressing many of the cases.
The correction instruction changes the effect of review
The authors compare correction prompts using both CodeX Davinci and GPT-4. With CodeX Davinci, the generic repair instruction helps across the query difficulty categories. Gentle inspection also helps overall in the comparison, with a smaller benefit than the generic repair prompt. The result supports the use of a direct correction request for that configuration.
For GPT-4, starting from the premise that the statement is buggy can reduce execution performance. The gentle check works better and improves results in the reported categories other than easy. The authors relate the difference to their observation that GPT-4 produces fewer defective initial statements. If more drafts are already correct, a request that strongly implies a change is needed gives the review stage more chances to alter a satisfactory query.
The comparison concerns the premise and wording of the review as well as the presence of a review call. Both prompts ask the system to address SQL errors. One begins with an asserted defect, while the other leaves the diagnosis open and directs attention to possible issues. The observed effects explain the different defaults used in the main experiments and show that the best review prompt can depend on the reliability of the draft it receives.
The original error categories after decomposition
The authors return to the same 500 Spider training questions used in their initial diagnosis and run DIN-SQL on them. They report improvement in every error category. The largest improvements appear in join failures and in the category involving nesting. These are the places where the planner and more elaborate generation routes provide explicit assistance: identifying tables that need to be combined, and articulating a subproblem that contributes to the completed statement.
Schema linking still accounts for the largest part of the remaining errors. This finding is compatible with the ablation evidence that the linker helps. A component can prevent many mistakes in a common failure category while leaving that category dominant among the errors still observed. The sample inspection about redundant links also gives a mechanism for some of those remaining mistakes. Taken together, the analyses show that the biggest changes appeared in relational and nested constructions, while identifying the intended schema elements remained a substantial source of difficulty.
Limitations
Limits the authors state
The authors identify the fixed demonstrations as a limit of the method. They prepare examples manually and use the same ones within each query class. A question can change which route is selected, but two questions on the same route can have very different needs. One joined query might turn on a linking table, while another might turn on how grouping interacts with a count. The prompts accommodate those differences through the question and its intermediate outputs, with a demonstration collection shared across the route. The authors propose adaptive, automated construction of demonstrations at a finer level as a direction for further work.
The other explicit limitation is the cost and time of the staged procedure. At the time of writing, the authors estimate approximately $0.5 and roughly 60 seconds to respond to a Spider question using GPT-4. Those measurements concern the reported setup. They make the inference tradeoff concrete: the system can gain benchmark accuracy by carrying out separate prompted tasks, while each response requires more processing than a direct generation request. The authors anticipate that costs and response times may fall with advances in the underlying systems and identify cost reduction as a direction for further work.
What follows from the experimental setup
The tested generators are GPT-4 and the two CodeX variants. Their results demonstrate that several choices of generator can benefit under the reported conditions. The experiments do not establish how reliably a substantially smaller system would produce the same intermediate outputs. The ability to identify tables, propose a sound subquestion, and turn a NatSQL expression into executable SQL all contribute to the observed performance. A change in the system carrying out those calls can change the success of the whole procedure, as the review comparison already shows.
Intermediate outputs give later stages something concrete to work with, but their errors can also carry forward. The analysis of redundant schema links documents that possibility. Classification likewise has to decide on the structure before a complete SQL draft is available. A nested prompt can make use of a good subsidiary question, while a poor subsidiary question can direct generation toward the wrong calculation. The reported comparisons give evidence at the level of the final query and some categories of error. They do not establish the independent reliability of every classification or subquestion that the workflow produces.
The repair stage has a similar evidentiary boundary. The prompt asks for a judgment about SQL, with the benchmark later judging the returned result. An inspection can fix a local defect. It can also introduce a change with unintended consequences, as the generic correction result for GPT-4 illustrates. The experiment provides evidence that the aggregate effect of review depends on its formulation. It does not supply a per-query verification rule that determines which proposed edits preserve or improve the answer.
What the scores can establish
Execution agreement gives alternative SQL formulations a way to receive credit, but it concerns the data on which the queries were compared. Two statements can agree on a particular database instance and diverge when records change. For instance, duplicate handling may make no difference on an instance where the relevant result happens to contain no duplicates. That instance alone offers no test of whether the generated query handles duplicates in the way the request requires. Exact set match gives complementary evidence about construction, with its own restriction that literal values are ignored.
For the same reason, the lead in execution accuracy cannot establish the authors’ explanation of why structural match is lower. The composition habits of a reference writer may matter, and the metrics make room for behaviorally equivalent alternatives. The measured scores describe different kinds of agreement. Establishing how much of the gap comes from differing query styles would require evidence that isolates style from the other reasons queries can agree in execution.
The choice of benchmark inputs also bounds the results. The Spider test runs use schema information without database contents. The BIRD runs add sampled contents and the benchmark’s knowledge hints. The BIRD results describe that combined setup. They leave open how the same pipeline would perform on those questions if the hint or sample rows were removed, or if the context budget were allocated differently between demonstrations and database evidence.
Finally, the central task in the experiments is a single question paired with database information and a reference SQL query. The paper documents ambiguity when multiple schema interpretations are plausible. Its procedure resolves that question inside the pipeline and produces a statement. The experiments do not test when to return to the user for clarification, how to maintain an interpretation across successive requests, or how to respond when the database cannot answer the question. Those interaction problems call for evidence beyond success at this form of benchmark translation.
What came after
Evaluation and the design of staged systems
Later work citing DIN-SQL addresses several points at which a text-to-SQL system can be studied or changed. The benchmark-oriented study Text-to-SQL Empowered by Large Language Models takes evaluation as its organizing problem. DIN-SQL is relevant there because a prompting method can differ from another in how it allocates the work, even if both use the same underlying generator. Evaluation can ask separately what information the prompt supplies, where intermediate processing occurs, and which measure determines whether the generated query is good.
BIRD has a direct connection to the experiments in DIN-SQL as well as appearing among the citing works. Can LLM Already Serve as A Database Interface? provides the benchmark on which DIN-SQL uses table samples and supplied hints and compares with an existing GPT-4 baseline. This connection shows how an evaluation setting can affect the procedure being evaluated. A benchmark that supplies descriptions of values and domain knowledge gives schema linking additional evidence. A metric that incorporates query execution time adds a performance question alongside answer correctness.
DSPy addresses the broader task of compiling declarative calls into pipelines that improve through optimization. DIN-SQL illustrates what becomes available for optimization once the translation is organized as several calls: intermediate outputs have defined roles, and instructions and demonstrations can vary from stage to stage. The later work’s stated scope is the program made from those calls, a framing that applies beyond the particular SQL routes in DIN-SQL.
Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programs focuses specifically on instructions and demonstrations in such programs. These are choices the DIN-SQL authors make by hand. The connection is especially direct for examples: DIN-SQL changes the prompt family as a function of query structure, then keeps the demonstrations fixed within that family. Optimizing demonstrations in a multi-stage program addresses a design choice that can still vary after the pipeline has been defined.
Alternative ways to allocate the work
MAC-SQL organizes text-to-SQL around collaboration among agents. The relationship to DIN-SQL is the division of a translation into distinct responsibilities. DIN-SQL describes a predetermined sequence in which grounding and classification inform generation, with a further call for correction. MAC-SQL puts collaboration at the center of its framework. The shared research question is how to coordinate work on a database request when generating the finished query is only one part of interpreting it.
MCS-SQL makes multiple prompts and multiple-choice selection central to generation. In DIN-SQL, a classification result selects a generation strategy before the complete query is written. MCS-SQL’s emphasis places selection in a setting with multiple prompts and alternatives to consider. This addresses a different point in the handling of uncertainty: a system can organize its effort around choosing a procedure early or around selecting among alternatives produced during inference.
PExA takes parallel exploration as its approach to complex text-to-SQL. DIN-SQL’s nested route gives a clear example of sequential dependence, where the statement for a subsidiary question helps form the final SQL. Parallel exploration addresses the broader problem of using inference effort on difficult questions when there may be several directions worth pursuing. The connection is to how a system structures its work on complex cases, where the paper found that a direct prompt struggled most.
More evidence for linking and checking
The residual schema-linking errors make this stage a particularly clear point of connection. Rethinking Schema Linking addresses it through context-aware bidirectional retrieval. SchemaGraphSQL approaches efficient linking on large databases with graph pathfinding. These works place distinct kinds of machinery at a stage DIN-SQL handles through demonstrations. The connection is concrete when two requested fields belong to different tables: finding the fields is part of the job, and identifying the relevant relationship between them is another part. Retrieval addresses which schema material should be brought into consideration, while pathfinding puts the connections in the database structure at the center of the problem.
LitE-SQL brings vector-based schema linking and execution-guided self-correction into a lightweight text-to-SQL framework. Both duties have an explicit place in DIN-SQL. The differences named by LitE-SQL concern the evidence each duty uses. Linking draws on a vector-based approach, and correction is guided by execution. DIN-SQL’s review experiments make the second distinction consequential: asking for a revision based on the draft alone can help or hurt depending on the wording and the quality of the initial statement.
PV-SQL brings database probing together with rule-based verification, and VET focuses on verifiable execution tracing. Both connect to the difference between reviewing a query’s text and obtaining evidence about its behavior. In DIN-SQL, execution is central to how the authors score the finished translations. These later works make probing, verification, or tracing part of the research problem itself. They address how evidence from the database and query execution can inform the production or assessment of an answer.
A database interaction can require more than translation
PRACTIQ studies conversational text-to-SQL through a dataset that includes ambiguous and unanswerable queries. CLARITY similarly places ambiguity and unanswerability at the center of an interactive benchmark. DIN-SQL encounters ambiguity as a reason to link the wrong field or include redundant schema elements. In a conversational setting, the ambiguity can be part of the request the system has to handle explicitly. A distinction that the benchmark previously expressed as a single reference query can become a reason to clarify what the user means.
Rethinking Text-to-SQL takes dynamic, multi-turn SQL interaction as the setting for database exploration. That setting changes what a translation procedure has to preserve: an interpretation may depend on what the user has already asked and on what previous queries have revealed. DIN-SQL’s experiments concern what schema grounding, problem decomposition, and review can achieve for individual benchmark questions. The later conversational work extends the object of evaluation to the exchange in which those questions arise.
Fields, topics and concepts
Shelves 5The field of science this work belongs to (OpenAlex fields).Computer Science · 19,503 worksArtificial Intelligence · 18,805 worksArts and Humanities · 17,959 worksLanguage and Linguistics · 17,789 worksComputer Networks and Communications · 115 works
Topics 3Research subjects and languages the work is about.Language models & pretraining · 4,145 worksCode & programming languages · 194 worksSemantic parsing & meaning representation · 194 works
Concepts 2Key ideas and methods explained on our concept pages.Few-shot learning · 45 worksSemantic parsing · 30 works
Cite
Cite as Mohammadreza Pourreza and Davood Rafiei. 2023. DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction. arXiv:2304.11015.
@misc{pourreza2023din,
title = {{DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction}},
author = {Mohammadreza Pourreza and Davood Rafiei},
year = {2023},
doi = {10.48550/arxiv.2304.11015},
eprint = {2304.11015},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2304.11015}
}References
- Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:0 1877–1901, 2020. our card
- Ruichu Cai, Jinjie Yuan, Boyan Xu, and Zhifeng Hao. Sadga: Structure-aware dual graph aggregation network for text-to-sql. Advances in Neural Information Processing Systems, 34:0 7664–7676, 2021. OpenAlex ↗ · Scholar ↗
- Ruisheng Cao, Lu Chen, Zhi Chen, Yanbin Zhao, Su Zhu, and Kai Yu. Lgesql: line graph enhanced text-to-sql model with mixed local and non-local relations. arXiv preprint arXiv:2106.01093, 2021. our card
- Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021. our card
- Wenhu Chen. Large language models are few (1)-shot table reasoners. arXiv preprint arXiv:2210.06710, 2022. our card
- DongHyun Choi, Myeong Cheol Shin, EungGyun Kim, and Dong Ryeol Shin. Ryansql: Recursively applying sketch-based slot fillings for complex text-to-sql in cross-domain databases. Computational Linguistics, 470 (2):0 309–332, 2021. our card
- Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, et al. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021. our card
- Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. our card
- Li Dong and Mirella Lapata. Language to logical form with neural attention. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 33–43, 2016. our card
- Yujian Gan, Xinyun Chen, Jinxia Xie, Matthew Purver, John R Woodward, John Drake, and Qiaofu Zhang. Natural sql: Making sql easier to infer from natural language specifications. arXiv preprint arXiv:2109.05153, 2021. OpenAlex ↗ · Scholar ↗
- Alex Graves and Alex Graves. Long short-term memory. Supervised sequence labelling with recurrent neural networks, pages 37–45, 2012. OpenAlex ↗ · Scholar ↗
- Jiaqi Guo, Zecheng Zhan, Yan Gao, Yan Xiao, Jian-Guang Lou, Ting Liu, and Dongmei Zhang. Towards complex text-to-sql in cross-domain database with intermediate representation. arXiv preprint arXiv:1905.08205, 2019. our card
- Zhixin Guo, Minyxuan Yan, Jiexing Qi, Jianping Zhou, Ziwei He, Zhouhan Lin, Guanjie Zheng, and Xinbing Wang. Few-shot table-to-text generation with prompt planning and knowledge memorization. arXiv preprint arXiv:2302.04415, 2023. OpenAlex ↗ · Scholar ↗
- Jonathan Herzig, Paweł Krzysztof Nowak, Thomas Müller, Francesco Piccinno, and Julian Martin Eisenschlos. Tapas: Weakly supervised table parsing via pre-training. arXiv preprint arXiv:2004.02349, 2020. our card
- Junyang Huang, Yongbo Wang, Yongliang Wang, Yang Dong, and Yanghua Xiao. Relation aware semi-autoregressive semantic parsing for nl2sql. arXiv preprint arXiv:2108.00804, 2021. OpenAlex ↗ · Scholar ↗
- Binyuan Hui, Xiang Shi, Ruiying Geng, Binhua Li, Yongbin Li, Jian Sun, and Xiaodan Zhu. Improving text-to-sql with schema dependency learning. arXiv preprint arXiv:2103.04399, 2021. OpenAlex ↗ · Scholar ↗
- Wonseok Hwang, Jinyeong Yim, Seunghyun Park, and Minjoon Seo. A comprehensive exploration on wikisql with table-aware word contextualization. arXiv preprint arXiv:1902.01069, 2019. our card
- Rohit Kate. Transforming meaning representation grammars to improve semantic parsing. In CoNLL 2008: Proceedings of the Twelfth Conference on Computational Natural Language Learning, pages 33–40, 2008. OpenAlex ↗ · Scholar ↗
- Tushar Khot, Harsh Trivedi, Matthew Finlayson, Yao Fu, Kyle Richardson, Peter Clark, and Ashish Sabharwal. Decomposed prompting: A modular approach for solving complex tasks. arXiv preprint arXiv:2210.02406, 2022. our card
- Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. Large language models are zero-shot reasoners. arXiv preprint arXiv:2205.11916, 2022. our card
- Brenden Lake and Marco Baroni. Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. In International conference on machine learning, pages 2873–2882. PMLR, 2018. OpenAlex ↗ · Scholar ↗
- Wenqiang Lei, Weixin Wang, Zhixin Ma, Tian Gan, Wei Lu, Min-Yen Kan, and Tat-Seng Chua. Re-examining the role of schema linking in text-to-sql. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6943–6954, 2020. OpenAlex ↗ · Scholar ↗
- Fei Li and Hosagrahar V Jagadish. Constructing an interactive natural language interface for relational databases. Proceedings of the VLDB Endowment, 80 (1):0 73–84, 2014. OpenAlex ↗ · Scholar ↗
- Haoyang Li, Jing Zhang, Cuiping Li, and Hong Chen. Decoupling the skeleton parsing and schema linking for text-to-sql. arXiv preprint arXiv:2302.05965, 2023a. OpenAlex ↗ · Scholar ↗
- Jinyang Li, Binyuan Hui, Reynold Cheng, Bowen Qin, Chenhao Ma, Nan Huo, Fei Huang, Wenyu Du, Luo Si, and Yongbin Li. Graphix-t5: Mixing pre-trained transformers with graph-aware layers for text-to-sql parsing. arXiv preprint arXiv:2301.07507, 2023b. OpenAlex ↗ · Scholar ↗
- Jinyang Li, Binyuan Hui, Ge Qu, Binhua Li, Jiaxi Yang, Bowen Li, Bailin Wang, Bowen Qin, Rongyu Cao, Ruiying Geng, Nan Huo, Chenhao Ma, Kevin C. C. Chang, Fei Huang, Reynold Cheng, and Yongbin Li. Can llm already serve as a database interface? a big bench for large-scale database grounded text-to-sqls, 2023c. our card
- Yunyao Li, Huahai Yang, and HV Jagadish. Nalix: A generic natural language search environment for xml data. ACM Transactions on database systems (TODS), 320 (4):0 30–es, 2007. OpenAlex ↗ · Scholar ↗
- Aiwei Liu, Xuming Hu, Lijie Wen, and Philip S Yu. A comprehensive evaluation of chatgpt's zero-shot text-to-sql capability. arXiv preprint arXiv:2303.13547, 2023a. our card
- Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing. ACM Computing Surveys, 550 (9):0 1–35, 2023b. our card
- Ana-Maria Popescu, Oren Etzioni, and Henry Kautz. Towards a theory of natural language interfaces to databases. In Proceedings of the 8th international conference on Intelligent user interfaces, pages 149–157, 2003. OpenAlex ↗ · Scholar ↗
- Ana-Maria Popescu, Alex Armanasu, Oren Etzioni, David Ko, and Alexander Yates. Modern natural language interfaces to databases: Composing statistical parsing with semantic tractability. In COLING 2004: Proceedings of the 20th International Conference on Computational Linguistics, pages 141–147, 2004. OpenAlex ↗ · Scholar ↗
- Jiexing Qi, Jingyao Tang, Ziwei He, Xiangpeng Wan, Chenghu Zhou, Xinbing Wang, Quanshi Zhang, and Zhouhan Lin. Rasat: Integrating relational structures into pretrained seq2seq model for text-to-sql. arXiv preprint arXiv:2205.06983, 2022. OpenAlex ↗ · Scholar ↗
- Bowen Qin, Binyuan Hui, Lihan Wang, Min Yang, Jinyang Li, Binhua Li, Ruiying Geng, Rongyu Cao, Jian Sun, Luo Si, et al. A survey on text-to-sql parsing: Concepts, methods, and future directions. arXiv preprint arXiv:2208.13629, 2022. OpenAlex ↗ · Scholar ↗
- Nitarshan Rajkumar, Raymond Li, and Dzmitry Bahdanau. Evaluating the text-to-sql capabilities of large language models. arXiv preprint arXiv:2204.00498, 2022. our card
- Ohad Rubin and Jonathan Berant. Smbop: Semi-autoregressive bottom-up semantic parsing. arXiv preprint arXiv:2010.12412, 2020. OpenAlex ↗ · Scholar ↗
- Torsten Scholak, Nathan Schucher, and Dzmitry Bahdanau. Picard: Parsing incrementally for constrained auto-regressive decoding from language models. arXiv preprint arXiv:2109.05093, 2021. OpenAlex ↗ · Scholar ↗
- Niculae Stratica, Leila Kosseim, and Bipin C Desai. Using semantic templates for a natural language interface to the cindi virtual library. Data & Knowledge Engineering, 550 (1):0 4–19, 2005. OpenAlex ↗ · Scholar ↗
- Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. Advances in neural information processing systems, 27, 2014. our card
- Bailin Wang, Richard Shin, Xiaodong Liu, Oleksandr Polozov, and Matthew Richardson. Rat-sql: Relation-aware schema encoding and linking for text-to-sql parsers. arXiv preprint arXiv:1911.04942, 2019. our card
- Jason Wei, Maarten Bosma, Vincent Y Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M Dai, and Quoc V Le. Finetuned language models are zero-shot learners. arXiv preprint arXiv:2109.01652, 2021. our card
- Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, et al. Emergent abilities of large language models. arXiv preprint arXiv:2206.07682, 2022a. our card
- Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Quoc Le, and Denny Zhou. Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11903, 2022b. our card
- Xiaojun Xu, Chang Liu, and Dawn Song. Sqlnet: Generating structured queries from natural language without reinforcement learning. arXiv preprint arXiv:1711.04436, 2017. our card
- Kuan Xuan, Yongbo Wang, Yongliang Wang, Zujie Wen, and Yang Dong. Sead: end-to-end text-to-sql generation with schema-aware denoising. arXiv preprint arXiv:2105.07911, 2021. OpenAlex ↗ · Scholar ↗
- Pengcheng Yin, Graham Neubig, Wen-tau Yih, and Sebastian Riedel. Tabert: Pretraining for joint understanding of textual and tabular data. arXiv preprint arXiv:2005.08314, 2020. our card
- Tao Yu, Rui Zhang, Kai Yang, Michihiro Yasunaga, Dongxu Wang, Zifan Li, James Ma, Irene Li, Qingning Yao, Shanelle Roman, et al. Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql task. arXiv preprint arXiv:1809.08887, 2018. our card
- Tao Yu, Chien-Sheng Wu, Xi Victoria Lin, Bailin Wang, Yi Chern Tan, Xinyi Yang, Dragomir Radev, Richard Socher, and Caiming Xiong. Grappa: Grammar-augmented pre-training for table semantic parsing. arXiv preprint arXiv:2009.13845, 2020. OpenAlex ↗ · Scholar ↗
- Lu Zeng, Sree Hari Krishnan Parthasarathi, and Dilek Hakkani-Tur. N-best hypotheses reranking for text-to-sql systems. arXiv preprint arXiv:2210.10668, 2022. OpenAlex ↗ · Scholar ↗
- Zhuosheng Zhang, Aston Zhang, Mu Li, and Alex Smola. Automatic chain of thought prompting in large language models. arXiv preprint arXiv:2210.03493, 2022. our card
- Yiyun Zhao, Jiarong Jiang, Yiqun Hu, Wuwei Lan, Henry Zhu, Anuj Chauhan, Alexander Li, Lin Pan, Jun Wang, Chung-Wei Hang, et al. Importance of synthesizing high-quality data for text-to-sql parsing. arXiv preprint arXiv:2212.08785, 2022. OpenAlex ↗ · Scholar ↗
- Ruiqi Zhong, Tao Yu, and Dan Klein. Semantic evaluation for text-to-sql with distilled test suite. In The 2020 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, 2020. OpenAlex ↗ · Scholar ↗
- Victor Zhong, Caiming Xiong, and Richard Socher. Seq2sql: Generating structured queries from natural language using reinforcement learning. arXiv preprint arXiv:1709.00103, 2017. our card
- Denny Zhou, Nathanael Schärli, Le Hou, Jason Wei, Nathan Scales, Xuezhi Wang, Dale Schuurmans, Olivier Bousquet, Quoc Le, and Ed Chi. Least-to-most prompting enables complex reasoning in large language models. arXiv preprint arXiv:2205.10625, 2022. our card
This page in Markdown https://md.research.elamur.ai/free/en/papers/pourreza-2023-din-sql-decomposed-context-learning/