TL;DR
FloodSQL-Bench is a new, high-stakes benchmark designed to evaluate how well Large Language Models (LLMs) can translate natural language into complex, geospatially-grounded SQL queries. By focusing on the flood management domain, it challenges models to perform multi-table reasoning and spatial joins—tasks where even the most advanced current models show significant performance degradation.
What Problem Does This Paper Address?
The field of "Text-to-SQL"—turning a question like "Which hospitals are in a flood zone?" into executable code—has seen massive growth. However, most existing benchmarks (like Spider or BIRD) are "open-domain" and relatively simple. They often focus on single-table lookups or basic key-based joins.
In the real world, specifically in disaster management, data is messy and multi-layered. To assess flood risk, a practitioner needs to join demographic data (census tracts) with physical hazard data (floodplain polygons) and infrastructure records (hospital locations). This requires spatial reasoning—joining tables based on geographic coordinates or overlapping shapes rather than just ID numbers. The authors argue that current benchmarks fail to capture this complexity, leaving a gap in our understanding of how AI performs in high-stakes, domain-specific environments.
Methods
The researchers developed FloodSQL-Bench, a benchmark built from real-world datasets covering three flood-prone U.S. states: Texas, Florida, and Louisiana.
Key methodological highlights include:
- Join Taxonomy: The benchmark categorizes queries into three types: Key-based (standard ID joins), Spatial (geometry-based joins like
ST_Intersects), and Hybrid (a mix of both). - Difficulty Tiers: 443 question-SQL pairs are organized into six levels (L0 to L5), ranging from simple single-table counts to "triple-table spatial–spatial joins."
- RAG Framework: To evaluate the models, the authors used a Retrieval-Augmented Generation (RAG) pipeline. This system doesn't just give the LLM the whole database schema; it performs "multi-granularity retrieval" to find the most relevant tables and columns first, then provides the model with "functional notes" (domain-specific SQL tips) and explicit "join rules."
- Semantic Evaluation: Because spatial SQL queries are computationally expensive to execute, the authors used a proxy for accuracy: Cosine Similarity. They embedded both the "gold standard" SQL and the model-generated SQL into a high-dimensional vector space and measured how closely they matched.
Datasets
The benchmark integrates ten heterogeneous tables sourced from public U.S. government portals (U.S. Census, FEMA, CDC/ATSDR, and HIFLD):
- Non-spatial layers: NFIP claims, Social Vulnerability Index (SVI), Community Resilience Estimates (CRE), and National Risk Index (NRI).
- Polygon layers: Floodplains, census tracts, ZIP Code Tabulation Areas (ZCTA), and counties.
- Point layers: Schools and hospitals.
Key Insights and Ideas
- Spatial Reasoning is the "Final Boss": While LLMs are becoming proficient at standard database queries, their performance drops sharply when they have to reason about geometry. The jump from L0 (simple) to L5 (complex spatial) shows a clear "complexity tax."
- Metadata is the Bridge: The study highlights that LLMs cannot "guess" how to join complex geospatial layers. Providing structured metadata—specifically explicit join rules and functional notes about Coordinate Reference Systems (CRS)—is essential for generating valid queries.
- The Scaling Law Holds (Mostly): Larger models generally perform better, but even the largest models struggle with the specific syntax of spatial functions (like
ST_AreaorST_Contains) without proper prompting. - Open-Source is Catching Up: DeepSeek-V3.2-685B emerged as a powerhouse, outperforming many proprietary models and showing that open-weights models are becoming viable for specialized reasoning tasks.
Key Results
The authors evaluated over twenty state-of-the-art LLMs.
- Top Performers: GPT-4o and Claude-4.5-Opus demonstrated the strongest overall performance across all difficulty levels.
- Open-Source Champion: DeepSeek-V3.2-685B was the strongest open-source model, achieving scores comparable to top-tier proprietary models (often maintaining a cosine similarity >0.90 even on complex tasks).
- Performance Degradation: For most models, there is a noticeable dip in accuracy as they move from L0 (single table) to L3/L4 (triple-table joins). For example, while many models score near 0.95 on simple tasks, they often struggle to maintain that consistency when spatial intersections are introduced.
Limitations and Future Work
- Non-Execution Evaluation: The primary limitation is the use of cosine similarity instead of execution-based evaluation (checking if the SQL actually returns the right data). While similarity is a good proxy, it doesn't catch logical errors that might still result in "similar-looking" code.
- Domain Specificity: The benchmark is currently limited to flood management. While this is a critical domain, the authors suggest that the framework could be expanded to other geospatial fields like urban planning or logistics.
- Future Directions: The authors point toward the need for "domain-aware" Text-to-SQL methods—models that are pre-trained or fine-tuned specifically on geospatial libraries and geographic logic.
Summary updated