Skip to main content Skip to main navigation

Publication

HLR-SQL: Human-Like Reasoning for Text-to-SQL

Timo Eckmann; Matthias Urban; Jan-Micha Bodensohn; Carsten Binnig
In: Novel Optimizations for Visionary AI Systems Workshop at SIGMOD 2025. Novel Optimizations for Visionary AI Systems Workshop (NOVAS), located at SIGMOD 2025, June 22, SIGMOD, 2025.

Abstract

Recent LLM-based approaches have achieved impressive results on Text-to-SQL benchmarks such as Spider and Bird. However, a key limitation of these benchmarks is that their queries do not reflect the complexity typically seen in real-world enterprise scenarios. In this paper, we introduce HLR-SQL, a new approach designed to handle such complex enterprise SQL queries. Unlike existing methods, HLR-SQL imitates Human-Like Reasoning with LLMs by incrementally composing queries through a sequence of intermediate steps, gradually building up to the full query. We evaluate HLR-SQL on a newly constructed benchmark, Spider-HJ, which systematically increases query complexity by splitting tables in the original Spider dataset to raise the average join count needed by queries. Our experiments show that state-of-the-art models experience up to a 70% drop in execution accuracy on Spider-HJ, while HLR-SQL achieves a 9.51% improvement over the best existing approaches on the Spider leaderboard.