arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.09295cs.CL
收藏

LEAF-SQL: 基于分层探索与自适应细化的文本到SQL骨架预测

LEAF-SQL: Level-wise Exploration with Adaptive Fine-graining for Text-to-SQL Skeleton Prediction

School of Computing(计算学院);Artificial Intelligence(人工智能);Jiangxi University of Finance(江西财经大学)

Zhao Tan, Xiping Liu, Qing Shu, Qizhi Wan, Dexi Liu, Changxuan Wan

AI总结:

LEAF-SQL通过分层探索与自适应细化方法,提升复杂SQL生成性能,实验表明其在BIRD基准测试中表现优异。

摘要:

文本到SQL将自然语言问题转化为可执行的SQL查询,使非专家能直观访问数据库。尽管大语言模型在文本到SQL任务中表现优异,但仍然难以处理涉及深层嵌套逻辑或多个子句的复杂查询。一种常用方法是使用SQL骨架——查询逻辑的中间表示形式——来简化生成,但现有方法受限于单一结构假设和缺乏逐步推理。为克服这些限制,我们提出LEAF-SQL,一种新的框架,将骨架预测重新定义为粗到细的树搜索过程。LEAF-SQL通过自适应细化系统探索多样化的结构假设。关键技术包括:(1)三级骨架层次结构以引导搜索,(2)骨架生成代理生成多样化候选方案,(3)骨架评估代理高效剪枝搜索空间。这种集成设计产生结构多样且粒度适应的骨架候选方案,为SQL生成提供更稳固的基础。大量实验表明,LEAF-SQL在各种LLM基础架构上均提升了性能。在挑战性的BIRD基准测试的官方隐藏测试集上,我们的方法实现了71.6的执行准确率,优于领先的搜索和骨架方法,证明其在复杂查询中的有效性。

英文摘要:

Text-to-SQL translates natural language questions into executable SQL queries, enabling intuitive database access for non-experts. While large language models achieve strong performance on Text-to-SQL with prompting, they still struggle with complex queries that involve deeply nested logic or multiple clauses. A widely used approach employs SQL skeletons--intermediate representations of query logic--to streamline generation, but existing methods are limited by their reliance on a single structural hypothesis and lack of progressive reasoning. To overcome these limitations, we propose LEAF-SQL, a novel framework that reframes skeleton prediction as a coarse-to-fine tree search process. LEAF-SQL enables systematic exploration of diverse structural hypotheses with adaptive refinement. Several key techniques are employed in LEAF-SQL: (1) a three-level skeleton hierarchy to guide the search, (2) a Skeleton Formulation Agent to generate diverse candidates, and (3) a Skeleton Evaluation Agent to efficiently prune the search space. This integrated design yields skeleton candidates that are both structurally diverse and granularity-adaptive, providing a stronger foundation for the SQL generation. Extensive experiments show that LEAF-SQL consistently improves the performance of various LLM backbones. On the official hidden test set of the challenging BIRD benchmark, our method achieves 71.6 execution accuracy, which outperforms leading search-based and skeleton-based methods, affirming its effectiveness for complex queries.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑