用动态计划融合SQL与大模型,提升表格问答准确性
Weaver: Interweaving SQL and LLM for Table Reasoning
- 设计可动态拆解任务的模块化流程,灵活结合SQL与LLM
- 在4个数据集上超越现有方法,减少错误率与调用次数
- 适合需要复杂语义推理的表格问答场景
使用非结构化数据(如文本或图像)查询表格具有挑战性,因为传统SQL难以处理此类内容,尤其在需要语义推理的任务中。尽管大语言模型(LLM)擅长理解上下文,但其对长输入序列存在限制。现有结合SQL与LLM的方法通常依赖固定预设流程,难以适应复杂查询。为此,我们提出Weaver,一种用于表格问答(TableQA)的模块化动态集成框架。Weaver通过生成灵活的分步计划,将SQL用于结构化数据检索,同时利用LLM进行语义处理。通过将复杂查询分解为可管理的子任务,Weaver提升了准确性和泛化能力。实验表明,Weaver在四个TableQA数据集上持续优于当前最优方法,显著降低API调用次数和错误率。代码及相关脚本已开源:https://coral-lab-asu.github.io/weaver。
原文摘要 · Abstract (English)
Querying tables with unstructured data is challenging due to the presence of text (or image), either embedded in the table or in external paragraphs, which traditional SQL struggles to process, especially for tasks requiring semantic reasoning. While Large Language Models (LLMs) excel at understanding context, they face limitations with long input sequences. Existing approaches that combine SQL and LLMs typically rely on rigid, predefined work-flows, limiting their adaptability to complex queries. To address these issues, we introduce Weaver , a modular pipeline that dynamically integrates SQL and LLMs for table-based question answering (TableQA). Weaver generates a flexible, step-by-step plan that combines SQL for structured data retrieval with LLMs for semantic processing. By decomposing complex queries into manageable subtasks, Weaver improves accuracy and generalization. Our experiments show that Weaver consistently outperforms state-of-the-art methods across four TableQA datasets, reducing both API calls and error rates. The code, along with other associated scripts, are available at https://coral-lab-asu.github.io/weaver.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。