让AI自动生成代码来推理表格和知识图谱中的复杂问题。
CRAFTQA: A Code-Driven Adaptive Framework for Complex Structured Data Reasoning

- 用可执行的Python代码序列分步推理问题
- 能动态生成新函数,突破预设操作限制
- 适合需要深度结构化数据推理的任务
真实场景中存在大量异构结构化数据(如表格、知识图谱),对这类数据的有效推理日益重要。统一结构化数据问答已成为研究热点,旨在用单一框架回答跨类型结构化数据的自然语言问题。然而现有方法普遍依赖预定义函数集,难以处理超出这些操作的复杂推理。为此,我们提出CRAFTQA,一种新型自适应代码驱动框架,包含CodeSTEP和CRAFT两个核心模块。CodeSTEP模块生成完整的可执行Python代码序列,基于问题进行分步代码推理。CRAFT模块则动态生成超出预设函数集的操作函数,并与CodeSTEP无缝集成,显著提升复杂推理灵活性。在多个结构化数据集上的全面实验表明,相比现有统一方法,CRAFTQA在复杂推理场景中取得显著提升。
原文摘要 · Abstract (English)
Real-world scenarios involve massive heterogeneous structured data (e.g., tables, knowledge graphs), making effective reasoning over such diverse data increasingly important. Unified structured data question answering has emerged as a prominent research trend, aiming to answer natural language questions across different structured data types within a single framework. However, existing unified methods share a common limitation: they rely on a set of predefined functions, which restricts their ability to perform complex reasoning beyond these predefined operations. To overcome this fundamental limitation, we propose CRAFTQA, a novel adaptive code-driven framework comprising two core modules, CodeSTEP and CRAFT. The CodeSTEP module is a paradigm that generates a complete executable Python code sequence, which contains step-by-step code-based reasoning operations based on the question. The CRAFT module dynamically generates custom code functions for operations beyond the predefined function set, and seamlessly integrates with CodeSTEP to significantly enhance flexibility in handling complex reasoning. Comprehensive experiments on multiple structured datasets demonstrate that CRAFTQA achieves remarkable improvements in complex reasoning scenarios compared to existing unified methods.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。