[Paper Review] MCI-SQL: Text-to-SQL with Metadata-Complete Context and Intermediate Correction
MCI-SQL introduces metadata-complete context for columns and an intermediate SQL correction mechanism to improve Text-to-SQL accuracy, achieving state-of-the-art execution accuracy on the BIRD benchmark.
Text-to-SQL aims to translate natural language queries into SQL statements. Existing methods typically follow a pipeline of pre-processing, schema linking, candidate SQL generation, SQL alignment, and target SQL selection. However, these methods face significant challenges. First, they often struggle with column filtering during schema linking due to difficulties in comprehending raw metadata. Also, the candidate SQL generation process often suffers from reasoning errors, which limits accuracy improvements. To address these limitations, we propose a framework, called MCI-SQL, to efficiently and precisely generate SQL queries. Specifically, we assign metadata-complete contexts to each column, which significantly improves the accuracy of column filtering for schema linking. Also, for candidate SQL generation, we propose an intermediate correction mechanism that validates SQL queries and revises errors in a timely way. Moreover, we also propose effective optimizations in subsequent SQL alignment and selection phases, which further enhance the performance. Experiments on the widely-used BIRD benchmark show that MCI-SQL achieves execution accuracy of 74.45% on the development set and 76.41% on the test set, surpassing current published state-of-the-art results. In addition, we manually identify and correct 412 samples in the BIRD dataset, forming a new version named BIRD-clear, which is released together with our code on GitHub. We also evaluate our methods on BIRD-clear and find that MCI-SQL outperforms baselines by 8.47 percentage points in execution accuracy, further demonstrating the effectiveness and reliability of our framework.
Motivation & Objective
- Bridge the gap between LLMs and databases by enriching metadata for precise column filtering.
- Integrate an intermediate correction mechanism to validate and revise SQL during generation.
- Optimize SQL alignment and candidate generation to enhance final execution accuracy.
- Demonstrate superior performance on the BIRD benchmark and release a corrected BIRD-clear dataset.
Proposed method
- Construct metadata-complete contexts by aggregating column-, inter-column-, and table-level metadata into natural language descriptions.
- Perform SQL-driven schema linking to selectively identify relevant columns using an initial draft SQL.
- Use an intermediate correction mechanism that validates and revises subqueries with execution feedback.
- Apply adaptive prompt chaining to maintain structured reasoning during SQL generation.
- Implement rule-guided SQL alignment to ensure consistency across phases (function and output alignment).
- Generate multi-granular metadata-based candidate SQLs and use majority voting on execution results to select final SQL.

Experimental results
Research questions
- RQ1Can metadata-complete context improve column filtering and schema linking accuracy in Text2SQL?
- RQ2Does integrating intermediate correction during SQL generation increase execution accuracy and reduction of errors?
- RQ3How do multi-granular metadata and alignment strategies affect final SQL quality and efficiency?
- RQ4What is the impact of MCI-SQL on challenging real-world datasets like BIRD?
- RQ5Does correcting dataset annotations (BIRD-clear) influence measured performance?
Key findings
- MCI-SQL achieves 74.45% execution accuracy on the BIRD development set.
- MCI-SQL achieves 76.41% execution accuracy on the BIRD test set.
- MCI-SQL outperforms state-of-the-art methods on BIRD and shows improved single-SQL generation accuracy.
- A manually corrected BIRD-clear version of the dataset was released to better reflect model capabilities.
- Using metadata-complete context and intermediate correction leads to higher success in error resolution during SQL generation.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.