PulseExploreJournal ClubDebatesTrendingResearchersJournals
Instagram
HomeExploreJournal ClubTrending
Synapse
⌘+K
Synapse
April 17, 2026Scientific Reports0 citationsOpen Access

Dynamic-SQL: an adaptive NL2SQL framework with multi-path fusion reasoning and execution feedback correction

HHHongbin HaoXZXin ZhengXYXuhong Yu

Key Points

  • The study aims to improve the performance of NL2SQL systems when faced with practical constraints in complex databases.
  • Developed the Dynamic-SQL framework incorporating multi-path reasoning and execution feedback correction.
  • Constructed a hybrid vector space for dynamic retrieval of schema elements.
  • Leveraged a large language model (LLM) to generate schema subgraphs and enrich prompts with examples.
  • Produced multiple candidate SQL statements through diverse reasoning paths and fused their thought chains.
  • Reduced average prompt length by 50.83%.
  • Increased strict schema-linking recall from 72.63% to 90.66%.
  • Achieved 63.23% execution accuracy in complex database querying.

Abstract

Abstract Current NL2SQL systems degrade sharply when confronted with practical constraints such as limited prompt length and the inability to fine-tune large language models (LLMs). Performance drop is especially pronounced in complex databases, where inaccurate schema linking, vague value conditions, and weak self-correction dominate the error surface. We propose Dynamic-SQL, an adaptive framework that couples multi-path chain-of-thought fusion with execution-based feedback correction. A dense–sparse hybrid vector space is first constructed to dynamically retrieve relevant schema elements, and an LLM is leveraged to generate an explicit schema subgraph. Real-value and few-shot exemplars are then injected to enrich the prompt and sharpen value conditioning. Multiple candidate SQL statements are produced via diverse reasoning paths; their chains of thought are fused to cover latent semantic interpretations, and execution feedback is exploited for iterative self-correction until convergence. On the BIRD benchmark, Dynamic-SQL, powered by the open source qwen2.5-coder-32b-instruct, reduces the average prompt length by 50.83% , raises strict schema-linking recall from 72.63% to 90.66% , and achieves 63.23% execution accuracy. By systematically addressing schema linking, exemplar augmentation, multi-path fusion reasoning, and self-correction, the framework offers a transferable paradigm for deploying LLMs in complex database querying scenarios.

Ask AI
Helpful
Bookmark
Share
View Full Paper

Cite This Study

Hao et al. (2026) studied this question.

synapsesocial.com/papers/69e1cf985cdc762e9d8588afhttps://doi.org/10.1038/s41598-026-47693-2
Ask AI
Helpful
Bookmark
Share
View Full Paper