← 返回论文检索
ACL 2026aclfindings

CORES: Code-Oriented Reasoning for Complex Text-to-SQL and Generalizable TableQA

Meng Zhang, Ruochun Jin, Yuanxi Peng, Wenjing Yang, Haotian Wang, Liting Sun, Kun Hu, Silin Yang, Zhang Ke-di

National University of Defense Technology · Peking University

PDF 由论文原始站点提供,PaperCompass 不保存论文文件。DOI 10.18653/v1/2026.findings-acl.237 ↗

摘要

Text-to-SQL aims to bridge the gap between human intent and relational databases. While LLMs have shown proficiency in generating simple SQL queries, they struggle with complex analytical tasks. Moreover, models fine-tuned on SQL generation often suffer from catastrophic forgetting, which lose the versatility of procedural reasoning and pertaining to generation constraints. Inspired by the usage of high-resource programming languages as LLM reasoning intermediaries, we propose CORES model, which leverages Python as a procedural reasoning pivot to enhance both complex SQL generation and tabular reasoning. It decomposes complex queries into Python reasoning traces before generating the final SQL, which bridges the gap between procedural reasoning and declarative expression. In order to internalize this reasoning capability, we fine-tune LLMs via GRPO with tailored process reward functions that mitigate the sparse feedback problem. We experimentally verify the effectiveness of CORES on six text-to-SQL benchmarks, where ours outperforms baselines by 6.44% on average, while maintains good capability on three tableQA benchmarks.