TL;DR
This paper introduces Ar-SParC, the very first Arabic cross-domain, context-dependent text-to-SQL dataset, bridging a major gap in multilingual conversational database querying. Alongside this benchmark, the authors propose GAT Corrector, a novel prompt engineering technique that detects and fixes SQL generation errors in a single step, significantly boosting execution and interaction accuracy while reducing computational overhead.
What Problem Does This Paper Address?
While text-to-SQL systems have advanced rapidly, most research focuses on context-independent queries (single, isolated questions). In real-world scenarios, however, humans naturally interact with databases through multi-turn conversations where subsequent questions depend heavily on previous context.
While context-dependent datasets exist for English (like SParC and CoSQL) and Chinese, the Arabic language has been entirely overlooked for this task. Arabic presents unique linguistic challenges, and the lack of standardized conversational benchmarks hinders the development of effective localized models. Furthermore, existing state-of-the-art error-correction pipelines (like the GAT Verifier) require multiple iterative LLM calls, introducing high latency and cost.
Methods
The authors systematically evaluated 10 different prompt engineering techniques across two large language models (GPT-3.5-turbo and GPT-4.5-turbo). These techniques were split into two categories:
- Question Representation Methods: Basic Prompt (BSp), Text Representation Prompt (TRp), Code Representation Prompt (CRp), and OpenAI Demonstration Prompt (ODp).
- In-Context Learning Selection Methods: Random, Question Similarity (QTSs), Masked Question Similarity (MQSs), Query Similarity (QRSs), DAIL Selection (DAILs), and GAT Reviser (GATr).
The Novel Approach: GAT Corrector (GATc)
To improve upon the baseline pipelines, the authors developed the GAT Corrector. Traditional verification methods use a multi-step loop: an LLM generates SQL, a verifier checks it (returning True/False + explanation), and if it's false, the LLM regenerates the query.
GAT Corrector collapses this process into a single step. It takes the database schema, target question, and predicted SQL as input, and directly outputs the finalized SQL query—either repeating it if correct or fixing it inline if incorrect. To achieve this, the authors fine-tuned GPT-3.5-turbo on a custom dataset of 500 carefully curated samples (250 correct and 250 flawed SQL pairs).
Datasets
The primary contribution of this work is Ar-SParC, an Arabic adaptation of the English SParC dataset.
- Size: 3,450 sequences of interrelated questions, totaling 10,225 individual question-SQL pairs.
- Diversity: Covers 160 databases across 116 distinct domains.
- Structure: Each sequence contains an average of three context-dependent questions.
- Curation Pipeline: Initial machine translation via GPT-4.5-turbo, followed by rigorous post-editing by two professional native Arabic translators, and a final validation phase by three computer science graduate students to ensure exact alignment with the target SQL queries.
Key Insights and Ideas
- The Generative Correction Advantage: An ablation study revealed that fine-tuning a model simply to classify queries as correct/incorrect (like GAT Verifier) performs poorly in Arabic (failing 33 out of 100 times). Forcing the model to generatively correct the code provides a stronger training signal, dropping the error rate to just 3%.
- The Arabic LLM Capability Gap: The performance gap between GPT-3.5-turbo and GPT-4.5-turbo is significantly wider when processing Arabic compared to English. In zero-shot Arabic settings, GPT-4.5-turbo outperformed GPT-3.5-turbo by ~7.38% in execution accuracy, highlighting that lower-tier models still struggle substantially with complex Arabic prompt comprehension.
- Prompt Structure Matters: The OpenAI Demonstration Prompt (ODp) consistently yielded the best zero-shot performance. Restricting the model from generating conversational filler or explanations allows it to focus purely on valid SQL syntax.
Key Results
The authors evaluated performance using two metrics: Execution Accuracy (EX) (percentage of individual questions answered correctly) and Interaction Accuracy (IX) (percentage of entire question sequences answered correctly).
- Zero-Shot Improvements: Applying the GAT Corrector across all 8 zero-shot experiment configurations yielded an average absolute improvement of 1.9% EX and 1.9% IX.
- In-Context Learning Improvements: Across 12 few-shot configurations, GAT Corrector enhanced performance by an average of 1.72% EX and 0.92% IX.
- Peak Performance: The highest overall accuracy was achieved by combining the GAT Reviser with GPT-4.5-turbo, reaching 72.5% EX and 52.9% IX under in-context learning settings.
Limitations and Future Work
- Context Window Constraints: Due to the 4,096-token limit of GPT-3.5-turbo, the authors restricted in-context learning to a maximum of 3 shots to ensure fair evaluation across models. This prevents exploring whether denser, many-shot prompts could further boost conversational tracking.
- Language Scope: While this work successfully addresses Arabic, the authors emphasize a broader systemic need to expand context-dependent text-to-SQL frameworks to other underrepresented, low-resource languages.
Summary updated