LLMs have advanced text-to-SQL generation, yet monolithic architectures struggle with complex reasoning and schema diversity. We propose AGENTIQL, an agent-inspired multi-expert framework that combines a reasoning agent for question decomposition, a coding agent for sub-query generation, and a refinement step for column selection. An adaptive router further balances efficiency and accuracy by selecting between our modular pipeline and a baseline parser. Several steps in the pipeline can be executed in parallel, making the framework scalable to larger workloads. Evaluated on the Spider benchmark, AGENTIQL improves execution accuracy and interpretability and achieves up to 86.07% EX with 14B models using the Planner&Executor merging strategy. The attained performance is contingent upon the efficacy of the routing mechanism, thereby narrowing the gap to GPT-4-based SOTA (89.65% EX) while using much smaller open-source LLMs. Beyond accuracy, AGENTIQL enhances transparency by exposing intermediate reasoning steps, offering a robust, scalable, and interpretable approach to semantic parsing.
翻译:大型语言模型(LLMs)推动了文本到SQL生成的发展,但单一架构在处理复杂推理和多样化的数据库模式时仍面临挑战。本文提出AGENTIQL,一种受智能体启发的多专家框架,它结合了用于问题分解的推理智能体、用于子查询生成的编码智能体,以及用于列选择的优化步骤。一个自适应路由器通过在我们的模块化流程与基线解析器之间进行选择,进一步平衡了效率与准确性。流程中的多个步骤可以并行执行,使得该框架能够扩展到更大的工作负载。在Spider基准测试上的评估表明,AGENTIQL提升了执行准确性和可解释性,在使用Planner&Executor合并策略的140亿参数模型上实现了高达86.07%的执行准确率(EX)。所达到的性能取决于路由机制的有效性,从而在使用规模小得多的开源LLMs的同时,缩小了与基于GPT-4的最先进方法(89.65% EX)的差距。除了准确性之外,AGENTIQL通过暴露中间推理步骤增强了透明度,为语义解析提供了一种鲁棒、可扩展且可解释的途径。