Exécution de notre outil de synthèse sur un nouvel article
Vérifiez l’article ci-dessous, puis lancez sa synthèse.
A robust natural language text-to-SQL generation framework with dynamic strategies based on LLMs
Xiaodong Su (State Grid Jiangsu Electric Power (China)), Yang Gu (State Grid Jiangsu Electric Power (China)), Peng Wang (State Grid Jiangsu Electric Power (China)), Wei Gu (State Grid Jiangsu Electric Power (China)), Lincheng Qi, Jingwei He
Résumé : Natural language text-to-SQL generation (Text2SQL) aims to translate natural language questions into executable SQL queries. Although the emergence of large language models (LLMs) has led to significant advancements in this field, their performance degrades sharply with question complexity increases. A key limitation of current LLM-based methods lies in their uniform generation strategies, which fail to adapt dynamically to varying question complexity. To address this issue, we propose TriSQL, a novel three-stage framework designed to analyze question complexity and generate accurate and executable SQL. First, a Question-Guided Schema Selector is conceived to get the most relevant schema to the question using cross attention. Second, a Structure-Aware SQL Generator takes both the question and the selected schema as input, employing hierarchical decoding to generate a syntactically valid initial SQL. Finally, a Complexity-Aware SQL Refiner is designed with LLM to dynamically adjust strategies corresponding to the complexity of question and initial SQL, ensuring that the final generated SQL is both accurate and executable. Experimental results on the Spider benchmark and its variants show that TriSQL achieves state-of-the-art execution accuracy, surpasses existing LLM-based methods, and provides both high efficiency and strong robustness.