Recent advancements in large language models (LLMs) have markedly enhanced SQL generation. Nevertheless, existing approaches typically generate SQL queries without considering their diversity. In addition, current methods often encounter challenges in selecting the optimal SQL from multiple candidates. To mitigate these limitations, this study presents MPCR-SQL, which synergistically combines two key modules: (1) A Multi-Path SQL Generation module is designed to produce a broader spectrum of SQL queries by leveraging multiple models and prompts. (2) A Collective SQL Refinement module aims to identify the SQL most closely aligning with user intent through the aggregation of SQL candidates. Extensive experiments on multiple datasets substantiate the efficacy of MPCR-SQL in enhancing SQL generation.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

MPCR-SQL: Enhancing SQL Generation by Multi-path SQL Generation and Collective SQL Refinement

  • Min Hou,
  • Yiming Huang,
  • Shaopeng Wang

摘要

Recent advancements in large language models (LLMs) have markedly enhanced SQL generation. Nevertheless, existing approaches typically generate SQL queries without considering their diversity. In addition, current methods often encounter challenges in selecting the optimal SQL from multiple candidates. To mitigate these limitations, this study presents MPCR-SQL, which synergistically combines two key modules: (1) A Multi-Path SQL Generation module is designed to produce a broader spectrum of SQL queries by leveraging multiple models and prompts. (2) A Collective SQL Refinement module aims to identify the SQL most closely aligning with user intent through the aggregation of SQL candidates. Extensive experiments on multiple datasets substantiate the efficacy of MPCR-SQL in enhancing SQL generation.