CRAFTQA: A Code-Driven Adaptive Framework for Complex Structured Data Reasoning
2026-06-01 • Computation and Language
Computation and Language
AI summaryⓘ
The authors address the challenge of answering questions from different types of structured data like tables and knowledge graphs using one system. They point out that existing methods can only perform a limited set of preset operations, which restricts complex reasoning. To fix this, the authors propose CRAFTQA, which creates and runs Python code to solve questions step-by-step and can even make new code functions on the fly for harder reasoning tasks. Tests show their approach improves performance on difficult questions compared to earlier methods.
structured dataquestion answeringknowledge graphsPython code generationcomplex reasoningcode executionadaptive functionsunified frameworkstep-by-step reasoningdynamic code
Authors
Chengtao Gan, Zhiqiang Liu, Long Jin, Yushan Zhu, Lei Liang, Wen Zhang
Abstract
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.