Saved in:
Bibliographic Details
Main Authors: Qiu, Rihong, Yang, Zhibang, Jiang, Xinke, Liao, Weibin, Gao, Xin, Chu, Xu, Zhao, Junfeng, Wang, Yasha
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2512.22744
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909976943919104
author Qiu, Rihong
Yang, Zhibang
Jiang, Xinke
Liao, Weibin
Gao, Xin
Chu, Xu
Zhao, Junfeng
Wang, Yasha
author_facet Qiu, Rihong
Yang, Zhibang
Jiang, Xinke
Liao, Weibin
Gao, Xin
Chu, Xu
Zhao, Junfeng
Wang, Yasha
contents Text-to-SQL translates natural language questions into SQL statements grounded in a target database schema. Ensuring the reliability and executability of such systems requires validating generated SQL, but most existing approaches focus only on syntactic correctness, with few addressing semantic validation (detecting misalignments between questions and SQL). As a consequence, effective semantic validation still faces two key challenges: capturing both global user intent and SQL structural details, and constructing high-quality fine-grained sub-SQL annotations. To tackle these, we introduce HEROSQL, a hierarchical SQL representation approach that integrates global intent (via Logical Plans, LPs) and local details (via Abstract Syntax Trees, ASTs). To enable better information propagation, we employ a Nested Message Passing Neural Network (NMPNN) to capture inherent relational information in SQL and aggregate schema-guided semantics across LPs and ASTs. Additionally, to generate high-quality negative samples, we propose an AST-driven sub-SQL augmentation strategy, supporting robust optimization of fine-grained semantic inconsistencies. Extensive experiments conducted on Text-to-SQL validation benchmarks (both in-domain and out-of-domain settings) demonstrate that our approach outperforms existing state-of-the-art methods, achieving an average 9.40% improvement of AUPRC and 12.35% of AUROC in identifying semantic inconsistencies. It excels at detecting fine-grained semantic errors, provides large language models with more granular feedback, and ultimately enhances the reliability and interpretability of data querying platforms.
format Preprint
id arxiv_https___arxiv_org_abs_2512_22744
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Bridging Global Intent with Local Details: A Hierarchical Representation Approach for Semantic Validation in Text-to-SQL
Qiu, Rihong
Yang, Zhibang
Jiang, Xinke
Liao, Weibin
Gao, Xin
Chu, Xu
Zhao, Junfeng
Wang, Yasha
Machine Learning
Text-to-SQL translates natural language questions into SQL statements grounded in a target database schema. Ensuring the reliability and executability of such systems requires validating generated SQL, but most existing approaches focus only on syntactic correctness, with few addressing semantic validation (detecting misalignments between questions and SQL). As a consequence, effective semantic validation still faces two key challenges: capturing both global user intent and SQL structural details, and constructing high-quality fine-grained sub-SQL annotations. To tackle these, we introduce HEROSQL, a hierarchical SQL representation approach that integrates global intent (via Logical Plans, LPs) and local details (via Abstract Syntax Trees, ASTs). To enable better information propagation, we employ a Nested Message Passing Neural Network (NMPNN) to capture inherent relational information in SQL and aggregate schema-guided semantics across LPs and ASTs. Additionally, to generate high-quality negative samples, we propose an AST-driven sub-SQL augmentation strategy, supporting robust optimization of fine-grained semantic inconsistencies. Extensive experiments conducted on Text-to-SQL validation benchmarks (both in-domain and out-of-domain settings) demonstrate that our approach outperforms existing state-of-the-art methods, achieving an average 9.40% improvement of AUPRC and 12.35% of AUROC in identifying semantic inconsistencies. It excels at detecting fine-grained semantic errors, provides large language models with more granular feedback, and ultimately enhances the reliability and interpretability of data querying platforms.
title Bridging Global Intent with Local Details: A Hierarchical Representation Approach for Semantic Validation in Text-to-SQL
topic Machine Learning
url https://arxiv.org/abs/2512.22744