MSAE-SQL: A Multi-layer Semantic-Aware Enhanced NL2SQL Model
摘要
Building cross-domain NL2SQL parsers relies heavily on accurate schema linking—the ability to align question tokens with database schema elements. However, existing methods based on n-gram or static similarity often fail when natural language expressions differ from database terms. To address this, we propose MSAE-SQL, a multi-layer semantic-aware enhanced NL2SQL model. Our approach leverages pre-trained language models (PLMs) to capture semantic correlations, constructs a schema linking graph by combining hyperbolic space distances and cosine similarity, and introduces relation-guided graph encoding to enhance the contextual representation of question-schema pairs. Finally, we apply irrelevant table pruning in decoding to improve SQL generation accuracy. Experiments on Spider, Spider-SYN, and Spider-DK benchmarks demonstrate the superior performance and robustness of our model.