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
Abstract
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.- Anthology ID:
- 2026.findings-acl.237
- Volume:
- Findings of the Association for Computational Linguistics: ACL 2026
- Month:
- July
- Year:
- 2026
- Address:
- San Diego, California, United States
- Editors:
- Maria Liakata, Viviane P. Moreira, Jiajun Zhang, David Jurgens
- Venue:
- Findings
- SIG:
- Publisher:
- Association for Computational Linguistics
- Note:
- Pages:
- 4827–4847
- Language:
- URL:
- https://preview.aclanthology.org/ingest-acl/2026.findings-acl.237/
- DOI:
- Cite (ACL):
- Meng Zhang, Ruochun Jin, Yuanxi Peng, Wenjing Yang, Haotian Wang, Liting Sun, Kun Hu, Silin Yang, and Zhang Ke-di. 2026. CORES: Code-Oriented Reasoning for Complex Text-to-SQL and Generalizable TableQA. In Findings of the Association for Computational Linguistics: ACL 2026, pages 4827–4847, San Diego, California, United States. Association for Computational Linguistics.
- Cite (Informal):
- CORES: Code-Oriented Reasoning for Complex Text-to-SQL and Generalizable TableQA (Zhang et al., Findings 2026)
- PDF:
- https://preview.aclanthology.org/ingest-acl/2026.findings-acl.237.pdf